cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Custom Connector: Produces|Consumes & Accept|Content-Type

Our API has custom application types.

In addition We have the option of either an SML or JSON format. For example:

- application/vnd.whispir.message-v1+xml 
- application/vnd.whispir.message-v1+json

 

I have specificed both of these as the produces and consumes on my endpoint methods, but there is no option to choose these when I'm testing my endpoints. 

 

Is this a bug or is the practice to define an additional OPEN API file which is just for Flow to consume that specifies only a single value?

 

Thanks,

-p

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

 

I am going to answer my own question...

 

When in the Custom Connector wizard and in the TEST step, you cannot specify the Accept or Content-Type headers.

When you use your connector in an actual Flow you can.

 

 

View solution in original post

7 REPLIES 7
Highlighted
Power Apps
Power Apps

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

Hi @Anonymous Flows support JSON only as the information exchange format from the endpoints that you have. Please modify the swagger to reflect JSON as the produces/consumes.

Highlighted
Anonymous
Not applicable

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

Thanks for the reply @ashwinsa.

 

I see how this approach will work for endpoints with a single mime-type, but how will this work for endpoints which have more than one possible vendor specific mime-type.

 

I could remove the XML variants, but I will would still need a picker in the Custom Connector wizard to pick from the two json options.

 

For example:

 

"produces": [
    "application/vnd.whispir.message-v1+json",
    "application/vnd.whispir.bulkmessage-v1+json",
    "application/vnd.whispir.message-v1+xml",
    "application/vnd.whispir.bulkmessage-v1+xml"
],
"consumes": [
    "application/vnd.whispir.message-v1+json",
    "application/vnd.whispir.bulkmessage-v1+json",
    "application/vnd.whispir.message-v1+xml",
    "application/vnd.whispir.bulkmessage-v1+xml"
],

Thanks!

 
Highlighted
Anonymous
Not applicable

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

Wanted to let you know what even when I remove the XML options fron Produces and Consumes, Flow does send those values.

Highlighted
Anonymous
Not applicable

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

 

I am going to answer my own question...

 

When in the Custom Connector wizard and in the TEST step, you cannot specify the Accept or Content-Type headers.

When you use your connector in an actual Flow you can.

 

 

View solution in original post

Highlighted
Advocate I
Advocate I

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

Hi Patrick,

Where in the flow creation step can you set the Content-Type?  I cannot seem to find it.

Highlighted
Anonymous
Not applicable

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

You need to add a header paramter to your custom connector swagger file.

 

"parameters" : [ 
     {
          "name" : "Accept",
          "in" : "header",
          "required" : true,
          "description" : "Application specific mime-type",
          "default" : "application/vnd.yourstuff-v1+json",
          "type" : "string",
          "enum" : [ "application/vnd.yourstuff-v1+json" ]
},
],

 

 

However, I also believe only JSON is supported anyway, so I lopped off our XML options and defaulted to JSON.

Highlighted
Advocate I
Advocate I

Re: Custom Connector: Produces|Consumes & Accept|Content-Type

So they appear as custom parameters?

I think Accept works fine, however it seems content-type is still being forced to "application/json" rather than "application/vnd.api+json" which is what is needed to talk to the api.  

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (3,118)