iosinstagraminstagram-api

Instagram relationship (POST) API is not working in iOS app


I'm developing an iOS iPhone app using Instagram API, in which user allow to follow another user account using Instagram Relationship API and I'm always getting an error for this API request:

API request:

https://api.instagram.com/v1/users/157xxxx469/relationship?access_token=169527xxxx.f71bc56.fb2a414a0ee7469ca381a3659f5cxxxx

Response Received:

 {
  "meta": {
    "error_type": "OAuthPermissionsException",
    "code": 400,
    "error_message": "This request requires scope=relationships, but this access token is not authorized with this scope. The user must re-authorize your application with scope=relationships to be granted write permissions."
  }
}

When I'm authorized with scope at the time of login I use the URL below for the request:

https://api.instagram.com/oauth/authorize/?client_id=56a6xxxx6a8b41f288477fxxxxea253e&redirect_uri=http://localhost:8888/MAMP/&response_type=token&scope=likes+comments+relationships

But I am surprise that users ask for access only basic info permission not relationship, comments or like.

Please refer to the screenshot below:

enter image description here

I can't tell whether I've been granted the privilege or not to consume the Instagram Relationship API; how can I possibly check that?

Also, what am I doing wrong and how can I resolve it?


Solution

  • Once approved you will see the permission in the authorization screen, like this:

    Follow/Unfollow other users

    enter image description here