申請(qǐng)動态令牌
## 接口名稱
申請(qǐng)動态令牌
## 接口描述
在調用标識關聯接口前,需要向标識系統申請(qǐng)訪問權限動态令牌。
## 接口地址
https://api.gdsinsing.com/safety/safe/token
## 調用方式
|方法|數(shù)據類型|
|-|-|
|[ ] GET|[ ] form-data|
|[X] POST|[X] x-www-form-urlencoded|
|[ ] PUT|[ ] raw|
|[ ] DELETE||
## 參數(shù)說明(míng)
|參數(shù)名|位置|類型|必填|說明(míng)|
|-|-|-|-|-|
|account|body|String|是|username即登錄公共服務平台的用戶名|
|timestamp|body|String|是|時(shí)間(jiān)戳 當前系統時(shí)間(jiān)的long值,需要和(hé)SM9簽名時(shí)候使用的時(shí)間(jiān)戳保持一緻|
|sign|body|String|是|SM9簽名 使用用戶簽名密鑰對username+timestamp的數(shù)字簽名值(SM9),即SM9簽名接口中返回到的SM9簽名值|
## 返回結果
|參數(shù)名|位置|類型|說明(míng)|
|-|-|-|-|
|result||Int|調用結果(0:失敗,1:成功)|
|data||String|動态令牌token|
|errorcode||String|錯誤碼|
|msg||String|錯誤信息|
|solve||String|解決方法|
#### 成功返回
```json
{
"result": 1,
"data": "994857e10c294bdc8f5f2b0c2309f429",
"errorcode": null,
"msg": null,
"solve": null
}
```
#### 失敗返回
```json
{
"result": 0,
"data": null,
"errorcode": "00100017",
"msg": "企業賬戶不正确",
"solve": "請(qǐng)輸入正确的企業賬号(account)"
}
```
## 調用例子
``` JavaScript
var timestamp = "...."; //時(shí)間(jiān)戳
var sign = "...."; //(88.168.89+timestamp)的SM9簽名值
var settings = {
"url": "https://api.gdsinsing.com/safety/safe/token",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"account": "88.168.89",
"timestamp": timestamp,
"sign": sign
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
```