Skip to main content

Notifications

Power Automate - Process Mining
Answered

How to Specify a Raw Body on a Flow Custom Connector instead of JSON?

(0) ShareShare
ReportReport
Posted on by 156

Hi,

 

I’m creating a Flow process that uses a custom connector to access an on-prem API using the data gateway. I’m on the first step process to get the access token, the POST method expects a raw body as follow:

 

grant_type=password&username=myusername123&password=mypassword123&scope=api

 

Unfortunately, the custom connector only allows me to define the body in a JSON format so my connector is failing because of the body:

 

{
"grant_type" : "password",
"username" : "myusername123",
"password" : "mypassword123",
"scope" : "api"
}

 

When testing the custom connector, there is an option that let’s me specify a raw body and the test is successful.

 

Custom Connector - JSON Body Failed 400:

ErickDiaz_0-1618580497226.jpeg

 

 

Custom Connector - Raw Body Succeeded 200:

ErickDiaz_1-1618580497236.jpeg

 

 

However, when I create my flow, I do not have the option to pass the body as raw:

 

ErickDiaz_2-1618580497250.jpeg

 

Any idea how to pass a raw body to my custom connector?

 

Thank you,

 

Erick

Categories:
  • Jpan7185 Profile Picture
    Jpan7185 2 on at
    How to Specify a Raw Body on a Flow Custom Connector instead of JSON?
    Hi Eric,
     
    This might be a late of a response. The easiest way is to set your raw body inside on a variable. Be sure that there are no spaces saparating any of the values:
    ​​​​​​​
     
    Then use the variable as the body of the http request
     
    and voila...
     
    Hope this helps
  • Verified answer
    ErickDiaz Profile Picture
    ErickDiaz 156 on at
    Re: How to Specify a Raw Body on a Flow Custom Connector instead of JSON?

    I found a very simple fix, I just had to specify an empty string with double quotes (i.e. "") as the Body and that prevented Power Apps from converting my parameter (grant_type=password&username=myusername123&password=mypassword123&scope=api) to JSON.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,867

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,174

Leaderboard