Education pins Endpoint
Endpoint
URL: /api/eduapi
Methods: POST, GET
Description
This API endpoint allows users to purchase education pins like waec, neco, etc.
Authentication
To access this endpoint, users must include their API key and secret key in the request headers.
Request Headers
- api-key (string, required): The API key of the user.
- secret-key (string, required): The secret key of the user.
Request Body (POST)
- phone (string, required): The phone number of the recipient.
- firstLevel (string, required): The name of the examination.
- secondLevel (string, required): The type of the examination pin.
- phone (string, optional): The phone exam number of the recipient, if applicable.
Usage Example
See usage example in the code snippets below:
Example: Purchase Education pins
POST request to purchase education pins:
Content-Type: application/json
api-key: your-api-key
secret-key: your-secret-key
{
"phone": "08032566178",
"firstLevel": "NECO",
"secondLevel": "Resut checker",
}
Response:
- Status Code: 200
{
"message": "Transaction successful",
"data": {
"email": "user@example.com",
"transactionId": "202403021250s56bxh3mz5",
"activity": "NECO",
"message": "Resut checker",
"status": "Successful",
"recipient": "08032566178",
"number": 52665324546565,
"token": "555555123355533",
"amount": 10000,
"initialBalance": 1264,
"finalBalance": 264,
"Method": "API",
}
}
Failed Response Format
{
"error": "Transaction failed",
"data": {
"email": "user@example.com",
"transactionId": "202403021259avdzv2xt2c9",
"activity": "NECO",
"message": "Resut checker",
"status": "Failed",
"recipient": "08032566178",
"number": 52665324546565,
"amount": 1000,
"initialBalance": 1167,
"finalBalance": 1167,
"Method": "API",
}
}
GET request
See usage example in the code snippets below:
Get the list of available firstLevel
GET request for available firstLevel:
Content-Type: application/json
api-key: your-api-key
secret-key: your-secret-key
Response:
- Status Code: 200
[
{
"firstLevel": "NECO",
"secondevel": "Result checker",
"amount": 1000
},
{
"firstLevel": "WAEC",
"secondevel": "Exam pin",
"amount": 1000
}
]
Other Error Responses
- 401 Unauthorized: Invalid API key or secret key.
- 404 Not Found: User not found or data not available.
- 500 Internal Server Error: Internal server error occurred.