Instagram User Id Key Path

I am setting up instagram login with the API-Connector. I am doing this because the standard-plugin does not let me get all the information I need.

I can sign up with instagram and access the media. However, after the sign up the instagram account is associated with the wrong bubble-user-account. So when someone logs in with instagram, bubble will load the wrong user.(It seems to be always the last one that was created).

Also when I try to display “Current User’s Instagram’s Id” It is always empty.

My suspicion: I am not correctly passing the instagram-user id to bubble. So they probably all default to the same Id which is why after login the wrong user is retrieved.

This is most likely because I don’t have the right field in “User Id Key Path”. I Put in “id”

The response for the access token endpoint is
{
“access_token”: “XXYYYZZZZ”,
“user”: {
“id”: “5453947405”,
“username”: “carlos.freund”,
“profile_picture”: “https://scontent.cdninstagram.com/t51.2885-19/s150x150/18380481_252934631780295_7988266960104194048_a.jpg”,
“full_name”: “Carlos Freund”,
“bio”: “I’m on instagram!”,
“website”: “”
}
}

The response from the user-profile endpoint(https://api.instagram.com/v1/users/self/) is

{
  "data": {
    "id": "5453947405",
    "username": "carlos.freund",
    "profile_picture": "https://scontent.cdninstagram.com/t51.2885-19/s150x150/18380481_252934631780295_7988266960104194048_a.jpg",
    "full_name": "Carlos Freund",
    "bio": "I'm on instagram!",
    "website": "",
    "counts": {
      "media": 3,
      "follows": 3,
      "followed_by": 6
    }
  },
  "meta": {
    "code": 200
  }
}

Aaand I figured it out a minute later myself :smiley:

So to bubble associated the user-account with the id that is retrieved from the user-profile endpoint.
So the correct User Id Key Path with Instagram is “data.id”

1 Like

Hey, thank’s for sharing.

I am not a coder, could you explain a little more how do you get followers number on a workflow. I would really appreciate such a explanation. thank’s in advance