You'll need to authenticate your requests to access any of the endpoints in the Spaw API. In this guide, we'll look at how authentication works. Spaw offers two ways to authenticate your API requests: Token GET parameter and OAuth2 with a token — OAuth2 is the recommended way.

Before you can make requests to the Spaw API, you will need to grab your API key from your dashboard.

You find it under Dashboard » API keys.

Query parameter authentication

With query parameter authentication, you use your token to authenticate your HTTP requests. Unless you have a very good reason, you probably shouldn't use query param auth. Here's how to authenticate using cURL:

Example request with a query parameter

Please don't commit your token to GitHub!

OAuth2 with bearer token

The recommended way to authenticate with the Spaw API is by using OAuth2. When establishing a connection using OAuth2, you will need your access token — you will find it in the Spaw dashboard under API keys section. Here's how to add the token to the request header using cURL:

Example request with bearer token

Always keep your token safe and reset it if you suspect it has been compromised.