Content with application/x-www-form-urlencoded type related for logic app HTTP connector, Error: "message": "Invalid parameter `To`: ",

Dawit Maru 0 Reputation points
2024-01-11T15:22:57.53+00:00

When I use azure logic app http connector to call twilio verify API by passing headers and body information via Content with application/x-www-form-urlencoded type. I am frequently getting an error which is related with body value pairs. To=+1202#######&Channel=sms. {

  "code": 60200,
  "message": "Invalid parameter `To`:  ***********",
  "more_info": "https://www.twilio.com/docs/errors/60200",
  "status": 400
}
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,551 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2024-01-11T15:22:57.53+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To provide form-urlencoded data in the body for an HTTP request in Azure Logic Apps, you need to specify that the data has the application/x-www-form-urlencoded content type. In the HTTP trigger or action, add the content-type header and set the header value to application/x-www-form-urlencoded.

    Regarding the error you are receiving when calling Twilio Verify API, the error message indicates that the To parameter is invalid. Please make sure that the phone number you are passing in the To parameter is in the correct format and that it is a valid phone number.

    Unfortunately, without more information about your specific implementation and the exact error message you are receiving, it is difficult to provide a more detailed solution.


    References:

    0 comments No comments

  2. MayankBargali-MSFT 70,941 Reputation points Moderator
    2024-01-22T06:15:35.8+00:00

    @Dawit Maru Thanks for reaching out.

    Have you tested the request body and the URL directly using fiddler/postman and see if you are generating the request body correctly as per the Twilio REST API reference document? In case if the same request body/URL works in fiddler/postman and didn't work with the logic app HTTP connect then please share the sample request that you are using outside the HTTP connector (in fiddler/postman) and with the HTTP connector so I can review and assist you.

    The HTTP connector document already cover the using of Content with application/x-www-form-urlencoded type.

    In case if you want to encode the url component in your request or do any other formatting calculation then you can refer to encodeUriComponent function or the list of function expression available in logic app.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.