Authentication
Partner

Partner Authentication

Partner authentication requires a clientId and clientSecret to authenticate and act on the behalf of a client.

💡

The request is using Bearer Token generated through client /oauth route.

Note that partner access token is valid for 86400 seconds (24 hours) hours and will expire after this period. A new access token can be requested using the same process.

OAuth2 Client Credentials Flow

curl --location 'https://api.sg.g17.eco/v1/oauth/token' \
--header 'Content-Type: application/json' \
--data '{
  "grant_type": "client_credentials",
  "client_id":  "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}'

On success response, you should receive a token and userId associated with partner service account

{
  "access_token":"eyJhbGciOiJIUzI1NiIsIn...Ko1K2f_xV-3Azc2Tbr-xzpR_6qOOM-XM",
  "expires_in":86400,
  "token_type":"Bearer"
}

Legacy Authentication

⚠️

This method is deprecated and will be removed in future releases. The return data follows non-standard OAuth2 response.

  curl --location 'https://api.sg.g17.eco/v1/auth' \
  --header 'Content-Type: application/json' \
  --data '{
    "grantType": "client_credentials",
    "clientId":  "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET"
  }'

On success response, you should receive a token and userId associated with partner service account

{
    "success": true,
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MzkxMWE5YWQzYWM5Njk3NmE2NDQ5OWMiLCJpYXQiOjE2NzA0NjM5ODMsImV4cCI6MTY3MDU1MDM4M30.4UqlYy3faDiIuCqt0ujzOvWPVeCWjAW5Ea2cMnr9CTw",
    "userId": "63911a9ad3ac96976a64499c",
    "expiry": 86400
}