Instagram API and Bubble

Hi!

I’d love to create a tool that analyzes hashtags and tracks your posts’ performance. Is there any tutorial on how to use the Instagram Graph API plugin for beginners?

Giorgio

This plugin works pretty good but it takes some getting used to, most of the discussion in the forum post there should help you get started

2 Likes

Hi there. Wondering if you could share how you got @Taiheta’s stellar plugin working? I’ve set up my FB app, configured with Bubble’s generic redirect url and successfully logged in as a test user. However, when I look at the database, the user’s email is not saving. I’m also not clear on how/where to save the User ID and access token. I’m new to this, so sorry if these are basic questions! Much obliged.

I can’t recall exactly how the Email field works or if it is even given to you with the API as I didn’t use it for the project I was involved in.

For the User ID and Access token you might be able to save them right on the User as new Fields (text)

1 Like

Thanks so much for the response here. Really appreciate the insight.

  1. Regarding the email, it should be returning this from the API, based on my reading of FB’s documentation. However, I can’t seem to access it after login through the plugin, which seems odd.
  2. Regarding the other points, I’ve mucked around with the plugin a fair bit more since my last query and have a better grasp on things now. My understanding is that @Taiheta’s plugin is set-up only to return a short-lived access token for each business IG account to which a user grants my application access. That said, I need a long-lived access token, since my app is doing a lot of server-side stuff (scheduled workflows and the like) on behalf of users. I’ve written my own supplementary workflow to exchange the short-lived token for a long-lived one, save it to my DB and schedule to refresh it upon expiry.

That puts me in a pretty good place. That said, I am a little worried about error handling and other invalid token edge cases I might run into when self-handling this piece, since I’m rather a novice.

Small case in point: I had planned to use the FB login as my only authentication method. However, it occurs to me that this might be a bad idea, since (based on my reading of FB’s doc’s) if a user logs out of my application via FB, even my long-lived access token for them will no longer be valid. Do you know if this is the case?

If they remove access from FB then they would not be able to access your app unless they go through the Login flow and agree for the app to access their data again. So you would likely need to rewrite over the acres token with the new one when they login (re-authenticate).

You mentioned bringing up difficulty managing all the edge cases and error handling. I actually run a startup based on a traditional stack that connects to Facebook, Twitter, Instagram and this is a constant battle. Especially with Instagram/Facebook always updating their API’s for security reasons, there will always been a need to monitor and tinker with it to best suit your application

1 Like

Thank you for the response here. Really appreciate it. To circle back to the point about user sessions, I guess it wasn’t clear to me whether “logging out” of my app on Bubble (i.e. via a sign the user out workflow) would effectively end their session on Facebook, as well, or if they would actually have to go and edit the app permissions (i.e. deauthorize) to end the session and necessitate issuing a new token. Do you know which is the case?

Logging out would not usually deactivate access unless you specifically program things in your app to do that (delete the token), which I assume you don’t plan to do.

The only times you should hit errors are when the user removes access for your app from the Facebook/Instagram security settings page or if your tokens expire.

1 Like

Thank you, sir! Really grateful for the insights.

Hi

Has this plugin has been withdrawn