POST /oauth/token refresh token

(Difference between revisions)
Jump to: navigation, search
(Created page with "== Description == Refreshes an access token, generating a new one. == Resource URL == POST https://api.socialidnow.com/v2/marketing/oauth/token == Parameters == === Fo...")
 
(Request)
(2 intermediate revisions by 2 users not shown)
Line 23: Line 23:
 
== Authentication ==
 
== Authentication ==
  
This API requires Social Login App Client authentication. See [[Authentication]].
+
This API requires [[Authentication#Social_Login_App_Client_Authentication|Social Login App Client authentication]].
  
 
== Response ==
 
== Response ==
Line 82: Line 82:
  
 
  curl -iX POST 'https://api.socialidnow.com/v2/marketing/oauth/token' \
 
  curl -iX POST 'https://api.socialidnow.com/v2/marketing/oauth/token' \
  grant_type=refresh_token&refresh_token=17ef19c3e1b7499eaf849d59f220250210b5c44c10c71033d253de8b61b2a3ef \
+
  -d grant_type=refresh_token&refresh_token=17ef19c3e1b7499eaf849d59f220250210b5c44c10c71033d253de8b61b2a3ef \
 
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
 
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
  
Line 97: Line 97:
 
   "access_token": "160205e123c3c9045d2834ffab71a5075a9cda4623b6b4d5cffbabb886814cd3",
 
   "access_token": "160205e123c3c9045d2834ffab71a5075a9cda4623b6b4d5cffbabb886814cd3",
 
   "expires_in": 604800,
 
   "expires_in": 604800,
   "token_type": bearer,
+
   "token_type": "bearer",
 
   "refresh_token": "1039250210b5c44c1dde8bd90c73ef7e361bf19c3e1b74012532a49eaf859f22",
 
   "refresh_token": "1039250210b5c44c1dde8bd90c73ef7e361bf19c3e1b74012532a49eaf859f22",
 
  }
 
  }

Revision as of 19:54, 11 January 2021

Contents

Description

Refreshes an access token, generating a new one.

Resource URL

  POST https://api.socialidnow.com/v2/marketing/oauth/token

Parameters

Form Url Encoded Parameters

grant_type required grant_type. Must be set to refresh_token.
refresh_token required refresh token of an expired access token.

Authentication

This API requires Social Login App Client authentication.

Response

Response Status

ok (200) The access token was generated successfully
bad_request (400) Some required parameter was not informed.
unauthorized (401) The authentication is wrong. See Authentication.
internal_server_error (500) An unknown error happened.

In case of error, one of of the following codes will be set in the JSON response. An error description will also be set accordingly.

Code Description
invalid_client The request authentication is invalid (not given or combination do not match);
invalid_request A required parameter was not informed (grant_type, refresh_token).
unsupported_grant_type The informed grant type is not supported.
invalid_grant The informed refresh token is invalid or the access token is revoked.

Response Body

access_token The generated access token.
expires_in Expiration in seconds.
token_type The token_type. Will be set to bearer.
refresh_token The refresh_token to retrieve a new access token after expiration.

Examples

Request

curl -iX POST 'https://api.socialidnow.com/v2/marketing/oauth/token' \
-d grant_type=refresh_token&refresh_token=17ef19c3e1b7499eaf849d59f220250210b5c44c10c71033d253de8b61b2a3ef \
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "access_token": "160205e123c3c9045d2834ffab71a5075a9cda4623b6b4d5cffbabb886814cd3",
  "expires_in": 604800,
  "token_type": "bearer",
  "refresh_token": "1039250210b5c44c1dde8bd90c73ef7e361bf19c3e1b74012532a49eaf859f22",
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox