2

I'm trying to connect cloud recording from this tutorial (Agora Cloud Recording RESTful API) and getting 404 error on /v1/apps/{appid}/cloud_recording/resourceid/{resourceid}/sid/{sid}/mode/{mode}/query request, and video not saved to AWS s3 bucket

Steps:

1 - POST: https://api.agora.io/v1/apps/86c92xxxxxxxdb3/cloud_recording/acquire

Post body raw :

{
  "cname": "post39989_channel",
  "uid": "206666", # <- this is uniq id in channel
  "clientRequest": {}
}

receiving

{
 "resourceId": "nUwxxxx....xxxxxVTXt"
}

2 - POST: https://api.agora.io/v1/apps/86c92xxxxxxxdb3/cloud_recording/resourceid/nUwxxxx....xxxxxVTXt/mode/mix/start

{
"cname": "post39989_channel",
"uid": "206666", # <- this is uniq id in channel
"clientRequest": {
"recordingConfig": {
  "channelType":1,
  "maxIdleTime": 100,
  "transcodingConfig": {
    "width": 640,
    "height": 480,
    "fps": 30,
    "bitrate": 1500,
    "backgroundColor": "#fff000"  
  },
  "subscribeVideoUids":["20"], # <- this is id of user who will stream 
  "subscribeAudioUids":["20"]
},
"storageConfig": {
  "accessKey": "AxxxxxxY",
  "secretKey": "2xxxxxxg",
  "region": 0, # US East (N. Virginia) us-east-1
  "bucket": "my-bucket-name",
  "vendor": 1, # S3
  "fileNamePrefix": [
    "agoraraw"
  ]
}
}
}

receiving

{
"resourceId": "nUwxxxx....xxxxxVTXt",
"sid": "feexxxxxxx784c"
}

3 - on Web recieving token for streamer user (id=20)

4 - start stream (stream works)

// Create a client
this.rtc.client = AgoraRTC.createClient({mode: "live", codec: "h264",areaCode: ['GLOBAL']});

5 - during stream trying to call GET : https://api.agora.io/v1/apps/86c92xxxxxxxdb3/cloud_recording/resourceid/nUwxxxx....xxxxxVTXt/sid/feexxxxxxx784c/mode/mix/query

and get response :

{
"resourceId": "nUwxxxx....xxxxxVTXt",
"sid": "feexxxxxxx784c",
"code": 404
}

same response if call POST: https://api.agora.io/v1/apps/86c92xxxxxxxdb3/cloud_recording/resourceid/nUwxxxx....xxxxxVTXt/sid/feexxxxxxx784c/mode/mix/stop with data:

{
"cname": "post39989_channel",
"uid": "206666",
"clientRequest": {}
}

Any suggestions what I'm missing?

Vlad
  • 73
  • 1
  • 10

1 Answers1

0

the uid with which you call acquire , start, stop should be a unique id which is not in channel.

A string that contains the user ID of the recording client, for example "527841". The UID needs to meet the following requirements: It is a 32-bit unsigned integer within the range between 1 and (232-1). It is unique and does not duplicate any existing UID in the channel. It is an integer; Cloud Recording does not support user account (which is a string), so all UIDs in the channel must be integers.

check this link

Also make sure your stream is running while you call query api.

suja
  • 1,198
  • 2
  • 12
  • 32