STS Token系统可产生认证令牌,供后续API呼叫使用。
产生STS 令牌,需要将您的Agent Code与Agent Secret提供给STS系统,系统将回传一个 JWT格式的令牌给您,供后续呼叫MG+ API使用。
POST https://sts-demo.k2net.io/connect/token
Request Headers
JSON
Content-Type: “application/x-www-form-urlencoded”
Request Body
JSON
client_id: “TestAgent”
client_secret: “6babc1e450712345a973e3abc0bd2”
grant_type: “client_credentials”
一般情况下,client_id 对应于Agent Code,而 client_secret 对应于Agent Secret。
Response Headers
JSON
Content-Type: “application/json; charset=UTF-8”
200 Response Body Example
JSON
{
"access_token": "eyJhbGc...",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "api ldenrichmentapi"
}