Authentication
The ThinkLP APIs use OAuth 2.0 Client Credentials. You exchange a client ID and secret for a short-lived access token, then send that token as a bearer token on every request. There are no user logins or session cookies.
Prerequisites
Your ThinkLP administrator provisions an external client app and shares two values with you:
| Value | Description |
|---|---|
| Client ID | The connected app's consumer key. |
| Client secret | The connected app's consumer secret. |
You also need your org's My Domain host (for example,
acme.my.salesforce.com). Every URL below uses it.
Step 1 — Request an access token
POST to your org's token endpoint with the client_credentials grant:
Code
A successful response returns an access token:
Code
Step 2 — Authorize your requests
Send the token in the Authorization header on every API call:
Code
Token lifetime
Client-credentials tokens are short-lived and cannot be refreshed. Request a new
one when the current token expires. A 401 response means the token is expired
or invalid. Cache and reuse a token across requests until it expires rather than
requesting one per call.
Security notes
- Treat the client secret like a password. Never embed it in client-side code or commit it to source control.
- Send every request over HTTPS.
- Access is governed by the permissions of the app's run-as user, including
Salesforce field-level security. A request for a field the app cannot see
returns
FLS_DENIED(see Errors).