cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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"
}
]
}

 

16 REPLIES 16
Highlighted
Community Support
Community Support

Re: APIM custom connector - no content response

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.
Highlighted
New Member

Re: APIM custom connector - no content response

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

Highlighted
Helper I
Helper I

Re: APIM custom connector - no content response

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
Highlighted
Frequent Visitor

Re: APIM custom connector - no content response

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

Highlighted
Frequent Visitor

Re: APIM custom connector - no content response

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

Highlighted
Helper I
Helper I

Re: APIM custom connector - no content response

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?

Highlighted
Microsoft
Microsoft

Re: APIM custom connector - no content response

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

Highlighted
Microsoft
Microsoft

Re: APIM custom connector - no content response

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

Highlighted
Helper I
Helper I

Re: APIM custom connector - no content response

I still get the same error. Included both: 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,934)