cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

Custom connector issue with body type

Hi!

 

I'm facing issues with an simple custom connector that i created. I have an API with Azure Functions + APIM and i wanted to create a custom connector with some routes. For an simple test, i used the following route:

 

 

 

 

[POST] /api/Test

Request Body: 
{
  "name": "string"
}

Response:

{
  "message": "string"
}

 

 

 

 

And created an simple custom connector using the Create a custom connector from scratch documentation. In my action request body, the above definition was used.

dambcx_1-1633031977652.pngdambcx_2-1633031989290.png

 

 

I created an flow with a "Manually trigger a flow" trigger, with the second action being the custom connector (see image below).

dambcx_0-1633031712821.png

 

Somehow, when i test my custom connector in the "Test" tab, i get the proper response:

dambcx_3-1633032062851.png

But when the test is executed triggering the flow, i got an error with the message:

[...] returned an invalid response for workflow operation 'Post-Test' of type 'OpenApiConnection'. Error details: 'The API operation 'PostTest' requires the property 'body' to be of type 'Object' but is of type 'String'.'

 

The name input in the flow does not get converted to an object to be sent to the API? I checked the next docs (Use a custom connector from a flow ) about how to use a custom connector but i didn't find any configuration to make transformations with the inputs. 

 

I'm missing some configuration or giving the incorrect input?

 

Thanks in advance!

 

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

From the screenshot, I can see that your API is returning a content-type of "text/plain". It should be "application/json" (or one of the other applicable JSON mime types).

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Kudoed Authors
Users online (1,798)