This documentation primarily describes the API call methods on the Tencent Cloud AI Digital Human aPaaS platform, including permissions, common parameters, and signature requirements.
I. API Calling Environment
Official Environment: https://gw-sg.tvs.qq.com
II. Permission Application and Activation
The video generation aPaaS API usage permission can be obtained through the Asset Claim page, after which a 15-day trial permission will be activated. III. Methods for Requesting Common Parameters and Signature
Common Parameters
When calling any API on aPaaS, you need to include the following common parameters in the URL as QueryString:
|
appkey | string | Yes | Fill in the appkey obtained after your permission application is approved. |
timestamp | string | Yes | Request timestamp in seconds. The timestamp cannot differ from the current time by more than five minutes, otherwise, authentication will fail. |
signature | string | Yes | |
Signature Algorithm
Request Parameter Signature Steps are as follows:
1. The signature rules are as follows. An example is provided below (for reference only).
appkey = e38267c0e86411ebb02aed82acb0ed99
accesstoken = f68f2d10ae9e4604b76fb05cf46bccec
Domain Name Routing = https://gw.tvs.qq.com/v2/ivh/videomaker/broadcastservice/videomake
2. Sort all other parameters in the URL, except for the signature, in alphabetical order. Note that parameters in the body are not included. Currently, only the appkey and timestamp parameters are used. Therefore, the sorted and concatenated string example is:
appkey=e38267c0e86411ebb02aed82acb0ed99×tamp=1646636485
3. Use the accesstoken to perform HmacSha256 encryption on the signature string, and then encode it with base64.
hashBytes = HmacSha256("appkey=e38267c0e86411ebb02aed82acb0ed99×tamp=1646636485","f68f2d10ae9e4604b76fb05cf46bccec")
signature = Base64Encode(hashBytes)
4. The obtained signature value is:
BfWuaC9kmaicCggXc693uK+sZQ8qe88O4HVQNTdwZuo=
5. Urlencode the signature value (this is mandatory, otherwise it may cause intermittent authentication failures), and then concatenate it to get the final request URL as follows:
https://gw.tvs.qq.com/v2/ivh/videomaker/broadcastservice/videomake?appkey=e38267c0e86411ebb02aed82acb0ed99×tamp=1646636485&signature=BfWuaC9kmaicCggXc693uK%2BsZQ8qe88O4HVQNTdwZuo%3D
IV. Request and Response Structure
Request Body Structure
The request body is divided into two parameters: Header and Payload. In the Header, you can include a RequestID to uniquely identify a request, which helps in system issue tracking. All business parameters should be placed in the Payload. For each API's input parameters, please refer to the respective product API documentation and place them in the Payload for transmission.
{
"Header": {
"RequestID": "",
},
"Payload": {}
}
Response Body Structure
The response body is divided into two parameters: Header and Payload. The Header contains the result code, message, and the unique request ID which is the same as the value provided in the request body. The specific response parameters of the API will be placed in the Payload.
{
"Header": {
"Code": 0,
"Message": "",
"RequestID": "", // If not filled in during the request, it will be generated and returned by the cloud
},
"Payload": {}
}
Was this page helpful?