Oauth Authorize

This endpoint returns the Authorization Window, which app users can use to authenticate their identity and grant your app permissions and Instagram User Access Tokens.

Creating

This operation is not supported.

Reading

GET /oauth/authorize

Get the Authorization Window.

Requirements

None.

Request Syntax

GET https://api.instagram.com/oauth/authorize
  ?app_id={app-id},
  &redirect_uri={redirect-uri},
  &response_type=code,
  &scope={scope}

Query String Parameters

Augment the request with the following query parameters.

KeySample ValueDescription

app_id
Required
Numeric string

990602627938098

Your Instagram App ID displayed in App Dashboard > Products > Instagram > Basic Display.

redirect_uri
Required
String

https%3A%2F%2Fsocialsizzle. herokuapp.com%2Fauth%2F

A URI where we will redirect users after they authenticate. Make sure this exactly matches one of the base URIs in your list of valid oAuth URIs. Keep in mind that the App Dashboard may have added a trailing slash to your URIs, so we recommend that you verify by checking the list.

response_type
Required
String

code

Set this value to code.

scope
Required
Comma-separated list

user_profile,user_media

A comma-separated list of scopes (which map to permissions) to request from the app user. user_profile is required.

state
String

1

An optional value indicating a server-specific state. For example, you can use this to protect against CSRF issues. We will include this parameter and value when redirecting the user back to you.

Response

The Authorization Window, which you should display to the app user. Once the user authenticates, the window will redirect to your redirect_uri and include an Authentication Code, which you can then exchange for an Instagram User Access Token.

HTTP Example

https://api.instagram.com/oauth/authorize
  ?app_id=990602627938098
  &redirect_uri=https%3A%2F%2Fsocialsizzle.herokuapp.com%2Fauth%2F
  &scope=user_profile,user_media
  &response_type=code

Successful Authorization

If authentication is successful, the Authorization Window will redirect the user to your redirect_uri and include an Authorization Code. Capture the code so you can exchange if for an access token.

Codes are valid for 1 hour and can only be used once.

Sample Successful Authorization Redirect

https://socialsizzle.herokuapp.com/auth?code=AQBx-hBsH3...

Canceled Authorization

If the user cancels the authorization flow, we will redirect the user to your redirect_uri and append the following error parameters. It is your responsibility to fail gracefully in these situations and display an appropriate message to your users.

ParameterValue

error

access_denied

error_reason

user_denied

error_description

The+user+denied+your+request

Sample Canceled Authentication Redirect

https://socialsizzle.herokuapp.com/auth/
  ?error=access_denied
  &error_reason=user_denied
  &error_description=The+user+denied+your+request

Updating

This operation is not supported.

Deleting

This operation is not supported.