Using an API Key

If you want to start using API keys rather than oauth, we have some great news…

It’s been rolled out into production!

We’ll be updating documentation in the coming days. The API Explorer is still a bit quirky and we’re working on getting a better solution there (and you thought the oauth keys was weird!).

For those who want to jump straight in –

When using one of our APIs, you specify your API key with an authorisation header. When calling an endpoint, you specify your API Key in an HTTP header called Authorization.
For example, if your API key was aab5e795-c02a-47ce-ac4b-25ed9baa87c8, your request URL will include a header like:
Authorization: apikey aab5e795-c02a-47ce-ac4b-25ed9baa87c8

You can find your API Key under the “Applications” section.

3 Likes

Sweeeeeeet! :hugs: :hugs:

1 Like

Any closer to this yet?

Hi Ben - did you want to use the API explorer with API Keys?

If so we may just have to write up instructions on how to do this as the changes to the API Explorer may not happen in time. We’ll report back here once we have the details on how published.

Yeah, I was looking up something in the Explorer as I posted that message; I suspect that using the API key would be easier than trying to remember the OAUTH credentials.

That said, when I get around to developing the system I’m developing, I’ll be authenticating with API keys.

Thanks for the prompt reply.

1 Like

Hi guys, we’ve updated our site with detailed instructions on how to use the API Explorer with an API key. For more info please have a look at the API Basics and API User Guide pages:

Thanks.

1 Like

An example using CURL is
curl -H "Authorization: apikey xxxxxxxxxxxxxx" https://api.transport.nsw.gov.au/v1/gtfs/alerts/sydneytrains

1 Like