I have recently published a set of APIs from Live Creator to my API Gateway. I am able to consume the APIs from Live creator directly. However, when I try to consume them via the gateway, the only API i am able to consume is the @docs endpoint (https://hostname:8443/demo/v1/@docs). The other endpoints which I try to consume e.g. (https://hostname:8443/demo/v1/@docs) will always result in the following error:
<l7:policyResult xmlns:l7="http://www.layer7tech.com/ws/policy/fault" status="No Error"/>
May i know is there a way to get around this issue? Thanks for your help.
All parameters must be url-encoded. From the response, it seems the endpoint is not url-encoded.
And the "auth=demo_full:1" seems not a valid value.
I tried to call the endpoint through postman https://nodehost:8443/demo/v1/demo:customer with basic authentication but it is still giving me the following error:
May I know how do you guys normally call the APIs that were published from LAC to gateway? Cause right now only https://nodehost:8443/demo/v1/@docs seem to be working.
Thanks for your help
I attach a sample policy.
To make it work,
1. the resolution path of policy needs to be /lac/*
otherwise you need to change the regex in the policy
2. change the context variable lachost to your lac server hostname and port.
3. the simple policy doesn't url-encode the parameters, so when the client(such as a browser) send the request, it needs to be url-encoded, like this,
So i tried out the different methods (GET, POST, PUT and DELETE) via the API GW using the policy given. For some reason, when i tried the PUT method, the response was always Checksum not found - a checksum is required for all updates even though i have already included checksum in the query.
Thanks for your help.
The PUT is for update, the checksum should be in payload.
If you GET the same object, the checksum will be in the "@metadata".
An easy way is to GET the object you want to update first, copy the response to the payload of PUT, modify only the attribute you want to change, and PUT to update that attribute.