tencent cloud

Feedback

Digital Human aPaaS API Calling Methods

Last updated: 2024-07-19 10:01:58
    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

    Production Environment:https://gw-sg.tvs.qq.com

    II. Permission Application and Activation

    You can activate the interactive digital human apass API usage permissions through Place Orders on the Official Website.

    2.1. Obtaining Necessary API Parameters:

    To call the interactive digital human aPass API, you must carry the appkey, accesstoken, and virtualmankey corresponding to the digital human project. The specific acquisition method can be found in the following interface of the configuration platform:
    The log-in address for the following interface is https://xiaowei.cloud.tencent.com/ivh#/application. Please log in using your Tencent Cloud account and create a project. Follow the instructions in the screenshot to obtain the appkey, accesstoken, and virtualmankey.
    
    
    

    III. Methods for Requesting Common Parameters and Signature

    3.1. Common Parameters

    When calling any API on aPaaS, you need to include the following common parameters in the URL as QueryString:
    Parameter
    Type
    Mandatory
    Description
    appkey
    string
    Yes
    Use the appkey obtained from "2.1. Obtaining Necessary API Parameters".
    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
    Request signature (see section 3.2 for signature calculation)

    3.2. Signature Method

    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
    The domain name routing = https://gw.tvs.qq.com/v2/ivh/sessionmanager/sessionmanagerservice/createsession.
    2. Sort all parameters except for signature in Dictionary Order to form the original text for the signature. Currently, the HTTPS API only includes appkey and timestamp parameters. Therefore, the sorted and concatenated string example is as follows:
    appkey=e38267c0e86411ebb02aed82acb0ed99&timestamp=1646636485
    Note:
    The URL for the Create Long Connection Channel API will include three parameters: appkey, requestid, and timestamp. Note that all should be concatenated.
    Concatenation example: appkey=xxx&requestid=xxxx×tamp=xxxxx
    3. Use the accesstoken to perform HmacSha256 encryption on the signature string, and then encode it with base64.
    hashBytes = HmacSha256("appkey=e38267c0e86411ebb02aed82acb0ed99&timestamp=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/sessionmanager/sessionmanagerservice/createsession?appkey=e38267c0e86411ebb02aed82acb0ed99&timestamp=1646636485&signature=BfWuaC9kmaicCggXc693uK%2BsZQ8qe88O4HVQNTdwZuo%3D

    IV. Request and Response Structure

    Request Body Structure
    The request body is divided into two parameters: Header and Payload. There is no need to transmit parameters in the Header, and the business parameters for each API are transmitted in the Payload.
    Note:
    Header and Payload must be included in the request body and are essential.
    {
    "Header": {
    },
    "Payload": {
    #Business Parameters
    }
    }
    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. The specific response parameters of the API will be placed in the Payload.
    {
    "Header": {
    "Code": 0,
    "Message": "",
    ""RequestID": "", // Generated and returned by the cloud
    },
    "Payload": {}
    }
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support