Authentication
You'll need to authenticate your requests to access any of the endpoints in the Synaptic API. In this guide, we'll look at how authentication works. Synaptic offers OAuth2 with a token.
OAuth2 with bearer token
The way to authenticate with the Synaptic API is by using OAuth2. When establishing a connection using OAuth2, you will need to login to get your access token — you will also find your current key in the Synaptic API Settings under API settings.
Here's how to call login to get your token using cURL:
Example login request with credentials
curl -X POST https://api.synapticaviation.io/v2/user/login \
-d email=YOUR_EMAIL_HERE \
-d password=YOUR_PASSWORD_HERE
Here's how to add the token to the request header using cURL:
Example request with bearer token
curl https://api.synapticaviation.io/v2/flights \
-H "Authorization: Bearer {token}"
Always keep your token safe. Note that the token expires in 7 days by default.