Skip to main content
Version: V4.0

Authorization API


Password Grant - Get Access Token

Request URL

POST /api/v1.0/invoke/open-ability/method/oauth2/token

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/x-www-form-urlencoded
AcceptStringHeaderYesAccept, the value is application/json
grant_typeStringBodyYesGrant type, the value is password
client_idStringBodyYesClient ID
client_secretStringBodyYesClient secret
scopeStringBodyYesAuthorization scope, the value is manager
usernameStringBodyYesUsername
passwordStringBodyYesPassword
expires_inIntegerBodyNoToken expiration time (s)

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
access_tokenStringBodyAccess token
refresh_tokenStringBodyRefresh token
token_typeStringBodyToken type, the value is bearer
expires_inIntegerBodyToken expiration time (s)

Request Example

POST /api/v1.0/invoke/open-ability/method/oauth2/token

Content-Type: application/x-www-form-urlencoded

Accept: application/json

grant_type=password&

client_id=caa0b4dffd57202a157ed46664f93c192&

client_secret=s75b058bfd9e4e0659d75b67aw3334745&

username=ucaa0b4dffd57202a157bf46664f9dc19&

password=pucaa0b4dffd57202a157bf46664q93c1&

scope=manager

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {
"access_token": "ad5db2a3d3ab09e5890c4ffba9eaf3c52",
"refresh_token": "r91b9ba8bc024e23617f63f908dc15951",
"token_type": "bearer",
"expires_in": 3600
}
}

Failure Return Example

See Failure Return Example



Refresh Access Token

Request URL

POST /api/v1.0/invoke/open-ability/method/oauth2/token

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/x-www-form-urlencoded
AcceptStringHeaderYesAccept, the value is application/json
grant_typeStringBodyYesAuthorization type, the value is refresh_token
client_idStringBodyYesClient ID
client_secretStringBodyYesClient secret
refresh_tokenStringBodyYesRefresh token
expires_inIntegerBodyNoToken expiration time (s)

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
access_tokenStringBodyAccess token
refresh_tokenStringBodyRefresh token
token_typeStringBodyToken type, the value is bearer
expires_inIntegerBodyToken expiration time (s)

Request Example

POST /api/v1.0/invoke/open-ability/method/oauth2/token

Content-Type: application/x-www-form-urlencoded

Accept: application/json

grant_type=refresh_token&

client_id=caa0b4dffd57202a157bf46664f93c192&

client_secret=s75b058bfd9e4e0659d75b67a03334745&

refresh_token=r91b9ba8bc024e23617f63f908dc15950

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {
"access_token": "ad5db2a3d3ab09e5890c4ffba9eaf3c53",
"refresh_token": "r91b9ba8bc024e23617f63f908dc15952",
"token_type": "bearer",
"expires_in": 3600
}
}

Failure Return Example

See Failure Return Example