Need to know about / & /** in resource path

Hi,

I want know difference between "/" and "/**" in the resource path, while adding Proxy to the product.I created proxy without resource by enabling security with API-Key.And selected resource path as "/**" while adding the API-Proxy to the product.

  1. when i am using "http://sample.com/<<Base_Path>>?apiky=<<apikey>>" url,it is send error response like "Invalid ApiKey for given resource"
  2. when i use URL "http://sample.com/<<Base_Path>>/abc/?apiky=<<apikey>>" or "http://sample.com/<<Base_Path>>/abc/efg/errr/dfg?apiky=<<apikey>>".i am getting proper response

When i select resource path as "/" or not select any resource path while adding proxy to the product, above both cases are working fine

Solved Solved
2 5 8,243
2 ACCEPTED SOLUTIONS

Hi Veerendra -

Few questions to help troubleshoot:

Do you have any resources defined on the proxy? If so, what are the exact "Paths" (include exact setup with forward slashes, wildcards, etc.)?

Where is the API key policy attached? PreFlow, or one of the resources?

Have you gotten call 1 to work with a correct API key? (Make sure you have a developer and an associated developer app that's tied to a product. Then in the App Details page of the UI -- Publish > Developer Apps > app -- make sure the status next to the product is "Approved", and the Consumer Key is the API key.)

The answers will help narrow down what's going on.

And regarding resources defined on the product:

/

by default acts the same as

/**

http://apigee.com/docs/developer-services/content/creating-api-products#configuring-the-behavior-of-...

But I'm guessing that's not the root of the problem.

Thanks,

Floyd

View solution in original post

Hi Veerendra -

Thanks so much for the extra info. I've been able to duplicate this on my side.

So is hitting http://sample.com (or the Apigee proxy equivalent) supposed to return something? If not, that could be your problem--making a call to a resource that doesn't exist on the backend.

However, if it *is* supposed to return something, remove the resource on the product, or change it to **. The way you have it, you're telling the product to allow calls to all resource *after* the slash, but your first call isn't using a slash before the query param.

OR, add a slash to your first call, like this:

...<basePath>/?apikey=<key>

View solution in original post

5 REPLIES 5

Hi Veerendra -

Few questions to help troubleshoot:

Do you have any resources defined on the proxy? If so, what are the exact "Paths" (include exact setup with forward slashes, wildcards, etc.)?

Where is the API key policy attached? PreFlow, or one of the resources?

Have you gotten call 1 to work with a correct API key? (Make sure you have a developer and an associated developer app that's tied to a product. Then in the App Details page of the UI -- Publish > Developer Apps > app -- make sure the status next to the product is "Approved", and the Consumer Key is the API key.)

The answers will help narrow down what's going on.

And regarding resources defined on the product:

/

by default acts the same as

/**

http://apigee.com/docs/developer-services/content/creating-api-products#configuring-the-behavior-of-...

But I'm guessing that's not the root of the problem.

Thanks,

Floyd

Thanks Floyd Jones, for your quick response.please find the answer for your questions

  1. Do you have any resources defined on the proxy? If so, what are the exact "Paths".<<No resource defined in my proxy and base-path is configured for this proxy is " /notargetwithapikeys">>
  2. Where is the API key policy attached? PreFlow, or one of the resources?<<Attached policy to preflow>>
  3. Have you gotten call 1 to work with a correct API key? <<When select resource path "/**"(slash with double star) while adding proxy to product, call 1 sending error response and 2nd call working fine>>.

Please let me know if need some more information on same.

Thanks,

Veerendra

Hi Veerendra -

Thanks so much for the extra info. I've been able to duplicate this on my side.

So is hitting http://sample.com (or the Apigee proxy equivalent) supposed to return something? If not, that could be your problem--making a call to a resource that doesn't exist on the backend.

However, if it *is* supposed to return something, remove the resource on the product, or change it to **. The way you have it, you're telling the product to allow calls to all resource *after* the slash, but your first call isn't using a slash before the query param.

OR, add a slash to your first call, like this:

...<basePath>/?apikey=<key>

Not applicable

Hi,

Just started looking into this myself. Through testing, there is indeed a difference between a Resource Path in a Product with just "/", "/*", or "/**". My proxy has the ValidateAPIKey policy in the Request PreFlow.

Here are my results, which shows there is no way to match the basepath and only resources one level deep, which just so happens to be my desire.

Documentation here says there's a property that effects this but I dont know in which properties file, we are On Premise.

http://apigee.com/docs/developer-services/content/creating-api-products#resourcebehavior

Proxy Path           Resource Paths, exclusively in Product
                      /     /*    /**
-----------------------------------------------
/v1/basepath          Y     N      N
/v1/basepath/         Y     N      N
/v1/basepath/1        Y     Y      Y
/v1/basepath/1/       Y     Y      Y
/v1/basepath/1/2      Y     N      Y
/v1/basepath/1/2/     Y     N      Y
/v1/basepath/1/2/3/*  Y     N      Y

Hey Kurt - Not sure if there's a property file that gets updated. But the change is made via cURL command, per that topic you pointed to.