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 :

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 :

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?