URGENT - Verify API key returns error

anton
New Member

Created an app manually via the Edge website.

The API proxy requires an API key to be provided by the callers.

When I use the Consumer Key of the app that I created I'm getting this error:

{"fault":{"faultstring":"Invalid ApiKey for given resource","detail":{"errorcode":"oauth.v2.InvalidApiKeyForGivenResource"}}}

Why does it say anything about OAuth? It was supposed be a regular apikey verification via the Query String

5556-api-exec-error.png

Solved Solved
0 3 4,008
1 ACCEPTED SOLUTION

@Anton+Bar ,

It's a silly mistake !! You have defined access to /shippingCalculator resource inside the API & You are calling api without the above resource name.

Instead of ,

https://freightos-dev.apigee.net/estimator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG3

Isn't it ,

https://freightos-dev.apigee.net/estimator/shippingCalculator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG...

Hope it helps 🙂

View solution in original post

3 REPLIES 3

anton
New Member

Checked further, I'm supposed to receive this error in this case - this is not what's happening.

  • The is valid
  • The Developer App IS associated correctly to the Proxy
  • It is through the Product

What's going on?

InvalidApiKeyForGivenResource401An API key was received by Edge, and it is valid; however, it does not match an approved key in the Developer App associated with your API proxy through a Product.

anton
New Member

Here's the proof that they App key and the Product are "Approved".

Still the calls like:

https://freightos-dev.apigee.net/estimator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG3

or

https://freightos-test.apigee.net/estimator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG3

or

https://freightos-prod.apigee.net/estimator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG3

Result in:

{"fault":{"faultstring":"Invalid ApiKey for given resource","detail":{"errorcode":"oauth.v2.InvalidApiKeyForGivenResource"}}}

5561-api-exec-error-withkeys-and-product.png

@Anton+Bar ,

It's a silly mistake !! You have defined access to /shippingCalculator resource inside the API & You are calling api without the above resource name.

Instead of ,

https://freightos-dev.apigee.net/estimator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG3

Isn't it ,

https://freightos-dev.apigee.net/estimator/shippingCalculator?apikey=t8VZHGAHtcccIkTGE54w75jUxKWAoLG...

Hope it helps 🙂