Bhavya
Bhavya

Reputation: 21

Error while calling the start POST call in Agora API

I am trying to make API calls to the Agora Cloud Recording API through their Postman Environment, but I am getting a 404 error during the query and stop calls. The acquire call returns a 200 response with the ResourceId and the start call also returns a 200 response with the sid.

I have enabled Cloud Recording functions from the Agora dashboard. I have also double-checked my bucket credentials. This is what the start API body looks like:

{
    "cname":"bhavya",
    "uid":"123",
    "clientRequest":{
        "token":"{{token}}",
        "recordingConfig":{
            "maxIdleTime":120,
            "streamTypes":2,
            "audioProfile":1,
            "channelType":1,
            "videoStreamType":0,
            "transcodingConfig":{
                "width":360,
                "height":640,
                "fps":30,
                "bitrate":600,
                "mixedVideoLayout":1,
                "maxResolutionUid":"1"
                }
            },
        "storageConfig":{
            "vendor":{{Vendor}},
            "region":{{Region}},
            "bucket":"{{Bucket}}",
            "accessKey":"{{AccessKey}}",
            "secretKey":"{{SecretKey}}"
        }   
    }
} 

Moreover, using their interactive documentation gives me a 400 bad request error in the start step. This is the error received:

{
  "code": 2,
  "reason": "response detail error:2,errMsg:uid inside the List can't be convert to uint32_t!"
}

Am I missing some step while setting up the project? What could the solution be?

Upvotes: 0

Views: 1561

Answers (2)

MR_AMDEV
MR_AMDEV

Reputation: 1942

The main reason for me was the region of the storage cloud (was using Amazon S3). So here are the main things to solve:

  1. Remember the region you set during the acquire call. Forexample If i set it to AP which means Asia Pacific.
  2. Create bucket(either AWS S3 or else) that should lie in the same region we used in the acquire call. For example: I have used AP in the acquire call so my bucket should be like Asia Pacific (Mumbai) ap-south-1
  3. Now in the storage configurations of the start call, the region must be set same as that of the bucket i.e. In my case 14 (AP-SOUTH-1)

Make sure to check the documentation here for the required region: https://docs.agora.io/en/cloud-recording/cloud_recording_api_start?platform=RESTful#cloud-storage-configuration

Upvotes: 0

Shyam Narayan
Shyam Narayan

Reputation: 1231

An expired/invalid token will return the response 200 OK for start request but did not start recording. So while querying status or calling stop will throw 404 error as there is no recording is going on.

You must use a valid token while acquiring resource and starting recording and all other request where token is required.

Also don't forget to add authorization token in request header.

Upvotes: 0

Related Questions