Reinos.nl internet media add-ons

Webservice

Your ExpressionEngine content as a REST API.

Webservice turns your ExpressionEngine site into a REST API. Apps, front ends and other systems read and write your entries, with the permissions you already set in the control panel.

Read an entry

Request

curl -G 'https://your-domain.com/index.php/webservice/entry' \
  -H 'Authorization: Bearer <shortkey>' \
  --data-urlencode 'data[entry_id]=43'

Response: 200 OK

{
    "success": true,
    "message": "Successfully read",
    "data": [
        {
            "entry_id": 43,
            "title": "My Entry",
            "status": "open",
            "channel_id": 1
        }
    ]
}

Key features

Your fields as JSON

Grid, Fluid and relationships, as plain JSON

Send Grid rows, Fluid blocks and related entries as JSON when you create or update an entry. The Entry API puts them in the right fields.

Reading an entry? Add include=parents|structure to also get the entries that relate to it and its Structure page.

Read more in the docs (opens in a new tab)
Create an entry

POST /index.php/webservice/entry

{
    "data": {
        "channel_name": "news_channel",
        "title": "Test entry",
        "grid": {
            "rows": [
                { "cell_1": "row 1", "cell_2": "row 11" }
            ]
        },
        "relationship": [2, 3, 4, 5],
        "fluid": [
            {
                "field": "fluid_field_name_wyvern",
                "value": "<p>Wyvern</p>"
            }
        ]
    }
}

Member, Comment and Category API

Members, comments and categories in the box

Next to entries, the module has a Member, Comment and Category API. No separate packages to install or keep up to date.

Switch the Member and Comment API on in the settings. They follow the registration, profile and comment rules of ExpressionEngine and the permissions of the member.

Read more in the docs (opens in a new tab)
The endpoints
# Member API
POST    /webservice/member
GET     /webservice/member
PUT     /webservice/member
PUT     /webservice/member/password
DELETE  /webservice/member

# Comment API
POST    /webservice/comment
GET     /webservice/comment
PUT     /webservice/comment
DELETE  /webservice/comment

# Category API, read only
GET     /webservice/category
GET     /webservice/category/group

Endpoints overview

Every endpoint in one overview

The Endpoints page lists every endpoint of the installed APIs with its status, calls, errors, average duration and cache hits for the period you choose.

Select endpoints to enable, disable or make them public in one go. A public endpoint answers without credentials. Import the endpoints in Postman, or generate a client, with the OpenAPI specification.

Read more in the docs (opens in a new tab)
Every endpoint in one overview

Try it

Try a call before you write code

Every endpoint has a Try it page. Send a request as yourself, with the credentials of a member or without any, and see the status, the duration, the headers and the formatted response.

Copy the cURL command of the request, or pick one of your last five requests to send it again.

Read more in the docs (opens in a new tab)
Try a call before you write code

Shortkeys and key/secret

Its own key for every app

Give every app a shortkey with a label, see when it was last used, and revoke it without touching the others. Send it as a Bearer header, or use a key and secret, Basic auth or a session.

A member only reaches the APIs you selected for it, and only does what its role allows in the control panel.

Read more in the docs (opens in a new tab)
Its own key for every app

Your own API

Missing an endpoint? Add your own

Put a webservice_settings.json in your own add-on and a class with a static method per endpoint. The module turns what the method returns into the JSON response.

Your endpoints get the same authentication, permissions, logging, caching and rate limiting, and show up in the endpoints overview, on the Try it page and in the OpenAPI specification.

Read more in the docs (opens in a new tab)
webservice_settings.json
{
    "name": "news",
    "label": "News",
    "auth": true,
    "methods": [
        {
            "route": "/{entry_id}",
            "http_method": "GET",
            "method_name": "read_news_item",
            "name": "Read one news item",
            "cachable": true
        }
    ]
}

API logs

See what every call did

With Log requests on, every call is logged with the time, the member, the IP address, the HTTP status and the duration. With Debug on, the queries and the response data are logged too, so you see why a call is slow or fails.

Read more in the docs (opens in a new tab)
See what every call did

Rate limiting

Protected against overload and guessing

Set the calls per minute for each member, and for public endpoints per IP address. A call over the limit gets a 429 and is not run.

After a set number of failed authentications in a minute (ten by default), an IP address is locked out for the rest of that minute.

Read more in the docs (opens in a new tab)
Protected against overload and guessing

Get Webservice

€59,95 per site, updates and support included.

Version 10.0.0

Requires ExpressionEngine 7.3+ and PHP 8.0+. Installation (opens in a new tab)