Authentication

Basic Authentication

The Snaps Conversations API applications are designed for server to server communications only. To make requests to the API from your application, you will pass your credentials using the Basic HTTP Authentication Scheme RFC 7617.

Care should be taken with your credentials and if they are compromised, you can delete them and provisions new ones at any time from app.snaps.io.

Most client software provides a simple mechanism for supplying a username and password and builds the required authentication headers automatically. For example, you can specify the -u argument with curl as follows:

curl -D- -u username:password -X GET -H "Content-Type: application/json" https://snaps.io/api/applications/<your_app_id>

If you need, you can construct and send Basic auth headers yourself.

Perform the following steps:

  • Build a string of the form username:password.
  • Base64 encode the string.
  • Supply an “Authorization” header with content “Basic” followed by the encoded string. For example, the string “fred:fred” encodes to “ZnJlZDpmcmVk” in base64, so you would make the request as follows:
curl -D- -X GET -H "Authorization: Basic ZnJlZDpmcmVk" -H "Content-Type: application/json" "https://snaps.io/api/applications/<your_app_id>"

What’s Next

Now that you can authenticate, you're ready to make your first request.