Skip to main content

Query status

GET
https://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/resourceid/{resourceid}/sid/{sid}/mode/{mode}/query

After starting a recording, call this endpoint to query its current status.

info

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.

Request

Path parameters

appid stringrequired

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 stringrequired

The resource ID obtained from the acquire endpoint.

sid stringrequired

The recording ID obtained from the start endpoint.

mode stringrequired

The recording mode:

Response

Response body

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

    OK
    • cname string

      The name of the channel being recorded.

    • uid string

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

    • resourceId string

      The resource ID used by cloud recording.

    • sid string

      The recording ID, identifying the current recording session.

    • serverResponse object

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

      Show propertiesHide properties
      • status number

        Current status of the cloud service:

        • 0: Not started.
        • 1: Initialization complete.
        • 2: Components starting.
        • 3: Some components ready.
        • 4: All components ready.
        • 5: In progress.
        • 6: Stop requested.
        • 7: All components stopped.
        • 8: Exited.
        • 20: Exited abnormally.
      • extensionServiceState array[object]

        State of each extension service. Only returned in web page recording mode.

        Show propertiesHide properties
        • serviceName string

          Extension service name:

          • "web_recorder_service": Web page recording service.
          • "rtmp_publish_service": CDN push service.
        • payload object

          Service-specific state.

          Show propertiesHide properties
          • state string

            Upload status:

            • "init": Initializing.
            • "inProgress": Running.
            • "exit": Stopped.
          • onhold boolean

            Whether recording is paused. true if paused, false if running. Only returned by web_recorder_service.

          • fileList array[object]

            Files generated during recording. Only returned by web_recorder_service.

            Show propertiesHide properties
            • filename string

              Name of the M3U8 or MP4 file.

            • sliceStartTime number

              Recording start time of the file, Unix timestamp in seconds.

          • outputs array[object]

            CDN push output status. Only returned by rtmp_publish_service.

            Show propertiesHide properties
            • rtmpUrl string

              The CDN address the stream is being pushed to.

            • status string

              Push status:

              • "connecting": Connecting to the CDN server.
              • "publishing": Push in progress.
              • "onhold": Push paused.
              • "disconnected": Failed to connect to the CDN server.
      • fileListMode string

        Data format of fileList. Only returned in individual and composite recording modes when screenshot capture is not enabled.

        • "string": In composite recording mode when avFileType is ["hls"].
        • "json": When avFileType is ["hls","mp4"] in individual or composite recording mode.
      • fileList string or array[object]

        The recorded files. Only returned in individual and composite recording modes when screenshot capture is not enabled. When fileListMode is "string", this is the filename of the M3U8 file. When fileListMode is "json", this is an array of objects with the following fields:

        Show propertiesHide properties
        • fileName string

          Name of the M3U8 or MP4 file.

        • trackType string

          File type:

          • "audio": Audio only.
          • "video": Video only.
          • "audio_and_video": Audio and video.
        • uid string

          The UID whose stream is recorded. In composite recording mode, this is "0".

        • mixedAllUser boolean

          true if all users are recorded in a single file; false if each user is recorded separately.

        • isPlayable boolean

          true if the file can be played online; false if it cannot.

        • sliceStartTime number

          Recording start time of the file, Unix timestamp in seconds.

      • sliceStartTime number

        Recording start time, Unix timestamp in milliseconds. Only returned in individual recording mode.

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

Authorization

This endpoint requires Basic Auth.

Request example


_3
curl --request GET \
_3
--url https://api.sd-rtn.com/v1/apps/{appid}/cloud_recording/resourceid/{resourceid}/sid/{sid}/mode/{mode}/query \
_3
--header 'Authorization: Basic <credentials>'

Response example


_24
{
_24
"cname": "httpClient463224",
_24
"uid": "527841",
_24
"resourceId": "JyvK8nXHuV1BE.....",
_24
"sid": "38f8e3c.....",
_24
"serverResponse": {
_24
"status": 0,
_24
"extensionServiceState": [
_24
{
_24
"payload": {
_24
"fileList": [
_24
{
_24
"filename": "xxx.m3u8",
_24
"sliceStartTime": 0
_24
}
_24
],
_24
"onhold": true,
_24
"state": "inProgress"
_24
},
_24
"serviceName": "web_recorder_service"
_24
}
_24
]
_24
}
_24
}