针对这个问题,需要检查代码并确保使用正确的路由和参数。此外,还需要确保您已经正确设置Agora Analytics BETA帐户并启用了API权限。
以下是一个示例代码,可以用来解决这个问题:
// Require the Agora Analytics SDK
const agoraAnalytics = require('@agoraio/analytics');
// Set the credentials for the Agora Analytics BETA account
const agoraAppId = 'YOUR_APP_ID';
const agoraAppSecret = 'YOUR_APP_SECRET';
const agoraCustomerId = 'YOUR_CUSTOMER_ID';
// Set up the Agora Analytics client
const analytics = agoraAnalytics.Client.create(agoraAppId, agoraAppSecret, agoraCustomerId);
// Define the parameters for the API call to /analytics/call/lists
const query = {
start_time: '2022-01-01T00:00:00Z',
end_time: '2022-01-02T00:00:00Z'
};
// Make the API call to /analytics/call/lists
analytics.callLists.get(query)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
在上面的示例中,我们使用Agora Analytics SDK创建了一个客户端,并设置了正确的凭据。然后,我们定义了一个查询对象,其中包含我们想要检索的呼叫列表的时间范围。最后,我们使用analytics.callLists.get()
方法发出API调用,并在响应中打印了结果或在发生错误时打印了错误。