【问题标题】:get images attachments from Twilio\Rest\Api\V2010\Account\MessageInstance从 Twilio\Rest\Api\V2010\Account\MessageInstance 获取图像附件
【发布时间】:2023-03-20 02:14:01
【问题描述】:
$client = new Client($twilio->sid, $twilio->token);
$response = $client->messages->read();
foreach($response as $text_message) {
    dd($text_message);

以这种方式接收短信会给我一些 uri,但转到 uri 不会给我一个 url。

当您从 twilio 控制台中注册的回调 url 收到文本消息时,它包含一个带有参数 $input['MediaUrl' 的 POST/GET 。 $i],其中托管文本消息的附件。

如何从 Twilio\Rest\Api\V2010\Account\MessageInstance 获取相同的 MediaUrl?

【问题讨论】:

    标签: twilio twilio-php


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

    您可以阅读有关accessing media from messages in the docs here 的信息。如果您向媒体的 URL 发出不带扩展名的请求,您应该获得具有其原始内容类型的媒体。如果您在 URL 中添加 .json.xml,那么您将以您请求的格式获取有关媒体的数据。

    【讨论】:

      猜你喜欢
      • 2015-10-31
      • 1970-01-01
      • 1970-01-01
      • 2020-12-11
      • 2022-01-16
      • 2017-10-13
      • 1970-01-01
      • 2023-01-18
      • 1970-01-01
      相关资源
      最近更新 更多