在使用access_token时,请注意:
access_token的有效期为604800秒(7天),有效期内重复获取返回相同结果,过期后获取会返回新的access_token。
开发者需要缓存access_token,用于后续接口的调用。当access_token失效或过期时,接口会返回http状态码401,需要重新获取access_token。
不能频繁调用获取access_token接口,否则会受到接口调用频率拦截。
curl --location --request POST 'https://api2.hik-cloud.com/oauth/token' \
--header 'Authorization: Bearer ' \
--data-urlencode 'client_id=' \
--data-urlencode 'client_secret=' \
--data-urlencode 'grant_type='
{
"access_token": "62c54b72-c85f-4a4e-8fd0-6941744d0af7",
"token_type": "bearer",
"expires_in": 604799,
"scope": "app"
}