Authentication
API keys, JWTs, and authorized requests
Partner API v2 and the sandbox use the same API key, secret, and auth endpoint. Exchange an API key ID and secret for a short-lived JWT, then send that JWT as a Bearer token on all other requests.
Obtain the JWT from production for both environments. The only difference is the base URL you call with that token.
| Environment | Resource base URL |
|---|---|
| Production | https://api.phonelineplus.com/v2 |
| Sandbox | https://api.phonelineplus.com/sandbox |
Obtain a JWT
POST https://api.phonelineplus.com/v2/auth is the only endpoint that does not require a Bearer token. Use it for production and for sandbox.
POST https://api.phonelineplus.com/v2/auth
Content-Type: application/json
{
"keyID": "00000000-0000-0000-0000-000000000000",
"secret": "your-api-secret"
}Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}| Field | Description |
|---|---|
access_token | JWT to send on subsequent requests |
token_type | Always Bearer |
expires_in | Lifetime in seconds — request a new token before expiry |
Use the JWT
Include the token on every other request. Production and sandbox accept the same JWT; only the resource base URL changes:
GET https://api.phonelineplus.com/v2/customers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...GET https://api.phonelineplus.com/sandbox/customers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Security practices
- Store
keyIDandsecretonly on secure server-side systems. - Never embed credentials in mobile apps, browser JavaScript, or public repos.
- Refresh tokens proactively using
expires_in; do not wait for the first401. - On
401 Unauthorized, obtain a new JWT and retry once before treating it as a configuration error.
Errors
| Status | Meaning |
|---|---|
401 | Missing, invalid, or expired JWT |
400 | Invalid keyID / secret body (validation) |
See Errors for general error handling.
Updated 17 days ago
Did this page help you?
