- Apache (.htaccess)
- PHP 7
-
Install composer (if needed):
brew install composer
-
Install dependencies:
composer install
This will also run the post install script
post_install.sh
-
Deploy the contents of
api/
to your web server.
Get API information.
Query parameters:
- None
Returns:
- 200
{ name, description, version, git_sha }
Errors:
- None
Start a new logging session.
Query parameters:
- None
Returns:
- 200
{ session }
session
: Session token, used to authenticate subsequent calls to /log
Errors:
- None
Add message to a logging session. One of the parameters message
or messages
is required. If both are given, messages
is ignored.
The session token needs to be provided in one of the following ways:
- Using an
Authorization: Bearer <session_token>
header - Using the
session
query parameter
Query parameters:
message
: (Optional) The message to be added to the log.messages
: (Optional) Array of messages to be added to the log. JSON encoded array of one or more strings e.g.messages=["first msg","second msg"]
(useJSON.stringify()
or similar).session
: (Optional) Session token, retrieved from /session. If this is omitted, anAuthorization
header containing the session token needs to be sent.
Returns:
- 200
Errors:
- 400
{error: 'message(s) required'}
: nomessage
ormessages
parameter was provided - 400
{error: 'messages needs to be a JSON array of one or more strings'}
:messages
parameter is in wrong format - 400
{error: 'message(s) exceeds max length'}
:message
ormessages
parameter too long - 401
{error: 'session required'}
: no session token was provided - 403
{error: 'invalid session'}
: session token is invalid - 403
{error: 'session expired'}
: session token is expired