API Authentication

Overview

The BobPlus Africa API uses OAuth 2.0 authentication. You must obtain a Bearer Token using your Consumer Key and Consumer Secret before making any API requests. This ensures secure, authorized access to all endpoints.

  • Purpose: Secure API access using short-lived tokens.
  • Target Audience: Developers integrating with BobPlus Africa APIs.

Quickstart
  1. Sign up for a BobPlus Africa Developer Account.
  2. Get your Consumer Key and Consumer Secret from the dashboard.
  3. Request a Bearer Token using the authentication endpoint.
  4. Use the Bearer Token in the Authorization header for all API requests.

Authentication Endpoint
HTTP MethodPOST
Endpoint URL/api/v2/auth/login
Base URLhttps://prod-url-here
DescriptionObtain a Bearer Token using your Consumer Key and Secret.
Request Headers
HeaderTypeDescriptionRequired
Acceptstringapplication/jsonYes
Content-Typestringapplication/jsonYes
Request Body
FieldTypeDescriptionRequired
consumer_keystringYour API consumer keyYes
consumer_secretstringYour API consumer secretYes
curl --location --request POST 'https://prod-url-here/api/v2/auth/login' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "consumer_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
    "consumer_key": "XXXXXXXXXXXXXXXXXXXX"
}'

Success Response
FieldTypeDescription
successbooleanIndicates if the request was successful
messagestringResponse message
data.access_tokenstringThe Bearer Token
data.token_typestringToken type ("bearer")
data.expires_inintegerToken lifetime in seconds
{
    "success": true,
    "message": "Success",
    "data": {
        "access_token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "token_type": "bearer",
        "expires_in": 3600
    }
}

The access_token must be included in all API requests in the following format:

Authorization: Bearer YOUR_ACCESS_TOKEN

Error Responses
Status CodeExampleDescription
400{"success": false, "message": "Invalid credentials."}Bad Request
401{"success": false, "message": "Unauthorized."}Missing or invalid credentials
429{"success": false, "message": "Rate limit exceeded."}Too many requests
500{"success": false, "message": "Internal server error."}Server error

Security Best Practices
  • Keep your Consumer Key, Secret, and Bearer Token confidential.
  • Tokens expire after 3600 seconds (1 hour). Refresh as needed.
  • Rotate credentials regularly and revoke if compromised.
  • Use HTTPS for all API requests.

Support & Feedback

For help, contact support@bobplus.africa.
Feedback on this documentation? Let us know.

Terms of Use & Legal

By using this API, you agree to our Terms of Service and Privacy Policy. Do not share sensitive data or credentials.