How to find out what the Consumer (API) Key is, or change/update it.

Just getting started with Apigee. Created a proxy and then went to hit it with a get call from Postman. Getting:




"failed to resolve API Key variable request.header.x-api-key"



I assume the error is valid as I see this in the preflow:
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>verify-api-key</Name>
</Step>
<Step>
<Name>remove-header-apikey</Name>
</Step>
</Request>
<Response/>
</PreFlow>
So I need to either reveal what it is or change it.


Thanks

0 5 598
5 REPLIES 5

You'll need to generate an API Key, and then add it in the x-api-key header. Once you're more familiar with the platform, you'll find it's very easy to configure where to get the API key from.

Regarding generating an API Key, you'll need to familiarise yourself with the concepts of products, developers and apps. Sound daunting, but it really isn't. Here's a good tutorial to introduce you to these concepts: https://docs.apigee.com/api-platform/tutorials/secure-calls-your-api-through-api-key-validation

Yeah, I know, the problem is, in our company we seem to have a custom interface, none of the tutorials I find work. Is there any way you could explain how to generate a new one,or find the current one?

Not applicable

The error says request.header.x-api-key is not resolving. That means you are not sending the x-api-key header in the request.

you need to register api proxy to product and the product to developer app. You will get an auto-generated client key and secret in app. In If you want custom credentials you can use management api call to create.

Then you need to send that client key in the header x-api-key.

Exactly. I guess I wasn't very clear. I know there was an API key generated, but I don't know what it is. So my question is, how do I find it, or, if that can't be done, how do I generate a new one?

Not applicable

You can follow as below.

1. create a product.

2. register your api proxy to product.

3. create a developer

4. create a developer app.

5. register the product to the developer app.

6. you can see the client key and secret in the developer app.

The one you see is an autogenerated client key and secret. The client key is also called client id or api key.

If you want to create a custom key and secret you can do using management api call.

ref: https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper...

The client key you should pass as x-api-key in header.