Apigee Emulator: valid API key: but response "InvalidApiKey"

Given: Running Apigee Emulator, deployed proxy, Postman with valid API key.

Desired result: proxy in Emulator to return OK 200.

Actual result: response "InvalidApiKey".

details:

Same API key is being used with Postman to get OK 200 answer from the Apigee PaaS.

However, identical request returns response "InvalidApiKey" from the Apigee Emulator.

Should I provide any appropriate details, please let me know.

Hoping that someone in the community already knows how to resolve or experienced something close.

thank you, Yermek

#apigee #emulator

Solved Solved
0 4 510
2 ACCEPTED SOLUTIONS

API Keys will be different in different runtimes.

If I understand what you're doing, sending an API call into Apigee PaaS, with a specific API key, it works. 

Sending the same API call into Apigee emulator, with the same API key, it is rejected. 

The runtime in the emulator is a real runtime, distinct from Apigee PaaS, and it has its own set of known API keys. You cannot assume that the API Keys known to Apigee in the cloud are also known to the APigee runtime in the emulator.  You need to ensure the API keys you use with the emulator are available and valid in the  emulator. Have you done that?

 

View solution in original post

Dino is right, these are different api_keys. 

In you emulator you need to create test data (create all chain > product > developer > app) and deploy it to your emulator. 

 

You then will find your apikey in the 'Active developer apps' loaded to the emulator: 

 

Denis_KALITVI_0-1625768727650.png

 

View solution in original post

4 REPLIES 4

API Keys will be different in different runtimes.

If I understand what you're doing, sending an API call into Apigee PaaS, with a specific API key, it works. 

Sending the same API call into Apigee emulator, with the same API key, it is rejected. 

The runtime in the emulator is a real runtime, distinct from Apigee PaaS, and it has its own set of known API keys. You cannot assume that the API Keys known to Apigee in the cloud are also known to the APigee runtime in the emulator.  You need to ensure the API keys you use with the emulator are available and valid in the  emulator. Have you done that?

 

Yes, your understanding of what I'm doing is correct.

Oh, I did not know about this fact. I have not done it when I was asking my question.

Thanks a lot, @dchiesa1 

I have followed https://cloud.google.com/apigee/docs/api-platform/local-development/vscode/tutorial-test 

and now using the API key for the Emulator Runtime, I am able to connect.

Your answer solved my question. Kudos!

Dino is right, these are different api_keys. 

In you emulator you need to create test data (create all chain > product > developer > app) and deploy it to your emulator. 

 

You then will find your apikey in the 'Active developer apps' loaded to the emulator: 

 

Denis_KALITVI_0-1625768727650.png

 

Thanks a lot, @Denis_KALITVI 

Your reply helped me to find https://cloud.google.com/apigee/docs/api-platform/local-development/vscode/tutorial-test 

and now using the API key for the Emulator Runtime, I am able to connect.

Your answer solved my question. Kudos!