User Details Endpoint

Endpoint

URL: /api/user

Method: GET

Description

This API endpoint retrieves the authenticated user’s account details using their API credentials.

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.

GET request

See usage example in the code snippets below:

Get the user details

GET request for user details:


Content-Type: application/json
api-key: your-api-key
secret-key: your-secret-key

      

Response:


{
  "success": true,
  "data": {
    "username": "iabcodes",
    "email": "user@example.com",
    "balance": 5200,
    "role": "USER",
    "userLevel": "basic",
    "banks": [
      {
        "bankName": "GTBank",
        "accountNumber": "0123456789",
        "accountName": "User Doe"
      }
    ],
    "banned": false,
    "isPinCreated": true
  }
}

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.