1. Home
  2. API
  3. Introduction

Introduction

API access is limited to subscribers of our "Business" plan.

Our API allows you to gain access to your bases, categories and articles. All endpoints are read-only and available via GET.

If you are having problems accessing resources or have anything in mind we should add, let us know at support@eniston.io

Example: Access a specific base

Method: GET
$access_token = 't8ZMQLQiquuyMjHFqfqW0hlEvQsNioCQLLe9npgZ';

curl https://eniston.io/api/base/{id} \
    -H "Authorization: Bearer $access_token" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

Rate Limiting

You can make up to 60 requests per minute and 1,440 requests per day per authenticated user. You can check the returned HTTP headers of any API request to see your current per minute rate limit status:

Status: 200 OK
x-ratelimit-limit: 60
x-ratelimit-remaining: 59

If you keep hitting the limit, consider caching the results within your application.

Errors

When we detect an error in your request, we will return a HTTP 4xx response. Most common will be 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden) and 404 (Not Found).

For example, a 403 response will return the following information:

{
  "success": false,
  "message": "You have no access to the requested resource"
}

Please note that the response message might give you further details about what went wrong. A message is only returned for requests that resulted with an error. If you aren't receiving errors, but for example a login page, make sure you've set "Accept: application/json" in your request headers.

Response data

All responses from our API will be formatted as JSON.

This is an example payload of the /api/article/{id} endpoint, which gives you data about a specific article you have access to:

{
  "success": true,
  "article": {
    "id": "cf42ff72-8d60-4644-8e76-00d73b12d6e4",
    "category_id": "00e2a9af-d467-32f9-bc0b-9ebd086701f9",
    "title": "This is my demo article for the API",
    "slug": "this-is-my-demo",
    "text": "<p>Here is the body of my article. Formatted as HTML.<\/p>",
    "views": 35,
    "rating_happy": 9,
    "rating_neutral": 3,
    "rating_sad": 1,
    "keywords": null,
    "introtext": null,
    "updated_at": "2021-07-05T08:33:02.000000Z"
  }
}

Successful responses will return a HTTP 200 response. You can also check for a valid response by using the success state, which is either true or false.

The success state will be returned for all requests to valid endpoints.


Was this article helpful?