Oauth Access Token

This endpoint allows you to exchange an Authorization Code for a short-lived Instagram User Access Token.

Creating

POST /oauth/access_token

Exchange an Authorization Code for a short-lived Instagram User Access Token.

Requirements

None.

Request Syntax

POST https://api.instagram.com/oauth/access_token

Body Parameters

Include the following parameters in the POST request body.

KeySample ValueDescription

client_id
Required
Numeric string

990602627938098

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

client_secret
Required
String

a1b2C3D4

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

code
Required
String

AQBx-hBsH3...

The Authorization Code you want to exchange for an Instagram User Access Token.

grant_type
Required
String

authorization_code

Set this value to authorization_code.

redirect_uri
Required
String

https://socialsizzle. heroku.com/auth/

The redirect URI you used when constructing the Authorization Window URL. This must be the same URI or we will reject the request.

Response

{
  "access_token": "{access-token}",
  "user_id": {user-id}
}

Response Contents

FieldValue Description

access_token
String

The user's app-scoped short-lived Instagram User Access Token.

user_id
Integer

The user's app-scoped User ID.

cURL Example

Request

curl -X POST \
  https://api.instagram.com/oauth/access_token \
  -F client_id=990602627938098 \
  -F client_secret=eb8c7... \
  -F grant_type=authorization_code \
  -F redirect_uri=https://socialsizzle.herokuapp.com/auth/ \
  -F code=AQCvI...

Response

{
  "access_token": "IGQVJ...",
  "user_id": 17841405793187218
}

Reading

This operation is not supported.

Updating

This operation is not supported.

Deleting

This operation is not supported.