Updated on 2026-04-22 GMT+08:00

Generating a Signed URL

Function

This API is used to generate a signed URL.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/auth/chain

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

Yes

String

User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

domain

Yes

String

Definition

Domain name.

Constraints

N/A

Range

Length: 1 to 255 characters

Default Value

N/A

domain_type

Yes

String

Definition

Domain name type.

Constraints

N/A

Range

  • pull: streaming domain name

  • push: ingest domain name

Default Value

N/A

stream

Yes

String

Definition

Stream name.

Constraints

The value must be the same as the StreamName in the ingest or streaming URL.

Range

Length: 1 to 512 characters

Default Value

N/A

app

Yes

String

Definition

Application name.

Constraints

The value must be the same as the AppName in the ingest or streaming URL.

Range

Length: 1 to 128 characters

Default Value

N/A

check_level

No

Integer

Definition

Check level. The value of LiveID consists of AppName and StreamName in the format of <app_name>/<stream_name>.

Constraints

It is mandatory when signing method C is used.

Range

  • 3: The system only checks whether LiveID matches. The validity of the signed URL is not checked.

  • 5: The system checks whether LiveID matches and whether the timestamp has expired.

Default Value

N/A

start_time

No

String

Definition

User-defined start time for the valid access period, for example, 2006-01-02T15:04:05Z07:00.

Constraints

If this parameter is not specified or is left empty, the current time is used.

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

keychain

Array of strings

Definition

Generated signed URLs.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

POST /v1/{project_id}/auth/chain

{
  "domain" : "string",
  "domain_type" : "string",
  "stream" : "string",
  "app" : "string",
  "check_level" : 0,
  "start_time" : "string"
}

Example Responses

Status code: 200

Signed URL obtained.

{
  "keychain" : [ "http://pull.domain.com/live/stream.flv?secret=xxx&time=ttt", "rtmp://pull.domain.com/live/stream?secret=xxx&time=ttt" ]
}

Status code: 400

Obtain the signed URL failed.

{
  "error_code" : "LIVE.100011001",
  "error_msg" : "Parameter verification failed."
}

Status Codes

Status Code

Description

200

Signed URL obtained.

400

Obtain the signed URL failed.

Error Codes

See Error Codes.