【问题标题】:How to get newest recording in Twilio?如何在 Twilio 中获取最新录音?
【发布时间】:2017-01-04 21:25:19
【问题描述】:

我正在使用 python 在 Twilio 中进行录音。只是想知道如何访问我制作的最新/最新录音?干杯!

录制:

resp = twilio.twiml.Response()
resp.say("Please record your message after the beep")
resp.record(maxLength="10", action="/handle-recording")

有关访问录音的示例代码,我将如何对其进行编码以获取最新信息?谢谢!

# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC30bd8bdca7572344721eb96c15a5c0c7"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of recording objects with the properties described above
recordings = client.recordings.list()

【问题讨论】:

  • 在有人发表评论之前,不,那不是我的 API 密钥。

标签: python twilio-twiml


【解决方案1】:

recordings[-1] 应该为您提供录音中的最后一项,这应该是最新的录音,因为录音已附加到列表中。确保recordings 不为空,否则您将获得IndexError

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-05
  • 2012-06-14
  • 2018-10-17
  • 2014-01-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多