Updated on 2025-12-08 GMT+08:00

Creating a Third-Party Live Platform

Function

Creates a third-party live platform.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

POST /v1/{project_id}/live-platforms/platforms

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used.

You can obtain the token by calling the IAM API used to obtain a user token.

Value of X-Subject-Token in the response header.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

The format is YYYYMMDD'T'HHMMSS'Z'.

X-Project-Id

No

String

Project ID. This parameter is mandatory for AK/SK authentication.

X-App-UserId

No

String

Third-party user ID, which does not allow Chinese characters.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Live platform name

auth_config

Yes

CustomPlatformAuthConfig object

Authentication configuration of the custom live platform

callback_config

Yes

Array of StandardPlatformApiConfig objects

Callback configuration of the custom live platform. Only one configuration is retained for each type. If there are multiple configurations, one configuration is retained randomly.

Table 4 CustomPlatformAuthConfig

Parameter

Mandatory

Type

Description

key

Yes

String

Key. This parameter is used for a custom live platform.

How to use:

When calling the API, add two header fields: x-hw-mss-time and x-hw-mss-secret.

  • x-hw-mss-time: current timestamp. Hexadecimal result of the Unix timestamp. The value is valid for one minute.

Example: 66df9308 (that is, 08:30:00 of September 10, 2024)

  • x-hw-mss-secret: authentication string. hmac_sha256 (Key, URI (The parameter product_query_url,query is sorted by Key in lexicographical order) + x-hw-mss-time)

Example:

URL https://api.example.com/v1/products?live_id=111&limit=10&offset=0

Key: GCTbw44s6MPLh4GqgDpnfuFHgy25Enly

hwTime: 66df9308

x-hw-mss-secret=hmac_sha256(GCTbw44s6MPLh4GqgDpnfuFHgy25Enly,api.example.com/v1/products?limit=10&live_id=111&offset=066df9308)=5e7fe8869a12a87ea966d9edbc02e38cd4ce62c73b8b05c638f15835e78902d7

x-hw-mss-secret: 5e7fe8869a12a87ea966d9edbc02e38cd4ce62c73b8b05c638f15835e78902d7

Table 5 StandardPlatformApiConfig

Parameter

Mandatory

Type

Description

api_type

Yes

String

API type.

  • PRODUCT_QUERY: product query

  • LIVE_EVENT_CALLBACK: live streaming event callback

url

Yes

String

URL. Only HTTPS URLs are supported.

Response Parameters

Status code: 200

Table 6 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Request ID.

Table 7 Response body parameters

Parameter

Type

Description

platform_id

String

Platform ID

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

GET https://metastudio.xxxx.myhuaweicloud.com//v1/123456xxx/live-platforms

{
  "name" : "Bailian Cloud Store",
  "auth_config" : {
    "key" : "xxx11243"
  },
  "callback_config" : [ {
    "api_type" : "PRODUCT_QUERY",
    "url" : "https://api.example.com/products"
  } ]
}

Example Responses

Status code: 200

Successful.

{
  "platform_id" : "f7df49cbc2e74efa8a85f2ab1d6c46d3"
}

Status code: 400

Parameters error, including the error code and its description.

{
  "error_code" : "MSS.00000003",
  "error_msg" : "Invalid parameter"
}

Status code: 401

Authentication is not performed or fails.

{
  "error_code" : "MSS.00000001",
  "error_msg" : "Unauthorized"
}

Status code: 500

Internal service error.

{
  "error_code" : "MSS.00000004",
  "error_msg" : "Internal Error"
}

Status Codes

Status Code

Description

200

Successful.

400

Parameters error, including the error code and its description.

401

Authentication is not performed or fails.

500

Internal service error.

Error Codes

See Error Codes.