API 参考 › 鉴权
POST/token
换取访问 Token
用 AppID + AppSecret 换取短期访问 Token。Token 有效期见 expires_in(拟定 7200 秒)。
免鉴权(签名令牌)
请求体
| 字段 | 必填 | 类型 | 约束 | 说明 |
|---|---|---|---|---|
grant_type | 必填 | string(client_credentials) | ||
app_id | 必填 | string | 格式 ^app_[a-z0-9]+$ | |
app_secret | 必填 | string | ≥32 |
curl -X post https://api.cleerscience.com/v1/token \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"grant_type": "client_credentials", "app_id": "app_8f3ka2m9x0", "app_secret": "sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'{
"access_token": "at-eyJhbGciOi...",
"token_type": "Bearer",
"expires_in": 7200,
"scope": [
"xrd",
"raman",
"nmr",
"ms"
]
}状态码
| HTTP | 说明 |
|---|---|
| 200 | 签发成功 |
| 401 | 凭证无效 |
| 429 |