1. How can I call the API?
  2. How do I authenticate with the API?
  3. What HTTP methods are supported by the API?
  4. What is the response format?
  5. How does the API handle errors?
  6. Is there a rate limit for API requests?
How can I call the API?

To call the API, use the provided endpoints and make HTTP requests using methods like GET, POST, PUT, or DELETE. The base URL for all API requests is https://thedocs.loma.com.ng/api.php/.


How do I authenticate with the API?

The API uses token-based authentication. After successful login, you will receive a JWT (JSON Web Token). Include this token in the Authorization header of your API requests:

BASE_URL: https://thedocs.loma.com.ng/

What HTTP methods are supported by the API?

The API supports the following HTTP methods:

  • GET - Retrieve data (e.g., fetching posts, users, images)
  • POST - Create new records (e.g., creating a new post or user)
  • PUT - Update existing records (e.g., updating a user's information)
  • DELETE - Delete records (e.g., removing a post or user)

What is the response format?

The API responds in JSON format. Here is an example of a successful response:

{
  "status": "success",
  "data": {
    "id": 1,
    "name": "John Doe"
  }
}

In case of an error, the response will look like this:

{
  "status": "error",
  "message": "Invalid endpoint"
}

How does the API handle errors?

The API uses standard HTTP status codes to indicate the success or failure of an API request. In addition, the API provides a JSON response with an error message explaining the issue.

{
  "status": "error",
  "message": "Invalid API key"
}

Is there a rate limit for API requests?

Yes, the API has a rate limit to prevent abuse. By default, you can make up to 1000 requests per hour. If you exceed the rate limit, you will receive a 429 status code indicating too many requests.