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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

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.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (3,010)