Acquire a resource ID
Updated
Acquires a resource ID for a cloud recording session.
https://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/acquireBefore 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
acquireandstartrequests in pairs. - Call
startwithin two seconds of receiving the resource ID. Batch fetching resource IDs followed by batchstartrequests may cause failures. - The resource ID is valid for five minutes and should be used as soon as possible.
Path Parameters
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
Request Body
application/json
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.
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.
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/jsonThe 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.
The cloud recording resource ID. Use this to start a cloud recording session. Valid for five minutes; re-request if expired.
The name of the channel to be recorded.
The name of the channel being recorded.
The UID used by the cloud recording service in the RTC channel.
defaultapplication/jsonThe 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"
}
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"}