cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
taravirginillo
New Member

Custo connector into flows - body property to be of type 'object' but is of type 'string'

I created a Custom Connector using the Facebook Graph API with endpoint GET /me/accounts. The endpoint works perfectly and outputs properly in the Test page of the Custom Connector. Other endpoints work in Flows, so it is not a Facebook connection issue. I am attempting to use this operation in Flows, but I continue to get this error:

 

The API 'facebook-xx' returned an invalid response for workflow operation 'GetPages' of type 'OpenApiConnection'. Error details: 'The API operation 'GetPages' requires the property 'body' to be of type 'Object' but is of type 'String'.' 

 

This error also occurs on other operations which have JSON response objects with arrays or more complexity. The endpoint GET /me?fields=name works properly as the JSON object output is simply:

{"name":"**"}

 

However, the JSON output object of this particular operand should be:

{
"data": [
{
"access_token":"xx",
"category": "xx",
"category_list": [
{
"id": "xx",
"name": "xx"
},
{
"id": "xx",
"name": "xx"
},
{
"id": "xx",
"name": "xx"
}
],
"name": "xx",
"id": "xx",
"tasks": [
"xx",
"xx"
]
}
]

I feel like it has to do with the fact that 'body' is of type array. I have tried changing the type of property 'body' to array on Swagger editor on the custom connector. Then object, then string, but none of those worked. I added the response schema as an example on the definitions page. I am at a bit of a loss and anything would help!! Cheers 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
taravirginillo
New Member

I fixed it by setting my response in the swagger file to:

responses:
default:
description: default
schema:
type: string
properties: {}

 

I then have to parse the JSON using the "Parse JSON" block in Flow. A bit more annoying but it works.

View solution in original post

3 REPLIES 3
DamoBird365
Community Champion
Community Champion

@taravirginillo 

 

Just an observation, but you are missing a closing } ?

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Hi - just a copy and paste mistake..

taravirginillo
New Member

I fixed it by setting my response in the swagger file to:

responses:
default:
description: default
schema:
type: string
properties: {}

 

I then have to parse the JSON using the "Parse JSON" block in Flow. A bit more annoying but it works.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (3,184)