Obtaining the Token of CC-Messaging
Interface Function
The ApplyToKen interface is invoked to obtain the token of CC-Messaging.
Request Method
This interface supports only the POST method, and does not support the PUT, GET, or DELETE method.
Request URL
https://API Fabric domain name/apigovernance/api/oauth/tokenByAkSk
Request Message
- Message header
x-app-key: app_key in Preparations Before Development
Authorization: Bearer + AccessToken obtained in Generating a Token Using the API Fabric
Content-Type:application/json; charset=UTF-8
- Message body
The following provides an example of the request message body of this interface:
{ "userId":"xxx", "userName":"xxx", "channelId":"xxx", "locale":"zh", }
Table 1 describes the parameters in the request message body of this interface.
Response Message
The following provides an example of the response message body of this interface:
{ "resultCode":"0", "token":"xxx" }
Table 2 describes the parameters in the response message body of this interface.
Troubleshooting
The following is the common returned error information (returned when http status is not 200):
{ "errorCode":"0", "exceptionInfo":"xxx" }
Find the cause based on the description in exceptionInfo. For example, if error code 403 and the following exceptionInfo are returned, the token applied in the previous section has expired:
"auth fail! please apply or refresh the access token from the server!"
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot