API Access Document

# 1 Preparation

# 1.1 Obtaining Accesskey

After business cooperation with our company, we will provide the customer with appId and appSecret. Please keep the appSecret properly.

# 1.2 Development and Joint debugging

The customer obtains the token through appId and appSecret, and puts the token and source (with a value of sdk) into the header to request the corresponding interface.

# 2 API Docking Method

# 2.1 Constructing a signature to obtain a token

The token can be obtained by requesting the /live-manager/open/accessToken interface through appId and appSecret.

# 2.2 Public Return Parameters

After obtaining the token, source (with a value of sdk), and other request data sets, SDK will first perform security verification and other verifications. After a series of verifications are passed, the sent data request will be processed and the token's validity time will be automatically refreshed. The parameter format returned by the platform is as follows:

Field Type Required Remarks
code Integer Y The returned status code, 200 indicates success
msg string N Description information of success/error
data object N Specific content returned
success string N Success/Error Identification

# 2.3 Public Error Codes

Error code Description
200 Normal
500 Failed
100501 Token cannot be empty
100502 Token has expired
100503 Invalid appId or sppSecret
100504 The user's secret key has not yet taken effect
100505 The user's secret key has expired

# 3 API Interface

# 3.1 Obtain token

Interface Address:/live-manager/open/accessToken

Request Method:POST

Request Data Type:application/json

Response Data Type:*/*

Interface Description:Pass in appId and appSecret

Request parameters:

Parameter Name Parameter Description Data Type Required schema
appId appId string Y
appSecret appSecret string Y

Response Status:

Status Code Explaination schema
200 OK Response«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type schema
code Integer
data TokenVO
msg string
success boolean

TokenVO

Parameter Name Parameter Description Data Type Required Remarks
token token string Y
expirationTime token validity period (seconds) Long Y
startTime Time point at which the secret key takes effect date Y
endTime Time point at which the secret key begins to expire date Y
mqttUser mqtt username string N For interactive use with services during broadcast
mqttPassword mqtt password string N

Response Example:

{
    "code": 200, 
    "msg": "处理成功",
    "success": true,
    "data": {
        "token": "16A69FBA33D7B7EE563114476C0F979853FE3FF5B618DDCEAA764E3EE7BF46A25A032D2F8EE7C64EB0EC578C5C42F9ADF2D2F8EE7C64EB0EC578C5C42F9ADF2",
        "expirationTime": 3600,
        "startTime": "2023-07-01 18:01:14",
        "endTime": "2023-07-31 18:01:19",
        "mqttUser": "user1",
        "mqttPassword": "password1"    
    }
}

# 3.2 Creat A Live Room

Interface Address:

/live-manager/openApi/liveInfo/create

Request Method:

POST

Request Data Type:

application/json

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
cutinFlag Cut in broadcast or not boolean body Y
liveName Live room name string body Y
robotList Anchor list RobotVO body N List, can be empty

RobotVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Anchor id integer Y
coverUrl Cover string N
robotDesc Description string N
robotCode Anchor code string Y
robotName Anchor Name string Y
sceneList Scene List List(SceneVO) Y

SceneVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
sceneCode Scene code string Y
proportion Anchor ratio string N 16:9 9:16
posture Posture string N 0-other,1-standing,2-sitting
duration Duration (in seconds) Integer N
sceneName Scene Name string Y
exampleUrl Previewing Video string N
videoCoverUrl Scene template video string N Note: For the convenience of creating a session later, it is recommended to fill in the video CoverUrl (scene template video) here

Request example:

{
  "cutinFlag": true,
  "liveName": "My live room",
  "robotList": [
    { "id":12312,
      "robotCode": "123123",
      "robotName": " Anchor Name",
      "sceneList": [
        {
          "sceneCode": "123123123",
          "sceneName": "Scene Name 1",
          "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_480.mp4"
        },
         {
          "sceneCode": "123123122",
          "sceneName": "Scene Name 2",
          "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_481.mp4"
        }
      ]
    },
    {
      "robotCode": "12333",
      "robotName": " Anchor Name 1",
      "sceneList": [
        {
          "sceneCode": "12312333",
          "sceneName": "Scene Name 3",
          "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_482.mp4"
        }
      ]
    }
  ]
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data Live room ID integer
message string
success boolean

Response Example:

{
  "code": 200,
  "msg": "处理成功",
  "success": true,
  "data": 12312
}

# 3.3 Update Live Room

Interface Address:

/live-manager/openApi/liveInfo/update

Request Method:

POST

Request Data Type:

application/json

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
id Live room ID integer body Y
cutinFlag Cut in broadcast or not boolean body N Will not be updated if the value is null
liveName Live room name string body N Will not be updated if the value is null
robotList Anchor list List(RobotVO) body N List is empty empty
Will not be changed if the value is null

RobotVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Anchor id integer Y
coverUrl Cover string N
robotDesc Description string N
robotCode Anchor code string Y
robotName Anchor name string Y
sceneList Scene List List(SceneVO) Y

SceneVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
sceneCode Scene code string Y
proportion Anchor ratio string N 16:9 9:16
posture Posture string N 0-other,1-standing,2-sitting
duration Duration (in seconds) Integer N
sceneName Scene Name string Y
exampleUrl Previewing Video string N

Request example:

{
  "id": 12312,
  "cutinFlag": true,
  "liveName": "My live room",
  "robotList": [
    {
      "id":123123,
      "robotCode": "123123",
      "robotName": "Anchor name",
      "sceneList": [
        {
          "sceneCode": "123123123",
          "sceneName": "Scene Name 1",
          "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_480.mp4"
        },
         {
          "sceneCode": "123123122",
          "sceneName": "Scene Name 2",
          "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_481.mp4"
        }
      ]
    },
    {
      "robotCode": "12333",
      "robotName": "Anchor name 1",
      "sceneList": [
        {
          "sceneCode": "12312333",
          "sceneName": "Scene Name 3",
          "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_482.mp4"
        }
      ]
    }
  ]
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data Is the update successful boolean
message string
success boolean

Response Example:

{
  "code": 200,
  "msg": "处理成功",
  "success": true,
  "data": true
}

# 3.4 Query Live Room

Interface Address:

/live-manager/openApi/liveInfo/query

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
id Live room id integer query Y

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description T
code string
data LiveInfoVO
message string
success boolean

LiveInfoVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Live room id integer Y
cutinFlag Cut in broadcast or not boolean N
liveName Live room name string N
robotList Anchor list List(RobotVO) N

RobotVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Anchor id integer Y
coverUrl Cover string N
robotDesc Description string N
robotCode Anchor code string Y
robotName Anchor Name string Y
sceneList Scene List List(SceneVO) Y

SceneVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
sceneCode Scene code string Y
proportion Anchor ratio string N 16:9 9:16
posture Posture string N 0-other,1-standing,2-sitting
duration Duration (in seconds) Integer N
sceneName Scene Name string Y
exampleUrl Previewing Video string N

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
        "id": 12312,
        "cutinFlag": true,
        "liveName": "My live room",
        "robotList": [
            {	"id":12312,
                "robotCode": "123123",
                "robotName": " Anchor Name",
                "sceneList": [
                    {
                        "sceneCode": "123123123",
                        "sceneName": "Scene Name 1",
                        "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_480.mp4",
                    },
                    {
                        "sceneCode": "123123122",
                        "sceneName": "Scene Name 2",
                        "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_481.mp4",
                    }
                ]
            },
            {
                "id":123122,
                "robotCode": "12333",
                "robotName": " Anchor Name 1",
                "sceneList": [
                    {
                        "sceneCode": "12312333",
                        "sceneName": "Scene Name 3",
                        "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_482.mp4",
                    }
                ]
            }
        ]
    }
}

# 3.5 Querying the Live Room List

Interface Address:

/live-manager/openApi/liveInfo/queryByPage

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
page page integer query N Default 1
pageSize pageSize integer query N Default 10

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PageVO
message string
success boolean

PageVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
records Result List(LiveInfoVO)
total Total quantity Integer Y
pages Number of pages Integer Y
size Quantity per page Integer Y

LiveInfoVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id 直播间id integer Y
cutinFlag Cut in broadcast or not boolean N
liveName 直播间名称 string N
robotList Anchor list List(RobotVO) N

RobotVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id 主播id integer Y
coverUrl 封面 string N
robotDesc Description string N
robotCode Anchor code string Y
robotName Anchor Name string Y
sceneList Scene List List(SceneVO) Y

SceneVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
sceneCode Scene code string Y
proportion Anchor ratio string N 16:9 9:16
posture Posture string N 0-other,1-standing,2-sitting 0 1 2
duration Duration (in seconds) Integer Y
sceneName Scene Name string Y
exampleUrl Previewing Video string N

Response example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
        "id": 12312,
        "cutinFlag": true,
        "liveName": "My live room",
        "robotList": [
            {	"id":12312,
                "robotCode": "123123",
                "robotName": " Anchor Name",
                "sceneList": [
                    {
                        "sceneCode": "123123123",
                        "sceneName": "Scene Name 1"
                    },
                    {
                        "sceneCode": "123123122",
                        "sceneName": "Scene Name 2"
                    }
                ]
            },
            {	"id":123122,
                "robotCode": "12333",
                "robotName": " Anchor Name 1",
                "sceneList": [
                    {
                        "sceneCode": "12312333",
                        "sceneName": "Scene Name 3"
                    }
                ]
            }
        ]
    }
}

# 3.6 Material Upload (Play Script Upload)

Interface Address:

/live-manager/openApi/customizedMaterial/upload

Request Method:

POST

Request Data Type:

application/json

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
liveId Live room ID integer body Y Live room ID, call 3.2 to create a live room interface to obtain
materialType Material Type string body Y AUDIO:audio TEXT:text AUDIO TEXT
changeVoiceSpeaker Voice change speaker string body N Required when changing voice
materialDescription Material Description string body N Suggested to fill in
materialUrl Material address string body N Required when materialType is AUDIO,48k sampling rate required
text Text conten string body N Required when materialType is TXET
ttsSource tts source integer body N Required when materialType is TXET
ttsSpeaker tts voice string body N Required when materialType is TXET
volume tts volume float body N Required when materialType is TXET
Range -20.0~20.0
intonation tts intonation float body N Required when materialType is TXET
Range -20.0~20.0
speedRate tts speed float body N Required when materialType is TXET
Range -20.0~20.0
f0upKey tts emotion Integer body N Range -20~20

Request example:

Text Type

{
  "changeVoiceSpeaker": "11",
  "intonation": 2.0,
  "liveId": 1234,
  "materialDescription": "This is a text script",
  "materialType": "TEXT",
  "speedRate": 10,
  "text": "The product we are selling today is XXXX",
  "ttsSource": 10,
  "ttsSpeaker": "12",
  "volume": 0,
   "f0upKey":12
}

Audio Type

{
  "changeVoiceSpeaker": "11",
  "liveId": 1234,
  "materialDescription": "This is an audio script",
  "materialType": "AUDIO",
  "materialUrl": "https://www.guiji.ai/demo/material/asdasdasd.wav"
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data Material ID (Incoming from playlist) integer
message string
success boolean

Response Example:

{
  "code": 200,
  "msg": "处理成功",
  "success": true,
  "data": 12312
}

# 3.7 Material Query

Interface Address:

/live-manager/openApi/customizedMaterial/query

Request Method:

POST

Request Data Type:

application/json

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
liveId Live room ID integer body Y Live room ID
materialType Material Type string body N AUDIO:adioe TEXT:text AUDIO TEXT
page Number of pages integer body N Default 1
pageSize Quantity per page integer body N Default 10

Request example:

{
  	"liveId": 12320,
    "page":1,
    "pageSize":10
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PageVO
message string
success boolean

PageVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
records Result MaterialVo List
total Total quantity Integer Y AUDIO TEXT
current Current number of pages Integer Y
size Quantity per page Integer Y

MaterialVo

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Material id integer Y
materialType Material Type string N AUDIO:audio TEXT:text AUDIO TEXT
materialDescription Material Description string N
text text string N
materialUrl Material address string N
liveId Live room id integer Y
duration Video duration long Y 0 for text,Unit in ms

Response Example:

{
  "code": 200,
  "msg": "处理成功",
  "success": true,
  "data": {
    "records": [
      {
        "id": 3123,
        "materialType": "TEXT",
        "materialDescription": "A paragraph of text",
        "text": "Synthetic voice: platform voice/custom voice, voice category, voice ID, cover image, voice name, sample audio, voice tag, language support (Enumeration), SSML tag",
        "duration": 0,
        "liveId": 12320,
        "createdTime": "2023-07-12 17:15:11"
      },
      {
        "id": 312376,
        "materialType": "AUDIO",
        "materialDescription": "A description of an audio segment",
        "materialUrl": "https://www.guiji.ai/demo/material/asdasdasd.wav",
        "duration": 14040,
        "liveId": 12320,
        "createdTime": "2023-07-12 17:17:46"
      }
    ],
    "total": 2,
    "size": 10,
    "current": 1
  }
}

# 3.8 Platform Voice Query

Interface Address:

/live-manager/openApi/speaker/platformList

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
page Number of pages integer query N Default 1
pageSize Quantity per page integer query N Default 10

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PageVO
message string
success boolean

PageVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
records Result TtsModelVo List
total Total quantity Integer Y
size Quantity per page Integer Y
current Current number of pages Integer Y

TtsModelVo

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id id integer Y
ttsName Voice Name string Y
ttsIntroduction Voice Label string Y
ttsSpeaker Speaker Mark string Y
ttsCategory Model Category string Y
ttsAudition Sample Audio string Y
ttsCover tts cover link string Y
ttsSource tts source integer Y
languages Language List Y cn:Chinese en :English cn en
ssmlFlag Support for SSML tags boolean Y
f0upKeyFlag Support emotions or not boolean Y
userCategory Voice classification string Y

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
        "total": 1,
         "current": 1,
        "pageSize": 10,
        "records": [
            {
                "id": 330,
                "ttsName": "Abby",
                "ttsIntroduction": "Female Voice | English | American | Natural | Generous",
                "ttsSpeaker": "144",
                "ttsCategory": "Female voice, English",
                "ttsAudition": "https://tts.guiji.ai/source/fangyan/eng_abby.wav",
                "ttsCover": "https://tts.guiji.ai/tts-market/22874.jpg",
                "ttsSource": 10,
                "languages": ["en"],
                "ssmlFlag":true,
                "f0upKeyFlag":true,
                "userCategory":"Female Voice"
            }
        ]
    }
}

# 3.8 Customized Voice Query

Interface Address:

/live-manager/openApi/speaker/customizedList

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data List(TtsModelVo)
message string
success boolean

TtsModelVo

Parameter Name Parameter Description Data Type Required Remarks Enumeration
ttsName Voice Name string Y
ttsIntroduction Voice Label string Y
ttsSpeaker Speaker Mark string Y
ttsCategory Model Category string Y
ttsAudition Sample Audio string Y
ttsCover tts cover link string Y
ttsSource tts source integer Y
languages Language List Y cn:Chinese en :English cn en
ssmlFlag Support for SSML tags boolean Y
f0upKeyFlag Support emotions or not boolean Y
userCategory Voice classification string Y

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data":  [
            {
    
                "ttsName": "Abby",
                "ttsIntroduction": "Female Voice | English | American | Natural | Generous",
                "ttsSpeaker": "144",
                "ttsCategory": "Female voice, English",
                "ttsAudition": "https://tts.guiji.ai/source/fangyan/eng_abby.wav",
                "ttsCover": "https://tts.guiji.ai/tts-market/22874.jpg",
                "ttsSource": 10,
                "languages": ["en"],
                "ssmlFlag":true,
                "f0upKeyFlag":true,
                "userCategory":"Female Voice"
            }
        ]
    
}

# 3.9 Platform Anchor Query

Interface Address:

/live-manager/openApi/robot/platformList

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data List(RobotVO)
message string
success boolean

RobotVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Anchor id integer Y
coverUrl Cover string N
robotDesc Description string N
robotCode Anchor code string Y
robotName Anchor Name string Y
sceneList Scene List List(SceneVO) N

SceneVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
sceneCode Scene code string Y AI anchor scene code,the CreateNewSession must be passed after connecting to mqtt
proportion Anchor ratio string N 16:9 9:16
posture Posture string Y 0-other,1-standing,2-sitting 0 1 2
duration Duration (in seconds) Integer Y
sceneName Scene Name string Y
exampleUrl Previewing Video string N
videoCoverUrl Template video address string Y
sceneType Type Integer Y 0:Basic version (corresponding to green screen type) 1:VIP version (corresponding to other types) 2:Live streaming (default use type)
coverUrl Cover string N

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": [
             {	"id":12312,
                "robotCode": "123123",
                "robotName": " Anchor Name",
                 "coverUrl":"https://robot.guiji.ai/demo/22874.jpg",
                 "robotDesc":"Description",
                "sceneList": [
                    {
                        "sceneCode": "123123123",
                        "sceneName": "Scene Name 1",
                        "proportion":"9:16",
                        "posture":"2",
                        "duration":71,
                        "exampleUrl":"https://www.guiji.ai/demo/83db133015cdbd388492c7c19f261b.mp4",
                        "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_480.mp4",
          				"sceneType": 0,
          				"coverUrl": "https://www.guiji.ai/demo/fde067b459f3228536ff97b4945787b9.png"
                    }
                ]
            }
        ]
}

# 3.10 Customized Anchor Query

Interface Address:

/live-manager/openApi/robot/customizedList

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data List(RobotVO)
message string
success boolean

RobotVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id Anchor id integer Y
coverUrl Cover string N
robotDesc Description string N
robotCode Anchor code string Y
robotName Anchor Name string Y
sceneList Scene List List(SceneVO) N

SceneVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
sceneCode Scene code string Y AI anchor scene code,the CreateNewSession must be passed after connecting to mqtt
proportion Anchor ratio string N 16:9 9:16
posture Posture string Y 0-other,1-standing,2-sitting 0 1 2
duration Duration (in seconds) Integer Y
sceneName Scene Name string Y
exampleUrl Previewing Video string N
videoCoverUrl Template video address string Y
sceneType Type Integer Y 0:Basic version (corresponding to green screen type) 1:VIP version (corresponding to other types) 2:Live streaming (default use type)
coverUrl Cover string N

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data":  [
             {	"id":12312,
                "robotCode": "123123",
                "robotName": " Anchor Name",
                 "coverUrl":"https://robot.guiji.ai/demo/22874.jpg",
                 "robotDesc":"Description",
                "sceneList": [
                    {
                        "sceneCode": "123123123",
                        "sceneName": "Scene Name 1",
                        "proportion":"9:16",
                        "posture":"2",
                        "duration":71,
                        "exampleUrl":"https://www.guiji.ai/demo/83db133015cdbd388492c7c19f261b.mp4",
                        "videoCoverUrl": "https://www.guiji.ai/demo/2079b894f08646daf3fa98481142e227_1080x1920_0_480.mp4",
          				"sceneType": 0,
          				"coverUrl": "https://www.guiji.ai/demo/fde067b459f3228536ff97b4945787b9.png"
                    }
                ]
            }
        ]
}

# 3.11 Voice Change Query

Interface Address:

/live-manager/openApi/voice/changeVoiceList

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

This interface requires contacting customer service in advance to activate voice modification permission in order to query the corresponding data

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
page Number of pages integer query N Default 1
pageSize Quantity per page integer query N Default 10

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PageVO
message string
success boolean

PageVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
records Result List(ChangeVoiceVO)
total Total quantity Integer Y
current Current number of pages Integer Y
size Quantity per page Integer Y

ChangeVoiceVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id id Voice id Y
speakerCode Voice code String Y
speakerName Voice Name String Y
ttsAudition Sample Audio String Y
ttsCover Face image String

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
        "current":1,
         "records": [
             {
                 "id":12312,
                "speakerCode": "123123",
                "speakerName": " Anchor Name 1",
                 "ttsCover":"https://robot.guiji.ai/demo/22874.jpg",
                 "ttsAudition":"https://tts.guiji.ai/source/fangyan/eng_abby.wav",
            },
            {
                 "id":123122,
                "speakerCode": "1231223",
                "speakerName": " Anchor Name 2",
                 "ttsCover":"https://robot.guiji.ai/demo/228274.jpg",
                 "ttsAudition":"https://tts.guiji.ai/source/fangyan/eng_2abby.wav",
            }
        ],
    "total": 0,
    "size": 10,
    "current": 1
    }
}

# 3.12 Voice Change Trial

Interface Address:

/live-manager/openApi/speaker/syncSynthesisWavAndChangeVoice

Request Method:

POST

Request Data Type:

application/json

Response Data Type:

*/*

Interface Description:

This interface requires contacting customer service in advance to activate voice modification permission in order to be used normally

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
changeVoiceSpeaker Voice change speaker string body N Required when changing voice
ttsSource tts source integer body Y Range -20~20
ttsSpeaker tts voice string body Y Range -20~20
volume tts volume float body Y Range -20~20
intonation tts intonation float body Y Range -20~20
speedRate tts speed float body Y Range -20~20
f0upKey tts emotion Integer body N Range -20~20

Request example:

{
  "changeVoiceSpeaker": "11",
  "intonation": 2.0,
  "speedRate": 10,
  "ttsSource": 10,
  "ttsSpeaker": "12",
  "volume": 0
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data TTSResultVO
message string
success boolean

TTSResultVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
filePath File address string Y
duration Duration long Y

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
          "duration":71,
          "filePath	":"https://www.guiji.ai/demo/83db133015cdbd388492c7c19f261b.wav"
    }
}

# 3.13 Public Material Category Query

Interface Address:

/live-manager/openApi/materialCategory/query?code=XXXXXXXX

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
code Material Category Code String body N

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data List(MaterialCategoryVO)
message string
success boolean

MaterialCategoryVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id id Integer Y
parentCode Superior Category Code String N
name Material Category Name String Y
code Material Category Code String Y

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": [
        {
            "id":123,
            "parentCode":"12312312",
            "name":"video",
            "code":"10000"
        },
        {
              "id": 5,
              "parentCode": null,
              "name": "实时挂件",
              "code": "50000"
        },
        
    ]
        
}

# 3.14 Public Material Query

Interface Address:

/live-manager/openApi/material/query?code=XXXXXXXX&name=XXXXX

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
code Material Category Code String body N Code and parentCode cannot both be empty
parentCode Superior Category Code String body N Code and parentCode cannot both be empty
name Search term String body N
page Number of pages Integer body N Default 1
pageSize Quantity per page Integer body N Default 10

Request example:

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PageVO
message string
success boolean

PageVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
records Result List(MaterialCategoryVO)
total Total quantity Integer Y
current Current number of pages Integer Y
size Quantity per page Integer Y

MaterialCategoryVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id id Integer Y
categoryCode Material Category Code String N
name Material Category Name String Y
code Material Code String Y
fileUrl File address String Y
fileType File type String Y
coverUrl Cover image address String N

Response Example:

{
  "code": 200,
  "msg": "处理成功",
  "success": true,
  "data": {
    "records": [
      {
        "id": 13,
        "code": "10001",
        "name": "大拇指点赞",
        "categoryCode": "10000",
        "fileUrl": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/大拇指点赞.gif",
        "fileType": "gif",
        "coverUrl": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/大拇指点赞.gif"
      },
      {
        "id": 14,
        "code": "10002",
        "name": "点击小黄车",
        "categoryCode": "10000",
        "fileUrl": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/点击小黄车.gif",
        "fileType": "gif",
        "coverUrl": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/点击小黄车.gif"
      }
    ],
    "total": 17,
    "size": 10,
    "current": 1
  }
}

# 3.15 Live Record Query

Interface Address:

/live-manager/openApi/liveRecord/query

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Request Type Required Remarks Enumeration
source source string header Y
page Number of pages integer query N Default 1
pageSize Quantity per page integer query N Default 10

Request example:

​ -

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PageVO
message string
success boolean

PageVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
list Result List(LiveRecordVo)
total Total quantity Integer Y
pages Number of pages Integer Y
pageSize Quantity per page Integer Y

LiveRecordVo

Parameter Name Parameter Description Data Type Required Remarks Enumeration
id id Integer Y
liveName Live room name String Y
modeName Anchor list String Y
liveStatusName Live status String Y Living Closed broadcast
cropName Affiliated company String Y
beginTime Creation time String Y
totalDurationStr Live duration String N
sessionId sessionId String N

Response Example:

{
  "code": 200,
  "msg": "处理成功",
  "success": true,
  "data": {
    "records": [
      {
        "id": 17810,
        "sessionId": "a2b92ae2-d73d-4614-b2a3-c07a9cecc3ae",
        "beginTime": "2023-07-20 19:55",
        "liveId": 1246107,
        "cropName": "guiji company",
        "liveName": "ai anchor live_07-20 18:25",
        "modeName": "andy",
        "liveStatusName": "未开播",
        "duration": 0.37
      },
      {
        "id": 17809,
        "sessionId": "31c7a2cc-17ee-45e0-8282-38934374fa32",
        "beginTime": "2023-07-20 19:40",
        "liveId": 1246111,
        "cropName": "guiji company",
        "liveName": "ai anchor live_07-20 19:33",
        "modeName": "andy",
        "liveStatusName": "未开播",
        "duration": 1.07
      },
      {
        "id": 17808,
        "sessionId": "93250819-ca83-4516-8e96-aada7f872d27",
        "beginTime": "2023-07-20 19:39",
        "liveId": 1246111,
        "cropName": "guiji company",
        "liveName": "ai anchor live_07-20 19:33",
        "modeName": "sunny",
        "liveStatusName": "未开播",
        "duration": 0.02
      }
    ],
    "total": 1146,
    "size": 3,
    "current": 1

  }
}

# 3.16 Obtain the streaming address (After starting the session in 4.2.3 and receiving a successful event, it can be started)

Interface Address:

/live-manager/openApi/live/getPath

Request Method:

GET

Request Data Type:

application/x-www-form-urlencoded

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Required Remarks Enumeration
liveId Live room ID integer Y
sessionId sessionId String Y
duration duration Integer Y 单位 秒

Request example:

{
  	"liveId":1123123,
    "sessionId":"2221b2a-2168-4ef4-919a-21fcd420c27e",
    "duration":180
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code string
data PathVO
message string
success boolean

PathVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
message message String Y
ok Success or not Boolean Y
info info String Y
data PlayaddrVO Y

PlayaddrVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
rtmp rtmp address RtmpVO N
rtsp rtsp address RtspVO N
http_flv http_flv address HttpFlvVO N

RtmpVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
lan lan address string N
wan wan address string N

RtspVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
lan lan address string N
wan wan address string N

HttpFlvVO

Parameter Name Parameter Description Data Type Required Remarks Enumeration
lan lan address string N
wan wan address string N

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
        "message": "success",
        "ok": true,
        "info": "set res drawOptions ok!",
        "data": {
            "playaddr": {
                "rtmp": {
                    "lan": "rtmp://192.168.0.1:1935/xxxxx/xxxx",
                    "wan": "rtmp://172.16.103.14:1935/xxxxx/xxxx"
                },
                "rtsp": {
                    "lan": "rtsp://192.168.0.1:554/xxxxx/xxxx",
                    "wan": "rtsp://172.16.103.14:554/xxxxx/xxxx"
                },
                "http_flv": {
                    "lan": "http://192.168.0.1:8080/xxxxx/xxxx",
                    "wan": "http://172.16.103.14:8080/xxxxx/xxxx"
                }
            }
        }
    }
}

# 3.17 Creating a Live Session

Interface Address:

/live-manager/openApi/live/createLiveSession

Request Method:

POST

Request Data Type:

application/json

Response Data Type:

*/*

Interface Description:

Request parameters:

Parameter Name Parameter Description Data Type Required Remarks Enumeration
liveId Live room id integer Y
name Session name string N

Request example:

{
  "liveId":1, 
  "name": "test session"
}

Response Status:

Status Code Explaination schema
200 OK DMResponse«string»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Response Parameters:

Parameter Name Parameter Description Type
code Integer
data sessionVo
msg string
success boolean

sessionVo

Parameter Name Parameter Description Data Type Required Remarks Enumeration
liveId Live room id Integer
sessionId session uuid string Y
expirationTime Session destruction time (no interaction) seconds Long Y
topicSub Topic for session subscription(mqtt) string Y sender
topicPub Topic for session push(mqtt) string Y

Response Example:

{
    "code": 200,
    "msg": "处理成功",
    "success": true,
    "data": {
        "liveId": 1,
        "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "expirationTime": 30,
        "topicSub": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea",
        "topicPub": "live-proxy-0"
    }
}

# 四、 Enable Live Streaming

# 4.1 RTMP streaming method for real-time rendering of AI anchor

Step 1.The client initiates a session request to the rendering component through the mqtt protocol, and the rendering component returns success after preparing resources.
Step 2.The client requests to start the rtmp streaming service using the ExecSessionResList protocol.
Step 3.The client retrieves the audio and video stream from the corresponding streaming address and decodes and displays it.
Step 4.The client sends other interactive signaling to control the AI anchor.
Step 5.After the live broadcast ends, the client sends the DestroySession event to the server, which destroys and releases resources.

The flowchart is as follows:

sequenceDiagram
Title: Live interaction sequence diagram
    client->>server: CreateNewSession
    # server-->>push-pcm: pull pcm
    # push-pcm-->>server: send pcm
    server-->client: make sess complete!
    client->>server: ExecSessionResList Request to enable rtmp streaming
    server-->>client: Server SessionState status returns rtmp streaming address
    Note right of client:  Client pulls video stream
    client->>server: Other interactive signaling (playlist adjustment, AI anchor switching, material & layer adjustment, heartbeat message)
    server-->>client: Other signaling returns
    server-->>client: Server status notification
    client->>server: DestroySession

# 4.2 Interactive Control Instructions - Protocol (unless otherwise specified, the protocol description is from the server perspective)

# 4.2.1 Definition of Terms:

# Layer Definition

​ fore:Front layer, usually placing elements such as floating images

​ center:Middle layer, usually placing AI anchor and some fixed elements for broadcasting

​ back: Post layer, usually placing elements such as background

# Explanation of Element Position Setting

​ To ensure that elements are not stretched or deformed due to arbitrarily set width and height, the interface will adapt the width and height submitted by users to ensure that the aspect ratio of the element itself remains unchanged.

image.png

# 4.2.2 Basic Parameter Structure:

* The sessionId in params represents the session ID
* Require the addition of the sessionId field and sender field (with a value of topicSub) in the same layer as the ID

Receive request:
{
	 "params": {
		 "sessionId":"xxxxxx-xxxxxx-xxxxxx-xxxxxx"
	 },
	 "id": xxxx,
	 "method": "xxxxx",
	 "sessionId":"xxxxxx-xxxxxx-xxxxxx-xxxxxx",
	 "topicSub": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea"
}	

Successfully:
{
	"id": xxxx,		
	"result": {
		"sessionId":"xxxxxx-xxxxxx-xxxxxx-xxxxxx",
		"message": "xxxxxxx,
	}
}

Failed:
{
	"id": xxxx,		
	"error": {
		"sessionId":"xxxxxx-xxxxxx-xxxxxx-xxxxxx",
		"message": "xxxxxx",
		"code": -xxxxx
	}
}

# 4.2.3 MakeSession:Opening Session

Request parameters:

Parameter Name Parameter Description Data Type Required Remarks
id Request ID Integer Y Cannot repeat with the same session ID
method Method String Y CreateNewSession Fixed value
sessionId Session id String Y The sessionId returned by creating a live streaming session
liveId Live room id Integer Y
token token String Y
livePlatform platform Integer Y 3(API platform call)
params request parameters json Y
sender Requestor id String Y topicSub value
Parameter Name Parameter Description Data Type Required Remarks
sessionId Session id String Y Cannot repeat with the same session ID
rule rule String Y DTHumanLivestreamWithAudioRelay Fixed value
mode Operation mode String Y checkheartbeat Fixed value
videoSize Video size Integer Y "width": width "height": height
token token String Y
resList Element list Integer Y Specific value provided by our company (fixed value)

Request example:

{
    "id": 9,
    "method": "CreateNewSession",
    "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
    "liveId": 1246464,
    "token": "16A69FBA33D7B7EE563114476C0F979853FE3FF5B618DDCEAA764E3EE7BF46A25A032D2F8EE7C64EB0EC578C5C42F9ADF2D2F8EE7C64EB0EC578C5C42F9ADF2",
    "livePlatform": 3,
    "params": {
        "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "rule": "DTHumanLivestreamWithAudioRelay",  
        "mode": "checkheartbeat",
        "videoSize": {
            "width": 1080,
            "height": 1920
        },
        "resList": [
            {               
                "type": "center",    				 
                "resOptions": {    					 
                    "name": "rtmp",					 
                    "type": "rtmp"				
                }
            },
            {             
                "type": "center",
                "resOptions": {
                    "type": "aivoicedistort",
                    "name": "aivoicedistort",
                    "distortState": false,
                    "speekerId": 0     
                }
            },
            {
                "type": "center",			--AI anchor layer (mandatory)
                "resOptions": {
                    "type": "dthuman",      --Fixed value
                    "name": "dthuman",      --Fixed value
                    "audioDriven": {
                        "mode": "livestream",   --Fixed value
                        "udCodeUsed": "369590278856773",  --sceneCode(AI anchor scenario)
AI anchor layer (mandatory)                        "randomPlay": false,   --It's okay not to transmit it
                        "templates": [
                            {           --Scene information
                              "sequence": ["https://digital-public.obs.cn-east-3.myhuaweicloud.com/model/mp4/2646e2528e16b0a2fa7bf9eb1bab55ed_1080x1920_0_300.mp4"
                              ],  --videoCoverUrl(Template video address)
                                "udCode": "369590278856773", --sceneCode(AI anchor scenario)
                                "matting": 0        		--Need to trim 0 with a background 1 Green screen
                            }
                        ],
                        "quarter": 0       --Fixed value
                    }
                },
                "drawOptions": {
                    "x": 0,
                    "y": 0,
                    "width": 1080,
                    "height": 1920
                }
            },
            {
                "type": "fore",			--layer
                "resOptions": {
                    "type": "image",
                    "name": "image",
                    "url": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/加入我粉丝团.png"
                },
                "drawOptions": {
                    "x": 28,
                    "y": 94,
                    "width": 386,
                    "height": 332
                }
            },
            {
                "type": "fore",
                "resOptions": {
                    "type": "player",		--Video (this video layer can be removed during testing)
                    "name": "video",
                    "url": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/video-server/mp4/1608031115871264770.mp4",
                    "mute": true,           -- Mute or not
                    "loop": -1            --Repetitions    -1:infinite repeate   empty/0/1 once   N:N times
                },
                "drawOptions": {
                    "x": 760,
                    "y": 908,
                    "width": 250,
                    "height": 585
                }
            },
            {
                "type": "back",
                "resOptions": {
                    "name": "background",  --fixed background
                    "type": "image",
                    "url": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/紫色水晶.png",
                    "exclusive": {
                        "SameNameInGroup": true     --fixed background
                    } 
                },
                "drawOptions": {
                    "x": 0,
                    "y": 0,
                    "width": 1080,
                    "height": 1920,
                    "zidx": -1		--hierarchy
                }
            }
        ],
        "playlist": [
            312612				--Material ID, mandatory (the material ID returned from uploading materials in 3.6)
        ]
    },
    "sender": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea" --topicSub
}

Response Example:

{
	"id":1,
	"sessionId":"d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
	"result":{
		"message":"make sess complete!",
		"sessionId":"d910232b-c8b2-4243-a2fb-8ba9c84e31ec"
	}
}

# 4.2.4 ModifySessionResList:Material Adjustment

Request example:

{
    "id": 14,
    "method": "ModifySessionResList",	--Fixed value	
    "params": {
        "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "rmvRes": {
            "resList": []
        },
        "addRes": {
            "resList": [
                {										-- Can refer to "Create Session"
                    "type": "back",
                    "resOptions": {
                        "name": "background",
                        "type": "image",
                        "url": "https://digital-public.obs.cn-east-3.myhuaweicloud.com/manager/version/琉璃梦幻.png",
                        "exclusive": {
                            "SameNameInGroup": true
                        },
                        "transport": "tcp"
                    },
                    "drawOptions": {
                        "x": 0,
                        "y": 0,
                        "width": 1080,
                        "height": 1920,
                        "zidx": -1
                    }
                }
            ]
        }
    },
  "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
    "sender": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea" -- topicSub
}

# 4.2.5 DestroySession:Close Session

Request example:

{
    "id": 11,
    "method": "DestroySession",		--Fixed value
    "params": {
        "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "cause": "Client destroy"
    },
    "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
    "sender": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea"
}

Response Example:

{
	"id":2,		
	"result":{
		"sessionId":"c7c24e5c-b7d6-427f-9e0c-88589d3830ae",
		"ok":true,
		"info":"close sess ok"
	}	
}

# 4.2.6 ExecSessionResList:AI Anchor Switching

Request example:

{
    "id": 13,
    "method": "ExecSessionResList",
    "params": {
        "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "executeList": [
            {
                "name": "dthuman",
                "options": {
                    "method": "switchTemplate",     --Fixed value
                    "args": {
                        "drivenMode": "audioDriven",   --Fixed value
                        "audioDriven": {
                          "udCode": "369590278856773", --sceneCode(AI anchor scenario)
                        },
                        "drawOptions": {
                            "x": 240,
                            "y": 570,
                            "width": 1080,
                            "height": 1920
                        }
                    }
                }
            }
        ]
    },
    "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
    "sender": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea" -- topicSub
}

# 4.2.7 Management of Driving AI Anchor Audio Lists

Request example:

{
    "id": 10,
    "method": "pushPlayListManager",
    "params": {
        "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "action": "insertPlayListAtSilent",		--AddPlayList:Add audio to the end of the playlist(1) / insertPlayList:Add audio to the middle of the playlist(2) / delPlayListIndex:Delete an audio from a playlist(3)  / getPlayList:Get Playlist(4) / insertPlayListAtSilent:Mute playback of inserted audio in the middle of an audio(5)
        "oldPcmId": 6,	 	--Elements added or removed at the index position of the playlist(non mandatory)
        "index": 1, 		--Index position of added or deleted playlists(mandatory in case 2 and case 3)
        "pcmIds": [
            312613			--Playlist to Insert (the material ID returned from uploading materials in 3.6,mandatory in case 1, case 2, case 5)
        ]
    },
    "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
    "sender": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea" -- topicSub
}

Response Example:

{
	"id":2,	
    "sessionId": "ccfb2800-932e-4321-b5f3-8008fca46860",
	"result":{
		"sessionId":"c7c24e5c-b7d6-427f-9e0c-88589d3830ae",
		"ok":true,
		"message":"" //Reason for failure 
		"data": [6,8,9,2] //Playlist after successful execution
	}	
}

# 4.2.8 Server State Push - Protocol (If there are no special instructions, the protocol description will be from the client's perspective)

*1) HeartBeat(note: This message is a session persistence mechanism, and the client needs to reply to this message as shown in the sample, and the reply ID needs to be consistent):

Received:
{
	"id":15,		
	"method":"HeartBeat",
	"params":{
		"sessionId":":---:d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
		"state":"Running"
	}
}

Reply:
{
    "id": 15,
    "result": {
        "sessionId": ":---:d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
        "message": "Heartbeat received."
    },
    "sessionId": "d910232b-c8b2-4243-a2fb-8ba9c84e31ec",
    "sender": "1000043/topicSendClient0a7382ed-9191-4f02-9997-28d7a7832aea" -- topicSub
}

*-2) SessionState-status notification:

Received-Session Destroy (disconnected, session needs to be recreated):
{
	"id":73,		
	"method":"SessionState",
	"params":{
		"sessionId":"ae6b8037-86db-4047-af3c-a8b82bb1d0b1",
		"state":"Destroy",
    	"cause":"iceConnectionState reconnect timeout by failed or disconnected "
	}
}
Received - pull address notification, indicating that the platform has pushed the stream to the relay server, and the remote end can start pulling the stream from the relay server:
{
	"id":73,		
	"method":"SessionState",
	"params":{
		"sessionId":"ae6b8037-86db-4047-af3c-a8b82bb1d0b1",
		"state":"StreamPlay",
        "playaddr":{
            "rtmp": {
                "lan":"rtmp://192.168.0.1:1935/xxxxx/xxxx",
                "wan":"rtmp://172.16.103.14:1935/xxxxx/xxxx"
            },
            "rtsp": {
                "lan":"rtsp://192.168.0.1:554/xxxxx/xxxx",
                "wan":"rtsp://172.16.103.14:554/xxxxx/xxxx"
            },
            "http-flv": {
                "lan":"http://192.168.0.1:8080/xxxxx/xxxx",
                "wan":"http://172.16.103.14:8080/xxxxx/xxxx"
            }
        }
	}
}

Received - Show: represents the layer starting to display:
# dthuman Just pay attention to this type
{
	"id":27,
	"sessionId":"802be68e-9a5e-49d0-8ba0-64e45da8550c",
	"method":"SessionState",
	"params":{
		"sessionId":"802be68e-9a5e-49d0-8ba0-64e45da8550c",
		"state":"Show",
		"info":"Do you see me ? dthuman",
		"udCode":"xxxxxxxxxxx",
		"id":"dthuman#1",
		"name":"dthuman",
		"type":"dthuman" -- dthuman:AI anchor Other types:player,image,etc
	}
}
Received - Status of audio file playback:
{
	"id":27,
	"sessionId":"802be68e-9a5e-49d0-8ba0-64e45da8550c",
	"method":"SessionState",
	"params":{
		"sessionId":"802be68e-9a5e-49d0-8ba0-64e45da8550c",
		"status":"begin", //  begin /end Start or End
		"type":"playList", //playlist,insertlist:Is the type of audio: playlist or insertlist
		"nowPcmId":1, //The audio sequence number currently playing
		"playList":"[6,9,12,33]" //List of audio to be played or insertlist
	}
}

# 4.2.9 Set Streaming Address

Push streaming to third-party platforms:
{
  "id":13,
  "method":"ExecSessionResList",
  "params":{
    "sessionId":"802be68e-9a5e-49d0-8ba0-64e45da8550c",
    "executeList":[
      {
        "name":"rtmp",
        "options":{
          "method":"setpushstreams",
          "args": {
            "pushurls":["rtmp://xxxx", "rtmp://xxxxx"]  --Streaming address, can upload multiple
          }

        }
      }
    ]
  }
}

Stop streaming to third-party platforms:
{
    "id":13,
    "method":"ExecSessionResList",
    "params":{
        "sessionId":"802be68e-9a5e-49d0-8ba0-64e45da8550c",
        "executeList":[
            {
                "name":"rtmp",
                "options":{
                    "method":"closepushstreams",
                    "args": {
                        "pushurls":["rtmp://xxxx", "rtmp://xxxxx"]
                    }
                    
                }
            }
        ]
    }
}

# 4.2.10 Adjusting AI Anchor

Adjust the position of the AI anchor:
{
	"id": 9,
	"method": "SetResDrawOptions",
	"params": {
    	"sessionId": "879553c8-6c49-46b5-acf8-f18017b17c54",
    	"res": {
        	"name": "dthuman",
        	"drawOptions": {
                "x": 10, //Optional,
                "y": 600, //Optional,
                "width": 800, //Optional,
                "height": 200, //Optional,
                "alpha": 1.0, //Optional, transparency, default value of 1.0
       		}
   	}
}
Successfully responded:
{
    "id":9,
    "sessionId":"879553c8-6c49-46b5-acf8-f18017b17c54",
    "result":{
        "message":"success",
        "ok":true,
        "info":"set res drawOptions ok!",
        "sessionId":"879553c8-6c49-46b5-acf8-f18017b17c54"
    }
}