Authentication
Authentication works by sending a registered API Key in all requests.
Authentication
Authentication works by sending a registered API Key in all requests
API Key
Benbase provides API keys to partners, which allow them to authenticate through the API.
Your API key is a long lived token that will be used as a bearer token in request headers.
Requests made to the API should add an Authorization header with this key at all times:
"Authorization": "Bearer {{API_KEY}}"Key Types
There are two key types:
- Sandbox
- Production
Sandbox is for integration testing / non-production usage
By convention API keys are prefixed sandbox_sk_ and live_sk_ for Sandbox and Production, respectively
Keys are meant to be secret and should not be shared or visible
API Base URL
Sandbox and Production have separate base URLs and separate API keys.
| Environment | API key prefix | Base URL |
|---|---|---|
| Sandbox | sandbox_sk_ | https://embed-sandbox.benbase.com/api |
| Production | live_sk_ | https://embed.benbase.com/api |
Send each request to the base URL of the environment of your key. A key works only on the host of its own environment. A key sent to the other host returns 401:
{
"error": {
"message": "Invalid or disabled API key.",
"code": "UNAUTHORIZED"
}
}Before your first live employer, change the base URL and the key together. See Go Live.