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
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 (1,739)