HI Team,
we tried to send the SMS verification code using Twilio Verify using API, We testing via Postman it worked, now tried to implement the same on the Web service Data Action, below is the details, we are getting error as channel input parameter is missing, but both format is urlencode
Twilio formate
"curl 'https://verify.twilio.com/v2/Services/VA0be89a3526701d5af0264b6fe5b18a21/Verifications' -X POST
--data-urlencode 'To=+919XXXXXXXXX'
--data-urlencode 'Channel=sms'
-u AC1bef0c33f2d331176d6b3a838352affb:[AuthToken]"
PureCLoud Data action configuration
Input Contract
{
"type": "object",
"properties": {
"To": {
"type": "string"
},
"Channel": {
"type": "string"
}
},
"additionalProperties": true
}
Output Contract
{
"type": "object",
"properties": {
"sid": {
"type": "string"
}
},
"additionalProperties": true
}
Response templet
{
"translationMap": {
"sid": ".sid"
},
"translationMapDefaults": {},
"successTemplate": "{\"sid\":{sid}\n}"
}
Resolved request URL templet
"[POST] https://verify.twilio.com/v2/Services/VA0be89a3526701d5af0264b6fe5b18a21/Verifications"
Header templet
{
"Authorization": [
""
],
"Content-Type": [
"application/x-www-form-urlencoded"
]
}
Request Body Templet
"To=esc.url(\"{input.To}")&Channel=esc.url(\"{input.Channel}")"
Error:
Execute: The request could not be understood by the server due to malformed syntax.
REST call for action execute failed. Message:Request to backend service failed. Response from web service: {"code": 60200, "message": "Invalid parameter: Channel", "more_info": "https://www.twilio.com/docs/errors/60200", "status": 400} [7ff3dfd3-de39-4b53-b4a5-967ea09788fa]