====获取token====
**调用地址**
POST /getToken.json
**请求参数**
^名称 ^类型 ^必需的 ^注释 ^
|grant_type |varchar |是 |验签类型,写入client_credentials即可|
**调用者权限**
所有客服
**调用示例**
curl --location --request POST 'http://www.bangwo8.com/api/token.php' \
--header 'Authorization: Basic U2VjcmV0SUQ6U2VjcmV0' \
--form 'grant_type="client_credentials"'
**返回值参数**
^名称 ^类型 ^注释 ^
|access_token |varchar |token令牌|
|expires_in |int |有效时间:3600s|
|token_type |varchar |token类型|
|scope |varchar |权限|
**返回值示例**
成功时:
{
"access_token": "d560fbabcabffdba6e1c50767312d331ffbed879",
"expires_in": 3600,
"token_type": "Bearer",
"scope": null
}
密钥不正确或者无法匹配时:
{
"error":"invalid_client",
"error_description":"The client credentials are invalid"
}
请求方式不正确时:
{
"error": "invalid_request",
"error_description": "The request method must be POST when requesting an access token",
"error_uri": "http://tools.ietf.org/html/rfc6749#section-3.2"
}