Search code examples
javascriptnode.jsaxiosagora.io

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!'
}

Solution

  • 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.