Server APIs v2
  • Server APIs overview
  • Accessing Server APIs
  • Room signaling
  • Stream mixing
  • Streaming moderation
  • Streaming control
  • Cloud recording
  • Server callbacks
  • Return codes
  • API testing

Search for recorded files

Last updated:2022-03-22 13:07

1 Description

Gets information of the recorded files that match the searching criteria.

To use the CDN recording service, you will need to contact ZEGO Technical Support to enable it first. For pricing details, you can check with our sales.

2 Request method and endpoint

  • Request method: GET
  • Request endpoint: https://rtc-api.zego.im/?Action=SearchMedia
  • Transmission protocol: HTTPS
  • Rate limit: 20 requests/second

3 Request parameters

Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Server APIs public request parameters.

Parameter Type Required Description
Vendor
String
Yes
The CDN provider.
  • Tencent: Tencent Cloud
NamePrefix
String
No
Prefix of file names for wildcard searching.
StartTime
Int
No
Start time of file creation time of the search, a Unix timestamp in seconds.
EndTime
Int
No
End time of file creation time of the search, a Unix timestamp in seconds.
PageSize
Int
No
Number of records per page. The default value is 10.
PageNumber
Int
No
Returns the records of the specified page only.

4 Request example

https://rtc-api.zego.im/?Action=SearchMedia
&Vendor=Tencent
&NamePrefix=dt
&StartTime=
&EndTime=
&PageSize=10
&PageNumber=1
&<Public Request Parameters>

5 Response parameters

Parameter Type Description
Code
Number
Return code.
Message
String
Description of the request execution result.
RequestId
String
Request ID.
Data
Object
Returned data.
└ Tencent
Object
Data returned by Tencent Cloud (when Tencent Cloud is the CDN provider).
  └ TotalCount
Number
The total number of matched records. The maximum value is 5,000, which means the search will only return 5,000 records at most, even when the actual number of matched records is more than 5,000.
  └ MediaInfoSet
Array of Object
A list of media file information.
    └ FileId
String
The unique file ID.
    └ BasicInfo
Object
The file's basic information, including file name, type, playback URL, and cover image.
      └ Name
String
File name.
      └ Description
String
File description.
      └ CreateTime
String
File creation time in ISO date format.
      └ UpdateTime
String
File last update time in ISO date format. Operations such as changing file properties or media processing will change the file's last update time.
      └ ExpireTime
String
File expiration time in ISO format. Expired files and their related resources (e.g., file conversion result, CSS sprites) will be permanently purged. A file with an expiration time "9999-12-31T23:59:59Z" never expires.
      └ ClassId
Number
Class ID of the file.
      └ ClassName
String
Class description of the file.
      └ ClassPath
String
Class path of the file. Different class levels in the path are connected by a "-" to form the path (e.g., "Level 1 Class - Level 2 Class").
      └ CoverUrl
String
URL of the file's cover image.
      └ Type
String
Media container format of the file (e.g., mp4, flv).
      └ MediaUrl
String
URL of the original media file.
      └ SourceInfo
Object
Source information of the original media file.
        └ SourceType
String
Source type.
        └ SourceContext
String
Source stream.
      └ StorageRegion
String
File storage region (e.g., ap-guangzhou). Refer to [List of Regions] for more details.
      └ Vid
String
The unique File ID of the recorded file.
      └ Category
String
File type.
  • Video
  • Audio
  • Image
      └ Status
String
File status.
  • Normal
  • Forbidden
  └ RequestId
String
A unique Request ID that is returned for every request. This request ID will be required for any troubleshooting on the request.

6 Response example

{
    "Code":0,
    "Message":"success",
    "Data":{
        "Tencent":{
            "TotalCount":4,
            "MediaInfoSet":[
                {
                    "BasicInfo":{
                        "Name":"dt5",
                        "Description":"",
                        "CreateTime":"2021-01-25T09:13:56Z",
                        "UpdateTime":"2021-01-25T09:13:58Z",
                        "ExpireTime":"9999-12-31T23:59:59Z",
                        "ClassId":0,
                        "ClassName":"Other",
                        "ClassPath":"Other",
                        "CoverUrl":"",
                        "Type":"mp4",
                        "MediaUrl":"https://vod-qcloud-test.zego.im/ff6370f5vodcq1400341231/1bae3ab35285890813218549196/c0c0abace4e53b92dd5d0400.mp4",
                        "SourceInfo":{
                            "SourceType":"VideoProcessing",
                            "SourceContext":""
                        },
                        "StorageRegion":"ap-chongqing",
                        "Vid":"5285890813218549196",
                        "Category":"Video",
                        "Status":"Normal"
                    },
                    "FileId":"5285890813218549196"
                },
                {
                    "BasicInfo":{
                        "Name":"dt3",
                        "Description":"",
                        "CreateTime":"2021-01-25T09:10:53Z",
                        "UpdateTime":"2021-01-25T09:10:54Z",
                        "ExpireTime":"9999-12-31T23:59:59Z",
                        "ClassId":0,
                        "ClassName":"Other",
                        "ClassPath":"Other",
                        "CoverUrl":"",
                        "Type":"mp4",
                        "MediaUrl":"https://vod-qcloud-test.zego.im/ff6370f5vodcq1400341231/195801495285890813218447351/6fb39f94d2c5fb9190776064.mp4",
                        "SourceInfo":{
                            "SourceType":"VideoProcessing",
                            "SourceContext":""
                        },
                        "StorageRegion":"ap-chongqing",
                        "Vid":"5285890813218447351",
                        "Category":"Video",
                        "Status":"Normal"
                    },
                    "FileId":"5285890813218447351"
                },
                {
                    "BasicInfo":{
                        "Name":"dt2",
                        "Description":"",
                        "CreateTime":"2021-01-25T09:05:11Z",
                        "UpdateTime":"2021-01-25T09:10:43Z",
                        "ExpireTime":"9999-12-31T23:59:59Z",
                        "ClassId":0,
                        "ClassName":"Other",
                        "ClassPath":"Other",
                        "CoverUrl":"",
                        "Type":"mp4",
                        "MediaUrl":"https://vod-qcloud-test.zego.im/ff6370f5vodcq1400341231/14897a655285890813218227225/a9fd54b2818dc150990bef8a.mp4",
                        "SourceInfo":{
                            "SourceType":"VideoProcessing",
                            "SourceContext":""
                        },
                        "StorageRegion":"ap-chongqing",
                        "Vid":"5285890813218227225",
                        "Category":"Video",
                        "Status":"Normal"
                    },
                    "FileId":"5285890813218227225"
                },
                {
                    "BasicInfo":{
                        "Name":"dt1",
                        "Description":"",
                        "CreateTime":"2021-01-25T08:58:16Z",
                        "UpdateTime":"2021-01-25T09:10:43Z",
                        "ExpireTime":"9999-12-31T23:59:59Z",
                        "ClassId":0,
                        "ClassName":"Other",
                        "ClassPath":"Other",
                        "CoverUrl":"",
                        "Type":"mp4",
                        "MediaUrl":"https://vod-qcloud-test.zego.im/ff6370f5vodcq1400341231/d84db74c5285890813217983125/a1323481c903441370371e1d.mp4",
                        "SourceInfo":{
                            "SourceType":"VideoProcessing",
                            "SourceContext":""
                        },
                        "StorageRegion":"ap-chongqing",
                        "Vid":"5285890813217983125",
                        "Category":"Video",
                        "Status":"Normal"
                    },
                    "FileId":"5285890813217983125"
                }
            ],
            "RequestId":"151168a4-baf9-4c9c-a094-eeecf8cd6be5"
        }
    },
    "RequestId":"6877226848471811505"
}

7 Return codes

Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.

Return code Description
41001 Failed to save live stream.
41002 Failed to save channel.
41003 Live stream does not exist.
41004 Stream no longer exists.
42001 Failed to forbid live stream.
42002 Failed to resume live stream.
42003 Batch disable live broadcast failed.
42004 Failed to resume live streaming in batches.
43001 Failed to create recording index file.