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 Apps / application/x-www-form...
Power Apps
Unanswered

application/x-www-form-urlencoded request for my custom connector, doesn't form the body properly

(0) ShareShare
ReportReport
Posted on by 14

Hello!

 

I'm building a logic app custom connector in Azure for my APIs.

the API use `application/x-www-form-urlencoded ` as a content-type, basically i want my custom connector to perform this:

 

curl "https://test.api.xxxx.com/xxxx/token" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d "grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}"

so my swagger v2.0 looks like below, as advised from another post https://powerusers.microsoft.com/t5/Connector-Development/How-to-send-x-www-form-urlencoded-body/m-p/2178579#M2358

 

 

swagger: '2.0'
info:
 version: 1.0.0
 title: xxxxx
 description: xxxxx
host: test.api.xxxx.com
basePath: /
schemes:
 - https
produces:
 - application/json
paths:
 /xxxx/token:
 post:
 summary: Access Granted Client Credentials
 description: ''
 operationId: Oauth2Token
 deprecated: false
 consumes:
 - application/x-www-form-urlencoded
 parameters:
 - name: Content-Type
 in: header
 required: true
 type: string
 description: ''
 default: application/x-www-form-urlencoded
 - name: grant_type
 in: formData
 required: true
 type: string
 description: ''
 - name: client_id
 in: formData
 required: true
 type: string
 description: ''
 - name: client_secret
 in: formData
 required: true
 type: string
 description: ''

 

 

if i use swagger Editor to try, and it successfully works (i can authenticate).

but once i saved my connector and try in a test logic app, I got error from my API (meaning at least the API went through) `Mandatory grant_type form parameter missing`. this error is coming when the grant_type is not properly passed. so i have checked my input raw in logic app and looks like this :

 

mkarin_1-1685532318915.png

 

grant_type as client_credentials is there as a form-data, header is there `application/x-www-form-urlencoded`. I would like to check the real request that this logic app has sent but it looks like i can't check the log. I believe that logic app is override the header or putting the parameter not encoded, or put them somewhere else. (i don't know, there is no log!)

 

I have even tried to change my swagger, from `formData` to `query`, but it doesn't work.

 

I have tried to create a maunal HTTP request in a logic app to perform what i want to do with my custom connector, and it perfectly works well. and the body in input raw file looks like this :

mkarin_0-1685544424111.png

 

My questions are : 

- Is there any way that i can check the log to check how the request looks like?

- how to make body correctly built as below (or same result as manual HTTP)

"grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}"

- How can I properly send the application/x-www-form-urlencoded request? i know that i can perform this by modifying my flow, but my goal is to create a custom connector to do the job for my API users.

- can anyone have same issue? 

 

 

 

Categories:
I have the same question (0)
  • mkarin Profile Picture
    14 on at

    @Red2, Hello ! I created a new post for my issue related https://powerusers.microsoft.com/t5/Connector-Development/How-to-send-x-www-form-urlencoded-body/m-p/2178579#M2358 . I would much appreciate your advice 🙂

  • mkarin Profile Picture
    14 on at

    i have used a wrong community, so new post in Power Automate is published : https://powerusers.microsoft.com/t5/Connector-Development/application-x-www-form-urlencoded-request-for-my-custom/m-p/2180592#M2363

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard