0
votes

I want to serve a request by APIM policy only, is it required to have API and operation for the same ? for example https://myapim/myapi/myoperation

I will serve this request from policy itself by calling few external APIs, do i need to create myapi API and myopration as blank operation ? or is there anyway to handle this ? currently i am getting 404 from APIM before reaching to policy code.

2

2 Answers

0
votes

When you create api in APIM, it will ask you to input your backend url like below screenshot. enter image description here

And then when you create operation, if you input /myoperation/ into the "URL" box like below: enter image description here

It will request https://your-backend-url/myoperation in the backend, but your backend url is https://your-backend-url. So you may get 404 error. To solve this problem, you can just input / into the "URL" box when you create operation. enter image description here

0
votes

I had to create a dummy operation in my API by this my policy is getting executed and serving the request.