【问题标题】:Power Automate / Twilio : HTTP POST ErrorPower Automate / Twilio:HTTP POST 错误
【发布时间】:2021-06-07 18:58:48
【问题描述】:

我不确定自己搞砸了什么,但在尝试从 Power Automate 向 Twilio Flow 发送 POST 请求时收到此错误。

能够从 PowerShell 触发 Twilio Flow,但无法在 Power Automate 上复制。

{
  "code": 20001,
  "message": "Missing required parameter To in the post body",
  "more_info": "https://www.twilio.com/docs/errors/20001",
  "status": 400
}

input

output

http request post

【问题讨论】:

  • 为了详细说明,我尝试在 'application/x-www-form-urlencoded' 和 'application/json' 之间更改内容类型,并使用 Power Automate 的功能 'encodeUriComponent' 几种不同的组合在身体上..
  • 尝试将请求发送到 ngrok 并在 ngrok 调试中查看并比较结果以识别问题。

标签: twilio power-automate


【解决方案1】:

这最终对我有用。

  • 将 Content-Type 值更改为

  • 应用程序/x-www-form-urlencoded;字符集=utf-8

  • 将 Body 值更改为

    • 收件人=%2B12223334444&发件人=%2B15556667777

    • 12223334444 = 发送到 #

    • 15556667777 = 从 # 发送(分配流的 Twilio 电话 #)

Re: Using HTTP POST with Twilio

INPUT
{
    "uri": "https://studio.twilio.com/v2/Flows/##################################/Executions",
    "method": "POST",
    "headers": {
        "content-type": "application/x-www-form-urlencoded; charset=utf-8"
    },
    "authentication": {
        "username": "**********************************",
        "password": "*sanitized*",
        "type": "Basic"
    },
    "body": "To=%2B12223334444&From=%2B15556667777"
}

OUTPUT
{
    "statusCode": 201,
    "headers": {
        "Connection": "keep-alive",
        "Twilio-Concurrent-Requests": "1",
        "Twilio-Request-Id": "##################################",
        "Twilio-Request-Duration": "0.055",
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Headers": "Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since",
        "Access-Control-Allow-Methods": "GET, POST, DELETE, OPTIONS",
        "Access-Control-Expose-Headers": "ETag",
        "Access-Control-Allow-Credentials": "true",
        "X-Shenanigans": "none",
        "X-Home-Region": "us1",
        "X-API-Domain": "studio.twilio.com",
        "Strict-Transport-Security": "max-age=31536000",
        "Date": "Tue, 08 Jun 2021 14:04:24 GMT",
        "X-Powered-By": "AT-5000",
        "Content-Length": "707",
        "Content-Type": "application/json"
    },
    "body": {
        "status": "active",
        "date_updated": null,
        "contact_channel_address": "+12223334444",
        "account_sid": ""**********************************",",
        "url": "https://studio.twilio.com/v2/Flows/##################################/Executions/##################################",
        "context": {},
        "sid": "##################################",
        "date_created": "2021-06-08T14:04:23Z",
        "flow_sid": "##################################",
        "links": {
            "steps": "https://studio.twilio.com/v2/Flows/##################################/Executions/##################################/Steps",
            "execution_context": "https://studio.twilio.com/v2/Flows/##################################/Executions/##################################/Context"
        }
    }
}

【讨论】:

    猜你喜欢
    • 2021-12-09
    • 2021-02-25
    • 2022-07-21
    • 2020-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-19
    • 2023-02-17
    相关资源
    最近更新 更多