I had been working on getting the api connector to give me an access token when feeding it authorization code for days and could only get a “400 invalid authorization token” error. Then I thought, let’s try in postman. It worked first try.
Obviously it works cause it works in postman. . . . so the question; how do I get the bubble api connector to do whatever postman is doing to feed the valid auth token?
Can you share what you did in postman and api connector and also where is the error? (is it before you go to the login page or after… and if after, is it after the redirection and the error come from Bubble?)
Just updated the post with screenshots - error is after I the login screen, the instagram redirect uri is appended with the access code, which is a parameter when swapping the code for an auth token.
So you are doing the manual process and not the user-agent Bubble auth.
Remove & at the beggining of your body. This is not needed and probably create issue.
Which error do you get when you try to intialize the token call?
Also, did you set none/selfhandled for the auth part?
When I try and initialize the call, I get the error in the second screenshot.
I’m not using the user-agent bubble auth, so I’m assuming that’s the manual process. - yes using non-self handled for the auth. I’ll try tweaking some of those settings.
Try to use a tool like requestbin to compare the request in postman vs in Bubble. Also, be sure to not have shared headers that could create a conflict with the one set in call
Not sure what or why — but I deleted the call I had from the api connector plugin and started from scratch. . . . and it worked. the ole unplug it and plug it back in trick. . . .
Hey Tom! How’s it going? Since your response is relatively recent and it seems like you’ve managed to establish all the necessary flows for Instagram authentication, I’ll send my question as a reply.
I have an app where I connect the user’s Instagram and monitor the account and post metrics. My app in Meta Developer is created and in Live Mode (but not verified yet, and that might be important for the error I’m facing).
Back to the flow in Bubble: the user clicks the “connect to Instagram” button, goes to the authentication page, and then returns to the app in Bubble. My workflow captures the code returned in the URL, strips the #_, and makes a POST request to obtain the short-lived access token. Immediately after, I make another request, this time a GET request, to exchange the short-lived access token for a long-lived one.
Here lies my problem. For users that I assigned the “App Tester” role in Meta Developers, everything works fine. But for my other beta testers, it doesn’t. The GET request fails (error 400), as if Meta is not allowing me to exchange the short-lived token for a long-lived one.
Do you think this is related to the fact that my app in Meta Developers is not verified?
Hi, it’s been a while since I worked on this, but if I remember correctly, you need to get approval from Meta before using the API in production with your users. Meta is usually quite responsive, the validation process typically takes a few days, although there are usually a few back-and-forth exchanges to address all their requirements.