cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TomJo
Regular Visitor

Custom Connector : x-www-form-urlencoded body : invalid JSON

Hi 

 

I would be very grateful of anyone's help.  I need to create a custom connector which will call a REST API from an on premise application across our data gateway.

 

I have a GET request working nicely so the gateway connection is working correctly but I am running into problems when using a POST request because of the required format of the BODY payload.  I have the call working correctly in POSTMAN but importing the definition or creating manually in the custom connector is not working.

 

I have created a policy which updates the http header to the required x-www-form-urlencoded content-type but this doesn't change the validation on the body content entry.

 

My question is,  in postman you can create a nice key (input_data) value ( {myJSONStructure}) pair which generates the body structure 'input_data={myJSONStructure}' which is what this API expects.

 

In the custom connector it wont accept input_data={myJSONStructure} as it its not valid JSON, how can I enter the required JSON structure into the custom connector so the body payload is generated input_data={myJSONStructure}

 

any help gratefully received.

 

 

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Very hard to debug w/o actual details.

First of all, it isn't clear how the JSON payload is encoded in the form data payload. It is really uncommon - and OpenAPI 2.0 doesn't support it.

 

We dont have UI support for formdata. But, if you are able to author the swagger spec yourself, it should work.

Your operation should look like below:

 '/path': {

    operationId: PostCalll,

    consumes: [ "application/x-www-form-urlencoded" ],

    parameters: [

      {

         name: input_data,

         in: formData,

         type: 

      }

    ]

  }

 

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (3,582)