I made API Keys in Postman and added them as a custom header in my Postman requests. I have sent a few requests over and am still not seeing usage reflected on my Postman account? I am going to send a big request over in the following days and I want to make sure that my calls are reflected. I am using Newman to run my collection.
In Postman
In Postman account, my API Key has a name and a value
In Postman app, my key:value is in my Globals and it is also added as a custom header
In Newman
I am running the collection with the newman run collection.json -g globals.json to capture the api key:value
I have sent a few GET requests but still not seeing usage reflected. Is there latency on Postman side? I want to make sure when I run my collections using Newman my usage is being reflected properly.
Does that API token work when used in a request within Postman and show that it’s been used in the API Keys section?
If you open up the exported Globals file in a text editor, is the value populated with the token? If this was only in the Current value of your Global variable in the app, it wouldn’t have been exported in that file.
As this is a secret token and probably something you wouldn’t want to expose you could use:
newman run collection.json --global-var "global-variable-name=global-variable-value"
You could take that further by adding the token value as a system variable or an environment variable on your CI tool and reference it using the relevant syntax in the command.