Developers
API
The plugin provides an API as a set of endpoints included in the existing WordPress REST(y) API. The endpoints and their general description and usage is detailed below.
Namespaces
The API is set on the base namespace admira/v1, under which all endpoints are served.
Remember the namespace
The namsepace is the initial part of all the endpoints routes documented below. Don't forget to include it.
Routes
/auth
The authentication endpoint is the start of all frontend client-side interactions. All endpoints that will be called by the client-side frontend require authentication to be performed, such as the admira proxy endpoints and the frontend log submit. This authentication is just a session that makes sure the user is coming from the website and not some automated traffic.
/proxy/{admira_endpoint}
This endpoint the integration between the plugin and admira, that allows admira's services to be called through WordPress. It powers the application that interfaces the ticket puchasing on the website running the plugin.
/settings
A set of internal endpoints for the plugin settings. See Settings.
These endpoints expects the WordPress user session cookie and for the user to have the manage_options capability.
GET /settings
Lists the current plugin settings.
POST /settings
Update the plugin settings for the json in the request's body.
/carts
A set of internal endpoints for the internal carts system. See Carts.
These endpoints expects the WordPress user session cookie and for the user to have the manage_options capability.
GET /carts
List the known carts in the internal cart system, paged by default.
Optional parameters
page integer
The page of the carts. 1 by default.
per_page integer
The amount of carts per page. 10 by default.
session string
Session hashed token to filter carts by.
/sessions
A set of internal endpoints for the session tokens system. See Sessions.
These endpoints expects the WordPress user session cookie and for the user to have the manage_options capability.
GET /sessions
List the known carts in the session tokens system, paged by default.
Optional parameters
page integer
The page of the sessions. 1 by default.
per_page integer
The amount of sessions per page. 10 by default.
/logs
A set of internal endpoints for the session/carts logs. See Session Logs.
GET /logs
List the session/cart logs, paged by default.
This endpoint expects the WordPress user session cookie and for the user to have the manage_options capability.
Optional parameters
page integer
The page of the logs. 1 by default.
per_page integer
The amount of logs per page. 10 by default.
POST /logs
Endpoint for external logs to be saved for a particular session (and optionally cart).
This endpoint expects the session token to be received via the request cookies.
Optional parameters
cart_id string
Cart ID for the log entry.
GET /logs/cart/{cart_id}
List the logs for a specific cart (cart_id), paged by default.
This endpoint expects the WordPress user session cookie and for the user to have the manage_options capability.
Optional parameters
page integer
The page of the logs. 1 by default.
per_page integer
The amount of logs per page. 10 by default.
GET /logs/session/{session_token}
List the logs for a specific hashed session token (session_token), paged by default.
This endpoint expects the WordPress user session cookie and for the user to have the manage_options capability.
Optional parameters
page integer
The page of the logs. 1 by default.
per_page integer
The amount of logs per page. 10 by default.