Service resource not found

Not applicable

Keep getting the below error when API proxy is added with Resource path and has been added to the Products by importing the Resource Path. The API is accessible when using the default URL, however appending /{Resource Path} to default URL causing issue :

{"error":"service_resource_not_found","timestamp":1433335173940,"duration":0,"exception":"org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException","error_description":"Service resource not found"}

Solved Solved
1 3 973
1 ACCEPTED SOLUTION

Not applicable

Thanks @ACS for the question. I'm assuming you're using BaaS as a target from Apigee Edge. If this is the case, the reason you're getting this error is because the path suffix or resource name gets appended by default to all requests made to your target, hence your backend BaaS URL will not be found. This post should provide the directions on how to get it fixed.

View solution in original post

3 REPLIES 3

Not applicable

Thanks @ACS for the question. I'm assuming you're using BaaS as a target from Apigee Edge. If this is the case, the reason you're getting this error is because the path suffix or resource name gets appended by default to all requests made to your target, hence your backend BaaS URL will not be found. This post should provide the directions on how to get it fixed.

Thanks @dzuluaga for pointing, this solved the problem. However, Can see that the apikey which was sent in the query parameter is being passed in the Target Endpoint URL. Is this know behaviour.

For example if the Target Endpoing URL is "https://api.com/v1/temp" and I am invoking the proxy on http://<<organization>>/v1/in?apikey=<<key value>>, the apikey is being appended to the Target Endpoing URL is "https://api.com/v1/temp?apikey=<<key value>>"

Correct @ACS. That's the default behaviour. In case all you want is an API Proxy pass through, which is unnecessary in your case. So, in order to avoid sending query parameter, you just need to include an AssignMessage Policy, which strips down those parameters.

Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<AssignMessage name="StripApiKey">
   <DisplayName>Remove Query Param</DisplayName>
   <Remove>
      <QueryParams>
         <QueryParam name="apikey" />
      </QueryParams>
   </Remove>
   <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
   <AssignTo createNew="false" transport="http" type="request" />
</AssignMessage>

For more details about this feature, please take a look at this document.