Getting Started
Quickstart
Connect to the sandbox environment and make your first authenticated request.
Before You Start
Afrisend shares the sandbox and production base URLs, along with your credentials, during onboarding. The examples in this documentation use {{baseUrl}} in place of the base URL. For example, the login request is:
text
POST {{baseUrl}}/loginLog In
Every endpoint except login needs a bearer token.
- Call
loginwith your username and password. - Send the
access_tokenfrom the response in the headers of every later request:
http
Authorization: Bearer <access_token>
Content-Type: application/jsonbash
curl -X POST {{baseUrl}}/login \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "login@loginWithUsernameAndPassword",
"params": { "username": "YOUR_USERNAME", "password": "YOUR_PASSWORD" },
"id": "1"
}'The login response includes the token's expiry. After the token expires, requests return HTTP
401 with {"status": 401, "message": "Failed, Not authorized"}. Log in again and retry the request.
Test Data
UAT simulates subscriber lookups (getMobileSubscriberDetails and getBankSubscriberDetails).
Afrisend provides:
- A mobile number that returns a successful lookup
- A bank account number that returns a successful lookup
Any other number or account returns a lookup error, so you can test both outcomes.