Has anyone implemented the OneAll API into their app?

I’m trying to build an app that will post to social media on behalf of our clients.

They login to my app, connect their social media accounts, and my app send out posts.

I’ve decided to use the unified API provided by OneAll because social media APIs tend to be varied, complex, and ever changing. OneAll basically wraps all the different social APIs into one.

But this is the first API I’ve tried to integrate into Bubble and I’m having trouble figuring out how it implement it.

Has anyone integrated with OneAll before?

Did you use the Bubble API Connector plugin to connect it up or did you code a custom plugin? If the latter, what approach did you use?

I understand APIs at a basic level, but usually I just send a request to an endpoint and then get a response I can use. The OneAll API seems more complex…

Their API docs show a JavaScript API and a REST API. Are they two different things or does one rely on the other?

They also have development guides which have confused me even more. It wants me to run scripts and implement call backs etc. Is this stuff required before I setup the API? Or is it something different again?

Any direction on how I should get started would be helpful.

Screenshots of what you’ve done yourself would be great. But if not possible just some high level direction like “Do this, then next this. Then setup that.” etc.

Hi @NigelG I’m selfishly tagging you here because when searching the forum you were the only person I could find that has talked about OneAll before :slight_smile:

UPDATE:

I think the easiest path forward is to put all this into a custom plugin and use the Direct Connect method.

The trickiest part will be creating the Call Back Script (step 6) so if anyone has one to share that would be great!

In addition to that, where should the callback script be hosted? The docs give a PHP example but as far as I can tell we can’t host or run PHP scripts on Bubble, or any scripts at all for that matter.

Link on a Button with URL as per…

Direct Connect \ Social Login | docs.oneall.com

So something like … https://blah.api.oneall.com/socialize/connect/direct/facebook?service=social_link&callback_uri=https://yoursite.com&action=link_identity

Store the token.

Use token in the API calls.

Facebook will require some tinkering as it does insta as well and also pages/groups.

This gives you one login per “type” (twitter/FB pages etc) - the JS method is going to be a lot nicer UI but is probably more complex as you say.

Thanks @NigelG !

Gives me a much clearer direction.

But I’m still confused about the callback script (e.g. callback_uri param).

Do I just use my domain like in your Direct Connect example above? Or do I need to create an actual script and host it somewhere?

Because I’ve started building this into a custom Bubble plugin. Each call has a Bubble warning saying “You need to initialize this call before it will work.” but when I click the button to initialise the call it returns this error about the callback script:

Status code 404
{“response”:{“request”:{“date”:“Wed, 30 Dec 2020 00:47:16 +0100”,“resource”:"/connections/.json",“status”:{“flag”:“error”,“code”:404,“info”:“We are really sorry, but the resource you are trying to access does not exist. If you are currently implementing our services, then please make sure that your callback_uri points to a file on your server and not on ours.”}}}}

It isn’t a script in this case, it just means that you redirect to the auth “page” of the provider who then send you back to whatever is in the redirect_uri. Your page will need to read in the parameters on the return address, so it can store the key.

The script version makes it much more integrated …

image

So you get a modal (as above) or an embed. But for that you need the JS library on the page. And that means a plugin. Can’t help you there.

It is a nicer solution, but more work.

This is the sticking point for me.

How is that done exactly?

OneAll docs say: “After the authentication the user is redirected to the specified callback_uri to which the OneAll API adds the GET parameter connection_token .”

I created a OneAll User Token field on the User data type to store the returned connection_token.

But I have no idea how to do that in Bubble.

How do I catch the payload and store it in the OneAll User Token field?

Do it one step at a time for now. Get the redirect working first. You will get something back that looks like this…

https://yourapp.com/page?type=twitter&oa_action=social_link&oa_connector=direct_connect&connection_token=266b47f1-5d0b-4a36-b943-a92209bc6#succeeded

You will then need to do a “on page load” action to see if the page being loaded is from login, or a refresh, or a redirect back from oneall. So you can do this by checking to see if oa_connector=direct_connect is present.

Then you can read in the connection-token, and store it against the type (twitter in this case).

You can bring them back to either a separate page or your main page. Bubble should remember that they are logged in.

Once you have this working, then check out what the return looks like if the login didn’t work. And handle that.

Just take it step but step, not all at once. This is complicated !

Hi @NigelG, massive thanks for point me in the direction!

I was saving my reply for when I came up against a road block… low and behold I’ve hit one now…

I managed to setup a deep integration using the Direct Connect method for Social Links (i.e. posting to their profiles). It’s complex but working great, and I feel like I have a solid grasp on the OneAll API now.

What I’m hoping to do next is use OneAll to manage the Social Logins.

But as far as I can tell, the only way Bubble allows users to login without a password is to setup an API using OAuth User-Agent Flow authentication. You have to use that authentication type because without it no Oauth providers will not show in the “Signup/login with a social network” workflow action (screenshot below).

Screen Shot 2021-01-20 at 4.22.49 pm

Do you know if OneAll can be setup using the API Connector and OAuth User-Agent Flow authentication? I can’t figure out the correct settings.

I have also tried this workaround I found on another thread, it avoids the need for an API Connector:

But this has it’s own problems because a user can sign up with a social account, and then later on decide to add a password. If they do that and sign in again using the social network the password they setup will be overridden in Step 4 of the workflow.

If you know how to setup OneAll OAuth User-Agent Flow authentication, or perhaps a good workaround, I would be very grateful :slight_smile: