获取北向接口鉴权Token
功能介绍
获取OpenAPI的接入Token
接口约束
URI
POST /oauth2/oauth/rest_token
请求参数
|
接口字段 |
字段类型 |
是否必填 |
说明 |
备注 |
|
client_id |
String |
|
固定值 |
"client_id":"isdp-saas-openapi" |
|
client_secret |
String |
|
固定值 |
"client_secret":"isdp-saas-openapi" |
|
grant_type |
String |
|
固定值 |
"grant_type":"password" |
|
username |
String |
|
应用ID |
创建应用会自动生成应用ID |
|
password |
String |
|
应用令牌 |
创建应用会自动生成应用令牌 |
表8.4.1-1请求参数
响应参数
|
接口字段 |
字段类型 |
是否必填 |
说明 |
备注 |
|
access_token |
String |
|
Token值 |
|
|
token_type |
String |
|
Toke类型标识 |
|
|
expires_in |
INT |
|
过期时间,单位:秒 |
表8.4.1-2响应参数
请求示例
入参:
{
"client_id":"isdp-saas-openapi",
"client_secret":"isdp-saas-openapi",
"grant_type":"password",
"username": "sdcpoPIW3c**********wbzGASZvPg8",
"password":"JvdSkBajLsBP*********************LqArtgqf+edw="
}
响应示例
状态码: 200
{
"access_token": "********-****-****-****-****5b1308c7PkYea****ATlBPsx****C6HWOsBoC****/****9tMxI=",
"token_type": "bearer",
"expires_in": 1199,
"scope": "all",
"plat_user": {
"userId": 640778,
"userNo": "sdcpoPIW3cegmKU3SIaffwbzGASZvPg8",
"userName": "TestRTC1",
"userType": "API",
"phone": null,
"tenantId": 886,
"status": "0",
"deleteFlag": 0,
"pwdUpdateDate": "2021-12-06T02:47:00.000+00:00",
"userExtendMap": {
"clientId": "isdp-saas-openapi",
"userPrivacyAgreement": {
"privacyAgreementAction": "0",
"privacyPolicyAction": "0",
"privacyAgreementVX": null,
"privacyAgreementVXAction": "1",
"serviceAgreement": "V5",
"privacyPolicy": "V2",
"privacyAgreement": "V4",
"serviceAgreementAction": "0"
},
"versionMap": {}
},
"password": null,
"salt": null,
"currentLoginType": "password"
}
}
状态码: 401
{
" error": "invalid_token",
"error_description": "check_token error"
}