How do I Create a Custom Connector in Microsoft Flow with the correct request URL?

允我心安 提交于 2019-12-11 17:26:38

问题


I am attempting to create a custom connector for the Clio API (https://app.clio.com/api/v4/documentation). I was able to successfully authenticate and access the API in Postman, testing out quite a few different types of requests with good results.

Then I exported the collection to a Postman file and imported it into a new custom connector in my MS Flow account as instructed at https://docs.microsoft.com/en-us/connectors/custom-connectors/define-postman-collection. As part of that process, I entered the following settings:

Scheme: HTTPS

host: app.clio.com

Base URL: /

Within the custom connector requests, all the definitions looked acceptable, except that instead of having the fully qualified request URL, they did not include https://app.clio.com.

For example, one request should use the following address:

https://app.clio.com/api/v4/contacts.json

The field in MS Flow, where URL should be entered, is grayed out and only includes /api/v4/contacts.json and looks like this:

The grayed out field cannot be typed in. Instead, I have clicked "Import from sample," which leads to a window where I can type in the fully qualified URL. After I do that and click the "import" button, the window still lists the partial URL as shown above.

At first I thought that was intentional, since I had entered the host elsewhere for the connector, and I thought that Flow would put them together to send the request to the right URL. But it did not: when I tested the operation, I got a 404 error:

    {
  "error": "{\r\n  \"code\": 404,\r\n  \"message\": \"Unable to match incoming request to an operation.\",\r\n  \"source\": \"msmanaged-na.azure-apim.net\",\r\n  \"path\": \"\",\r\n  \"clientRequestId\": \"500779d5-356d-4c79-bf96-caf2-f5bc2919\"\r\n}"
}

When I looked at the request, this is the URL:

https://msmanaged-na.azure-apim.net/apim/clio2.5fb03ce8462066f352.5fdeb6bc35b813689d/92053762-68ce-4c1d-9085-0785-0fd98c3b/api/v4/contacts.json?type=Person

So obviously Flow is not using the correct request URL, and I cannot figure out how to enter the fully qualified request URL. Can anybody tell me what I am doing wrong?

I found another comment where someone else is having the same problem: https://stackoverflow.com/a/48813209/7191369 so I'm not the only one. Thanks in advance for your help.

Edit:

After some additional searching, the address in the request (with https://msmanaged-na.azure-apim.net) is the required redirect URL for the proxy per this post: https://powerapps.microsoft.com/en-us/blog/custom-api-with-authentication/, and is used when processing OAuth. But the crappy part of this is that I can't see the request URL so I can't troubleshoot. Is there any way to see what request the proxy server is sending out to the Clio API?


回答1:


It's been a while since this question was posted, but let me give you a suggestion to include the /api/v4 part of the URL inside the Base URL property of the Flow. This way all your endpoints will use the specified version and you will not have to define them one by one in each request.

Except if you intentionally want to use different versions across the requests :) Anyways, I'm glad that you've been able to resolve the issue.



来源:https://stackoverflow.com/questions/48925629/how-do-i-create-a-custom-connector-in-microsoft-flow-with-the-correct-request-ur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!