Generate Token
POST https://api.staging.sawfish.com.au/api/v2/accounting/token/generate-tokenThis generates an access token that is valid for 10 minutes. This endpoint should be called only once. After obtaining the refresh_token, use the Refresh Token endpoint to get a new access token.
Headers
Section titled “Headers”| Header | Type | Required |
|---|---|---|
x-client-id |
string | ✅ |
x-api-key |
string | ✅ |
Example Request
Section titled “Example Request”curl --request POST \ --url https://api.staging.sawfish.com.au/api/v2/accounting/token/generate-token \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'x-client-id: your-client-id' \ --header 'x-api-key: your-api-key'Responses
Section titled “Responses”200 - Successful response
{ "status": "SUCCESS", "data": { "token": "your_token", "refresh_token": "your_refresh_token", "expiration": 1691123100 }}401 Unauthorized / 500 Internal Server Error
{ "status": "ERROR", "message": "Sample error message"}
