How do I find my API key

Having trouble figuring out how to fetch my API key

1 Like

Hi @jkeys1104

You can find your registered API keys using the GET /api/api-key endpoint, more info can be found in our swagger documentation here.

The above will show you how many API keys your customer has and some information along with them such as the username associated with the key, whether it is enabled etc. However you will not be able to get the api token, that is a one-time deal at the point you create a key, this is done for security purposes.

If you have lost the key(s) don’t worry, you can use the API to disable any keys that should no longer be active and recreate new ones, be sure to keep your keys safe as we will never show you the token after creation.

Hope that helps.

1 Like

Thank you @cmcnicholas , although this is my first time working with APIs where would I need to go to on the alloy site to actually run GET /api/api-key

Hey @jkeys1104 no problem, all our documentation for the API and how to use it can be found on our Developer Portal

If you’re having difficulty using the API directly then I’m sure this is something our support team can help give you a steer with :+1:

Hi @jkeys1104 !

There are a few other steps before this that may help. You’ll probably want to log in to Alloy through the API to get a temporary session token. There are two steps to this, first you’ll need to login to “master” or log into Alloy itself, then log into your specific customer project.

Firstly, grab your customer code, you’ll need this later. It can be found in your Alloy profile menu once logged in.

To create a master session token, you’ll need to login using the /api/session endpoint using your email and password (click on “Try it out” then edit the values in the text box and hit execute). This should give you a master token which you’ll want to put into swagger using the “Authorize” box at the top.

Logging into a master session now lets you login to a specific customer, to do this, you’ll need to call the /api/session/customer/{customerCode} endpoint by hitting “Try it out” and putting your customer code into the text box and hitting Execute.

This will return you a token against your specific workspace, again you’ll want to put this into swagger using the Authorize button. From here, you’ll be able to interact with the API endpoints that @cmcnicholas mentioned.

Hope this helps!