401 Unauthorized error.
We use standard HTTP Basic Authentication over HTTPS.
Using Your Credentials
For Basic Authentication with Bluerails:- The Username is your
ORGANIZATION_ID. - The Password is your secret
API_KEY.
Authorization header for every API request.
Constructing the Header:
- Form the string
ORGANIZATION_ID:API_KEY(your Organization ID, followed by a colon, followed by your secret API key). - Base64 encode this string.
- Prepend
Basic(with a space) to the Base64 encoded string.
API Key Types
You will have separate API keys (and potentially Organization IDs) for different environments:- Test Credentials: Used for development and testing in the sandbox environment. Test API keys typically start with
blue_test_sk_.... - Live Credentials: Used for production requests processing real transactions. Live API keys typically start with
blue_live_sk_....
Obtaining Your Credentials
You can find your Organization ID and generate/manage your API keys from the Bluerails Dashboard (replace with actual link if different) under the API settings or developer section.Example Request (using cURL)
Here’s how you might make a request usingcurl, letting it handle the Basic Auth encoding:
- Get your Base64 encoded credentials: (Placeholder for command to generate base64 string from ORG_ID:API_KEY)
- Use the encoded string in the Authorization header: (Placeholder for curl command using -H Authorization: Basic)