API Authentication

Authenticate API requests to the Fynapse API.

Overview

This article provides information on the authentication process for API calls.

Each API request made to Fynapse has to be authenticated. Fynapse uses OAuth2 Client Credentials authorization.

The Client Credentials Flow authorization occurs when an application exchanges its application credentials, such as client ID and client secret, for an access token from Fynapse.

  1. Go to User Account.
  2. In the API client section, click the Generate button. Client ID and Client secret will be generated. Make sure to copy the Client secret to your new API key, as you will not be able to see it again.
  3. Close the User Account window.

The diagram below shows the process of authenticating client credentials using a token:

Request Access Token
Request Access Token

Requesting Access Token

The access token can be obtained by sending a request to:

https://<instance-url>/auth/token

providing the client id and secret as parameters.

Example request and response below:

POST
/auth/token
1curl -X POST https://api.fynapse.com/auth/token \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/x-www-form-urlencoded" \
4 -d "grant_type=client_credentials" \
5 -d "client_id=abc123xyz789clientid" \
6 -d "client_secret=s3cr3tK3y!%40%232024"
Response
1{
2 "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjbGllbnRJZCIsImV4cCI6MTY5ODQ1NjAwMCwiaXNzIjoiYXBpLmV4YW1wbGUuY29tIn0.dQw4w9WgXcQ",
3 "expires_in": 3600,
4 "token_type": "Bearer",
5 "refresh_token": "def456uvw123refreshtoken"
6}

Session Timeout

By default, the sessions timeout occurs after 5 minutes of inactivity.

Errors

Status CodeDescription
401Authentication error occurs with invalid credentials
403Authorization error occurs when the user does not have authorization for login