Get Access and Refresh Token Using curl

The quickest way to get an access token and a refresh token is to launch your terminal and run the following command:

Obtain Access and Refresh Tokens
curl --location --request POST '' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic {{authentication_code}}' \
--header 'Cache-Control: no-cache' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username={{' \
--data-urlencode 'password=yourpassword'


In order to run the command, among other parameters, you need a client secret and client ID, both of which can be obtained by creating an app inside your SearchUnify instance. Check out Get Client ID and Client Secret with an API App for instructions.


There are three parameters in the endpoint URL.

  1. Instance URL ({{hostname}}). For instance,

  2. Your client ID and client secret ({{base64([clientID]:[clientSecret]}}). Concatenate the ID and secret, and encode the resulting string using Base64.

  3. SearchUnify log-in credentials (grant_type=password&username={{USERNAME}}). Enter the email and password used to log into your SearchUnify instance.

Generate Access Tokens Repeatedly

Once you have both refresh and access tokens, a more efficient way to generate access tokens repeatedly is to use the call described in Obtain an Access Token from a Refresh Token.