The B2B authentication api allows you to retrieve a JWT token to use with the authenticated B2B api endpoints.
With the B2B Authentication API, you can:
- Retrieve a JWT token to authenticate your B2B api calls.
- Rotate your
client_secret.
One must pay attention to the token expiry, a token is valid for the entiity of its life.
Before you can call any API endpoint, you must authenticate using the client_id and client_secret originally provided by your RAI Partners' Client Success representative.
API Call Example:
- Productionhttps://api.raipartners.com/b2b/auth/token
- Sandboxhttps://api.dev.raipartners.com/b2b/auth/token
curl -i -X POST \
https://api.raipartners.com/b2b/auth/token \
-H 'API-Version: 1.0.0' \
-H 'Content-Type: application/json' \
-d '{
"client_id": "los-client",
"client_secret": "my-super-auth-secret"
}'API Call Response Example:
Response
{ "scope": "read:user write:user", "refresh_expires_in": 300, "token_type": "Bearer", "not-before-policy": 0, "access_token": "eyo.....", "expires_in": 300 }
Trigger a client_secret rotation per your company's policy
- A successful response confirms that the secret has been rotated and provides new secret value.
API Call Example:
- Productionhttps://api.raipartners.com/b2b/auth/client-secret/rotation
- Sandboxhttps://api.dev.raipartners.com/b2b/auth/client-secret/rotation
curl -i -X POST \
https://api.raipartners.com/b2b/auth/client-secret/rotation \
-H 'API-Version: 1.0.0' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'API Call Response Example:
Response
{ "secret": "PX4eWb9rcRT1RBqvLw4GtuqyoUFWoGLr" }