web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PAD - Web Servcie Invoke
Power Automate
Answered

PAD - Web Servcie Invoke

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I'm building a simple desktop flow to connect to an non-public, on prem API - the first stage is authentication. I'm using the Web Service Invoke method.

 

The Request body of this is JSON, in the format:

{"username":"USERNAME","password":"PASSWORD"}

 

When I run this, I get an error message back from the API, saying:  

{"url":"/MagicInfo/auth","errorCode":"500000","errorMessage":"JSON parse error: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.PushbackInputStream@23e0bd3; line: 1, column: 2]","errorDetails":null}

 

Running fiddler, to inspect the HTTP request, I see that the actual request body is being converted to:

%7b%22username%22%3a%22USERNAME%22%2c%22password%22%3a%22PASSWORD%22%7d

 

It seems like the ASCII codes for the characters are being passed - and changing the encoding in the advanced settings (e.g. to utf-8) doesn't change this.

 

Does anybody have any ideas on why this is happening, or any solutions?

 

Thanks,
Josh

 

  • fraenK Profile Picture
    2,125 on at

    Did you specify the content type header ?

     Content-Type: application/json; charset=UTF-8
  • Lipsitz Profile Picture
    75 on at

    I have similar issue, content of "Request Body" seems not to be transmitted at all.

    I used Postman Echo Service, its ends back your request, Body is missing, non existent, null.

    Note: I tried adding "charset-UTF-8" as @fraenK suggested.

    I tried checking the request with Fiddler, but it is not picking it

    As you can see in the screenshots

    1. The request, simple json object in the body

    2. Web Service Response (Body should be inside "args" but its empty.

    3. Same response when sent with Postman (Body is inside "args")

     

    2021-04-13 14_01_19-Invoke web service.png2021-04-13 14_01_00-Test API _ Power Automate Desktop.png2021-04-13 14_00_00-Postman.png

  • fraenK Profile Picture
    2,125 on at

    If you want to send JSON data to a server then you'll need to use e.g. POST or PUT, not GET

    https://www.w3schools.com/tags/ref_httpmethods.asp

  • Lipsitz Profile Picture
    75 on at

    I know that, but POST does not work, that's why I had to test with postman echo test, that confirmed my suspicion, Postman echo service works with GET, as you can see.

     

    2021-04-13 14_32_51-Test API _ Power Automate Desktop.png

  • fraenK Profile Picture
    2,125 on at

    If you know that GET uses URL parameters, then why do you expect sending a JSON body to work?

     

    POST works fine with https://hookbin.com/NOzq3PxgoBHWZZpRgGQ2:

     

    Web.InvokeWebService Url: $'''https://hookb.in/NOzq3PxgoBHWZZpRgGQ2''' Method: Web.Method.Post Accept: $'''application/json''' ContentType: $'''application/json''' RequestBody: $'''{\"test\":\"test\"}''' ConnectionTimeout: 30 FollowRedirection: True ClearCookies: False FailOnErrorStatus: False EncodeRequestBody: False UserAgent: $'''Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20100312 Firefox/3.6''' Encoding: Web.Encoding.AutoDetect AcceptUntrustedCertificates: False ResponseHeaders=> WebServiceResponseHeaders Response=> WebServiceResponse StatusCode=> StatusCode

     

     

  • Lipsitz Profile Picture
    75 on at

    So this is what I am getting

    https://hookbin.com/NOzq3PxgoBHWZZpRgGQ2/9RzpKBjpE

    I see your body was also parsed like this once, what did you change?

  • Verified answer
    fraenK Profile Picture
    2,125 on at
  • Lipsitz Profile Picture
    75 on at

    This fixed the issue.

    Thanks!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Disabling "Encode request body" worked for me too.

     

    Cheers All 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard