Authentication

You'll need to authenticate your requests to access any of the endpoints in the Snapsbrew API. In this guide, we'll look at how authentication works.

Bearer token authentication

You can generate as many tokens as you want in your account screen. The generated token should be sent to the API in an Authorization header.

Example request with basic auth

Authorization: Bearer THIS_IS_A_VALID_API_TOKEN

Every call that is made to the API should include the Authorization header with a valid token. Otherwise, the request will be rejected.


GEThttps://snapsbrew.com/api/v1/auth

Get authenticated user

This endpoint will allow you to make a GET request to validate that the token you are using is valid. No params are necessary. If your token is not valid you'll get a 401 response.

Response

{
  "email": "cyclops@xmen.com",
  "name": "Scott Summers"
}