Stop a cloud recording task

Updated

Stops an active cloud recording task.

posthttps://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/resourceid/{resourceid}/sid/{sid}/mode/{mode}/stop

Call this endpoint to leave the channel and stop cloud recording. To start recording again after stopping, call acquire to get a new resource ID.

Note

  • This endpoint is only valid within an active recording session. If the recording was not started successfully or has already ended, the request returns 404.
  • In non-web page recording modes, if the channel is idle for longer than the maxIdleTime value set in start (default 30 seconds), cloud recording automatically leaves the channel and stops.

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.
resourceid#*string

The resource ID obtained from the acquire endpoint.

sid#*string

The recording ID obtained from the start endpoint.

mode#*string

The recording mode:

  • individual: Individual recording mode.
  • mix: Composite recording mode.
  • web: Web page recording mode.
Allowedindividual | mix | web

Header Parameters

Content-Type#?string

application/json.

Defaultapplication/json

Request Body

application/json

cname#requiredstring

The name of the channel to record. Must match the cname used in the acquire request. The name of the channel being recorded.

uid#requiredstring

The UID used by the cloud recording service in the channel. Must match the uid used in the acquire request. The UID used by the cloud recording service in the RTC channel.

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.

serverResponse#optionalobject

The recording stop status. The fields returned vary depending on the recording mode and whether screenshot capture is enabled.

resourceId#optionalstring

The cloud recording resource ID. Valid for five minutes; re-request from acquire if expired.

The resource ID used by cloud recording.

sid#optionalstring

The recording ID. Uniquely identifies a recording session. Generated after the cloud recording service starts successfully.

The recording ID, identifying the current recording session.

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 example

{
    "resourceId": "JyvK8nXHuV1BE.....",
    "sid": "38f8e3cfdc474cd56fc1ceba380d7e1a",
    "serverResponse": {
      "extensionServiceState": [
        {
          "payload": {
            "uploadingStatus": "uploaded"
          },
          "serviceName": "upload_service"
        }
      ]
    },
    "cname": "httpClient463224",
    "uid": "527841"
  }
{
    "code": 62,
    "reason": "request timeout"
   }

Authorization

This endpoint requires authentication.

basicAuth

Request examples

curl --request POST \    --url https://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/resourceid/{resourceid}/sid/{sid}/mode/{mode}/stop \    --header 'Authorization: Basic <credentials>' \    --header 'Content-Type: application/json' \    --data '{    "cname": "httpClient463224",    "uid": "527841",    "clientRequest": {      "async_stop": false    }  }'

Response example

{  "resourceId": "string",  "sid": "string",  "serverResponse": {    "extensionServiceState": [      {        "payload": {          "uploadingStatus": "string"        },        "serviceName": "string"      }    ]  },  "cname": "string",  "uid": "string"}
Empty