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:


curl -i -X POST 'https://{{hostname}}/oauth/token' \ 
  -H "authorization: Basic {{base64([clientId]:[clientSecret])}}" \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'grant_type=password&username={{USERNAME}}&password={{PASS}}'

Parameters

There are four parameters in the endpoint URL.

Parameter Value (Sample) Details
{{hostname}} yourcompany.searchunify.com Your instance URL.
{{base64([cilentID]:[clientSecret])}} QzEyZTFm...mMw== Your client ID and client secret concatenated and encoded in Base64.
grant_type=password&username={{USERNAME}} yourname@yourcompany.com The email you use to log into your SearchUnify instance.
grant_type=password&...&password={{PASS}} *********** The password you use to log into your SearchUnify instance.

Last updatedTuesday, June 23, 2020