Acquire a resource ID

Updated

Acquires a resource ID for a cloud recording session.

posthttps://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/acquire

Before starting cloud recording, call this endpoint to get a resource ID. A single resource ID can be used for only one recording session.

Note

  • Call acquire and start requests in pairs.
  • Call start within two seconds of receiving the resource ID. Batch fetching resource IDs followed by batch start requests may cause failures.
  • The resource ID is valid for five minutes and should be used as soon as possible.

Path Parameters

appid#*string

The App ID of your project.

  • For web page recording mode, enter the App ID for which the cloud recording service is enabled.
  • For individual and composite recording modes, use the same App ID as the channel to be recorded. Ensure that the cloud recording service has been enabled for this App ID.

Header Parameters

Content-Type#?string

application/json.

Defaultapplication/json

Request Body

application/json

cname#requiredstring

The channel name.

  • In individual recording and composite recording modes, this is the name of the channel to be recorded.
  • In web page recording mode, this field differentiates the recording process. The string length cannot exceed 1024 bytes.

A unique recording instance is identified by appid, cname, and uid. To record the same channel multiple times, use the same appId and cname but different uid values.

uid#requiredstring

The UID used by the cloud recording service in the channel to identify itself. For example, "527841". The value must meet these conditions:

  • In the range from 1 to (2³²−1), and cannot be 0.
  • Must not duplicate any UID already in the channel.
  • Must be an integer value enclosed in quotes; all users in the channel must use integer UIDs.
clientRequest#requiredobject

Response

  • If the returned status code is 200, the request was successful.

  • If the returned status code is not 200, the request failed. See Response status codes for troubleshooting.

Response Body

application/json

Response schema

200application/json

The request succeeded. If you set startParameter in the request body and its value is invalid, the acquire request can still succeed, but the following start request returns an error.

resourceId#optionalstring

The cloud recording resource ID. Use this to start a cloud recording session. Valid for five minutes; re-request if expired.

cname#optionalstring

The name of the channel to be recorded.

The name of the channel being recorded.

uid#optionalstring

The UID used by the cloud recording service in the RTC channel.

defaultapplication/json

The request failed. If the HTTP status code is not 200, see the Cloud Recording response status codes for troubleshooting.

Response

See Page load timeout detection.

Response example

{
    "code": 400,
    "reason": "invalid_appid"
  }

Authorization

This endpoint requires authentication.

basicAuth

Request examples

curl --request POST \    --url https://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/acquire \    --header 'Authorization: Basic <credentials>' \    --header 'Content-Type: application/json' \    --data '{    "cname": "<your_channel_name>",    "uid": "527841",    "clientRequest": {      "scene": 0,      "resourceExpiredHour": 24    }  }'

Response example

{  "cname": "string",  "uid": "string",  "resourceId": "string"}
Empty