Reputation: 1249
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
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
Reputation: 1314
You should pass the header as an object with they Authorization key, in your case:
{
headers: {'Authorization': "Basic " + Authorization}
}
Upvotes: 0