Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 2.1 KB

obtain-token-request.md

File metadata and controls

29 lines (22 loc) · 2.1 KB

Obtain Token Request

Structure

ObtainTokenRequest

Fields

Name Type Tags Description Getter
ClientId String The Square-issued ID of your application, available from the
application dashboard.
String getClientId()
ClientSecret String The Square-issued application secret for your application, available
from the application dashboard.
String getClientSecret()
Code String Optional The authorization code to exchange.
This is required if grant_type is set to authorization_code, to indicate that
the application wants to exchange an authorization code for an OAuth access token.
String getCode()
RedirectUri String Optional The redirect URL assigned in the application dashboard. String getRedirectUri()
GrantType String Specifies the method to request an OAuth access token.
Valid values are: authorization_code, refresh_token, and migration_token
String getGrantType()
RefreshToken String Optional A valid refresh token for generating a new OAuth access token.
A valid refresh token is required if grant_type is set to refresh_token ,
to indicate the application wants a replacement for an expired OAuth access token.
String getRefreshToken()
MigrationToken String Optional Legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if grant_type is set to
migration_token to indicate that the application wants to get a replacement
OAuth access token. The response also returns a refresh token.
For more information, see Migrate to Using Refresh Tokens.
String getMigrationToken()

Example (as JSON)

{
  "client_id": "APPLICATION_ID",
  "client_secret": "APPLICATION_SECRET",
  "code": "CODE_FROM_AUTHORIZE",
  "grant_type": "authorization_code"
}