MUHAMMAD SHAHID RAFI C P
MUHAMMAD SHAHID RAFI C P

Reputation: 1249

response detail error:2,errMsg:post method api body check failed! Agora REST API

const Authorization = `Basic ${Buffer.from(`${config.CUSTOMERID}:${config.CUSTOMER_SECRET}`).toString("base64")}`;
const acquire = await axios.post(`https://api.agora.io/v1/apps/${config.agoraAppId}/cloud_recording/acquire`,{
                          cname: groupId,
                          uid: userId,
                          clientRequest: {
                          },
                        },
                        { headers: { Authorization } }
                      );

Getting the following response when i call agora live streaming cloud recording from nodejs code using axios.

{
 code: 2,
 reason: 'response detail error:2,errMsg:post method api body check failed!'
}

Upvotes: 0

Views: 1229

Answers (3)

Viktor Kis
Viktor Kis

Reputation: 11

Make sure you pass cname and uid as string - this was my case

Upvotes: 0

Mohsin Sunasara
Mohsin Sunasara

Reputation: 56

This means you have been successfully Authorized but you are passing either wrong value or it is not defined in your body or URL. Please check if any variable you are passing is undefined or contains wrong/incomplete value.

Upvotes: 2

Ekaansh Arora
Ekaansh Arora

Reputation: 1314

You should pass the header as an object with they Authorization key, in your case:

{
   headers: {'Authorization': "Basic " + Authorization}
}

Upvotes: 0

Related Questions