cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stevel
Advocate III
Advocate III

APIM custom connector - no content response

Hi,

I'm building a custom connector between PowerApps and Azure API management. We can call the API endpoint from CURL, Postman and SwaggerHub getting a valid response.

 

When we export the swagger 2.0 json file from APIM and import it into our custom connector it appears OK (after we add the required 200 and 405 responses to the json file). We then proceed to authorize the API in the connection (adding the API key) and test the connection at which time we get  an empty response body.

 

When I run the test in the PowerApps Connector Test tab I see (bold added):

Request:

URL:

https://msmanaged-na.azure-apim.net/apim/zpatient-xxxxxxxxxxxxxxxxxxxxxxxx/24

 

Method: Get

Headers:

{

  "Authorization": "Bearer eyJ0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

}

 

Response

Status

(200)

Headers

{

  "content-length": "0",

  "date": "Fri, 21 Feb 2020 15:25:58 GMT",

  "request-context": "appId=cid-v1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

}

Body (blank)

 

Schema validation:

Property "" type mismatch, Expected: "object", Actual: "string".

 

Any ideas why we are unable to get a proper response from our APIM call using PowerApps?

 

Thanks!
....Steve

 

In Postman, CURL and swaggerhub I get this response (for example):

{
"resourceType": "Patient",
"id": "24",
"extension": [
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:xxxxxxxxxxxxxxxxxxxxxxxxx",
"code": "2106-3",
"display": "White"
},
{
"system": "urn:oid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"code": "2028-9",
"display": "Asian"
},
{
"system": "urn:oid:xxxxxxxxxxxxxxxxxxxxxxxxx",
"code": "2076-8",
"display": "Native Hawaiian or Other Pacific Islander"
}
]
}
},
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:xxxxxxxxxxxxxxxxxxxx",
"code": "2186-5",
"display": "Not Hispanic or Latino"
}
]
}
}
],
"name": [
{
"text": "BBBBBBB AAAAAA",
"family": "AAAAAA",
"given": [
"BBBBBBBB"
]
},
{
"use": "old",
"text": "BBBBBB,XXXXXXXX"
}
],
"gender": "male",
"birthDate": "2009-xx-xx",
"deceasedBoolean": false,
"address": [
{
"use": "home",
"line": [
"123 Test Ave"
],
"city": "Test",
"state": "MA",
"postalCode": "02130"
}
],
"photo": [
{
"id": "24",
"url": "PatientImage/24"
}
]
}

 

17 REPLIES 17
v-xida-msft
Community Support
Community Support

Hi @Stevel ,

Could you please share more details about the Swagger OpenAPI definition file?

Which HTTP method do you use in your custom connector? Get or Post?

 

Based on the error message that you mentioned 'Property "" type mismatch, Expected: "object", Actual: "string', it seems to tell that, there is something wrong with value you provided for a specific property within your custom connector, it requires to provide Object value, but you provide a String value.

 

If you defined the POST action path in your custom connector, please check if you have provided a proper Request Body schema when you test the action in your custom connector.

 

The standard OpenAPI definition file should be like below:

https://procsi.blob.core.windows.net/docs/SentimentDemo.openapi_definition.json

 

In addition, as an alternative solution, you could also consider create your custom connector from scratch based on your Azure API:

3.JPG

then check if the issue is solved.

More details about creating a custom connector in PowerApps, please check the following video resource:

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

I'm also getting same issue. Getting proper response in postman but not getting in custom connector test operation body. I have also created connector from Blank but facing same problem.CaptureTest.JPGThanks,

Avik

Anonymous
Not applicable

This is a critical issue because I was planning on going live with this app on Saturday 6/13. I retried by adding the payload and request import. Still broken.

 

I am also getting the same issue. I imported the API from Swagger and tested it. It worked well, I wired in my app and 2 days later it stopped working with no changes to the API or the definition.

 

I added it using the Swagger Open API import and it would not load. I could not even get past this error though it works in the APIM. Didn't matter what swagger I used.

 

Finally, I added some operations manually and it worked for about 8 hours and then got the error again.

 

 
 Property "" type mismatch, Expected: "object", Actual: "string".
I tested from the APIM api directly and copied the response from the call. I validated it was good JSON and no nulls.
 
Screen Shot 2020-06-11 at 6.20.41 AM.png

I am getting the same annoying error while testing a custom connector to call an API from Azure APIM. The calls work nicely in Postman. But PowerApp displays the following schema validation error. And there is no clue where and what it is. 
 
Property "" type mismatch, Expected: "object", Actual: "string".
 
My Schema
 
 

 

{
            "feedbacks": {
                "type": "object",
                "properties": {
                    "feedbacks": {
                        "type": "array",
                        "items": {
                            "required": ["name", "city", "color"],
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "city": {
                                    "type": "string"
                                },
                                "color": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }

 

 
 

my payload

 

 

{
  "feedbacks": [
    {
      "name": "Greg",
      "city": "houston",
      "color": "blue"
    },
    {
      "name": "Howard",
      "city": "Dallas",
      "color": "red"
    },
    {
      "name": "Mathew",
      "city": "Colorado",
      "color": "green"
    },
    {
      "name": "Chris",
      "city": "New York",
      "color": "yellow"
    },
    {
      "name": "Brad",
      "city": "Austin",
      "color": "white"
    }
  ]
}

 

powerapp.png

I finally found the issue. The CORS were not enabled in the APIM for this  API. It works now.

Hi

 

It seems like I have the same problem as you describe. Can you please give me some more details on how you enabled the CORS setting in APIM?

Hi
I facing the same problem and struggling a bit with the CORS configuration of APIM.

Which URL needs to be added in APIM?

 

Thanks

It is necessary to add the following url to the allowed origin within the CORS Policy of APIM.

I still get the same error. Included both: 

Helpful resources

Announcements
PA 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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (59,814)