API:获取AccessToken
POST https://api.bimface.com/oauth2/token
在调用其他API之前,必须先获取AccessToken。AccessToken的有效期为7天。
请求(Request)
Header
key | value | 示例 |
---|---|---|
Authorization | 将字符串 appKey:appSecret 拼接后(中间用冒号连接),对其进行BASE64编码, 然后在编码后的字符串前添加字符串Basic和一个空格, 即:“Basic” + “ ” + Base64Encode(appKey + “:” + appSecret) | Basic xxxx |
Content-Type | application/json | … |
Url Parameter
无
Request Body
无
curl -X POST
-H "Authorization: <your authorization>"
-H "Content-Type: application/json"
"https://api.bimface.com/oauth2/token"
响应(Response)
HTTP STATUS
200
成功返回
{
"code": "success",
"message": null,
"data": {
"token": "xxxx-xxxx-xxxx-xxxx",
"expireTime": "2016-05-01 01:11:11"
}
}
字段 | 类型 | 描述 | 示例 |
---|---|---|---|
token | String | AccessToken | xxxx-xxxx-xxxx-xxxx |
expireTime | String | 过期时间,格式:yyyy-MM-dd HH:mm:ss | 2016-05-01 01:11:11 |
失败返回
{
"code": "authentication.failed",
"message": "Invalid basic authentication token."
}
错误码
code | 说明 |
---|---|
system.error | BIMFACE系统异常 |
authentication.failed | API访问合法性校验失败 |