Search code examples
iosinstagraminstagram-api

instagram follow api error


Objective -C / iOS

I will use follow api of instagram .

set URL :https://api.instagram.com/v1/users/{userid}/relationship?access_token={access_token}

parameter string is "action=follow" ,and data sending way of post

But , it doesn't works. I received error.

meta =     {
    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.";
    "error_type" = OAuthPermissionsException;
};

When i use login api of instagram , scope = relationships+likes ... data sended

How to use instagram follow api in iOS.


Solution

  • Instagram changed its API guidelines since mid April, 2015.

    https://help.instagram.com/contact/185819881608116

    The OAuth 2.0 specification allows you to specify the scope of the access you are requesting from the user. All apps have basic read access by default, but if you plan on asking for extended access such as liking, commenting, or managing friendships, you need to specify these scopes in your authorization request. Note that in order to use these extended permissions, first you need to submit your app for review. For more information on how to submit your app for review, please check out the documentation of the endpoint that you plan to use.

    Hence you need to get your app reviewed by instagram first to use these extended permissions such as Likes, Comments and Relationships.