10
Views
3
Comments
Solved
Issue with Rest api consume http post method with application/x-www-form-urlencoded
Question

I am facing an Issue with http post consume Rest api. Content type - application/x-www-form-urlencoded, but  in postman working properly. I am trying to send a whatsapp message via api, I am Not able to send mobile number with country code ('+' symbol) as a request. But it is working properly in postman with the same request body and header. Tried httppost too. 

Rank: #370
Solution

Some additional info that might be useful:

When sending the request, you don't have to fill anything in the request body yourself. Just add three parameters to your consumed REST action (To, From and Body) and set the property 'Send In' to 'Body'. The platform will generate the request for you.

I got it to work by using "whatsapp:"+ EncodeUrl("+31123456789") as the value of the To- and From-parameters

Edit: You also don't need to set the content-type, because that's already taken care of by setting the property Request Format to 'Form URL Encoded'

Rank: #370

Hi Hathimary,

I've never used this service before, but it seems like it's interpreting the + as a space.
Have you tried replacing it with %2B (probably wrapping the phone number parameter value in EncodeUrl)?

Regards,
Lennart


Rank: #370
Solution

Some additional info that might be useful:

When sending the request, you don't have to fill anything in the request body yourself. Just add three parameters to your consumed REST action (To, From and Body) and set the property 'Send In' to 'Body'. The platform will generate the request for you.

I got it to work by using "whatsapp:"+ EncodeUrl("+31123456789") as the value of the To- and From-parameters

Edit: You also don't need to set the content-type, because that's already taken care of by setting the property Request Format to 'Form URL Encoded'