如何使用Twilio API在最后10天获取呼叫日志



我正在从事一个Twilio项目,在该项目中,我需要在单个呼叫中进行最后10天的呼叫日志,但是我在Twilio API文档中没有有利的参数(https://www.twilio.com/docs/api/voice/call#list-get(可以帮助我。我尝试了 datecreated starttime 参数,但它们的工作方式不同。谁能在这里帮我吗?

预先感谢。

我认为您在API的错误区域,我认为您正在寻找的区域是目前正在进行的电话。

尝试使用录制

有时候,当我卡住时,我在Twilio的API Explorer中运行一个卷曲示例;这向我展示了2件事:

  1. 呼叫中使用的选项
  2. 结果会结果

祝你好运

尝试startTimeAfterstartTimeBefore参数。


// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
const filterOpts = {
  status: 'completed',
  startTimeAfter: '2016-07-04',
  startTimeBefore: '2016-07-06',
};
client.calls.each(filterOpts, call => console.log(call.direction));

twilio文档:
https://www.twilio.com/docs/api/voice/call?code-sample=code-code-retrieve-completed-compled-from-a-a-period-od-period-po.版本= 3.x

curl 'https://api.twilio.com/2010-04-01/Accounts/[ACCOUNT SID]/Calls.json?StartTime%3E=2020-06-01T0&EndTime%3C=2020-07-01' -u [ACCOUT SID]:[AuthToken]

此卷曲脚本将为您提供2020-06-01至2020-07-01的电话列表。不要忘记替换您的counder_sid和authtoken(没有括号(

最新更新