【发布时间】:2020-06-02 14:16:11
【问题描述】:
我正在尝试下载我所有的 twilio 通话日志(正如这里 https://support.twilio.com/hc/en-us/articles/223183588-Exporting-SMS-and-Call-Logs 所解释的那样),但问题是此方法仅限于 1000 个日志。 知道如何下载它们(csv)吗?
提前致谢
【问题讨论】:
标签: python twilio twilio-api
我正在尝试下载我所有的 twilio 通话日志(正如这里 https://support.twilio.com/hc/en-us/articles/223183588-Exporting-SMS-and-Call-Logs 所解释的那样),但问题是此方法仅限于 1000 个日志。 知道如何下载它们(csv)吗?
提前致谢
【问题讨论】:
标签: python twilio twilio-api
PageSize参数限制为 1000 页。当获取多页 API 结果时,使用提供的 nextpageuri 参数检索下一页结果。全部 Twilio 帮助程序库使用
nextpageuri来分页浏览资源。您应该使用Twilio Helper Libraries 或
nextpageuri和previouspageuri进行导航 通过资源。
【讨论】:
您可以使用Twilio Helper Libraries 或Twilio CLI 来执行此操作。
TWILIO CLI USAGE
$ twilio api:core:calls:list
OPTIONS
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
-o=(columns|json|tsv) [default: columns] Format of command output.
-p, --profile=profile Shorthand identifier for your profile.
--account-sid=account-sid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to read.
--end-time=end-time Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also
specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on
or after midnight of this date.
--end-time-after=end-time-after Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also
specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on
or after midnight of this date.
--end-time-before=end-time-before Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also
specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on
or after midnight of this date.
--from=from Only include calls from this phone number, SIP address, Client identifier or SIM SID.
--limit=limit [default: 50] The maximum number of resources to return. Use '--no-limit' to disable.
--page-size=page-size How many resources to return in each list page. The default is 50, and the maximum is 1000.
--parent-call-sid=parent-call-sid Only include calls spawned by calls with this SID.
--properties=properties [default: sid,from,to,status,startTime] The properties you would like to display (JSON output always shows all properties).
--start-time=start-time Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can
also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls
that started on or after midnight of this date.
--start-time-after=start-time-after Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can
also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls
that started on or after midnight of this date.
--start-time-before=start-time-before Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can
also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls
that started on or after midnight of this date.
--status=(queued|ringing|in-progress|completed|busy|failed|no-answer|canceled) The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`.
--to=to Only show calls made to this phone number, SIP address, Client identifier or SIM SID.
【讨论】: