Authentication

OAuth2 Token

OAuth2 Token endpoint. The required parameters depend on the grant type requested:

Required ParameterGrant Type
codeauthorization_code
redirect_uriauthorization_code
member_idmember_app
organization_idorganization_app
refresh_tokenrefresh_token

This endpoint requires that you pass in your client credentials using the HTTP Basic authentication scheme as per outlined in the spec. Including your client credentials in the request-body is not supported.

Note: The specific authorization code provided for the code parameter must only be used successfully once. If an authorization code is used a second time, all tokens granted with the first /oauth2/token call will be revoked.

post/oauth2/token

Request

  • Base URL
    https://platform.hootsuite.com
  • URL
    https://platform.hootsuite.com/oauth2/token
  • Auth
    HTTP basic

Headers

Authorizationstring required

A base64-encoded client_id:client_secret string used for authentication.

Request body application/x-www-form-urlencoded

grant_type'authorization_code' | 'client_credentials' | 'member_app' | 'organization_app' | 'refresh_token' required

The OAuth2 grant_type used.

codestring

The authorization code granted by the /oauth2/auth endpoint. Required for grant type: authorization_code

redirect_uristring

The URI to redirect to after authentication. Required for grant type: authorization_code

member_idstring

The member id of the user to grant a token for. Required for grant type: member_app

organization_idstring

The organization id to grant a token for. Required for grant type: organization_app

refresh_tokenstring

The refresh token code previously granted. Required for grant type: refresh_token

Response

Success

access_tokenstring

The access token.

token_Typestring

The access token type.

expires_innumber

The number of seconds until expiry

refresh_tokenstring

The refresh token.

scopestring

The scopes granted to this token.

Example response

{
  "access_token": "e9a90a81-xf2d-dgh3-cfsd-23jhvn76",
  "token_Type": "Bearer",
  "expires_in": 2592000,
  "refresh_token": "82d82cf4-76gf-gfds-nt3k-lzpo12jg",
  "scope": "offline"
}

Changes

No recorded changes to this operation across all 1 revision of this API.