Deployable as independent microservice with its own database providing REST API for managing threads and messages
- php
- composer
- MySql
- Rename
.env.example
to.env
- Update
.env
:- Set
APP_DEBUG
tofalse
and specifyAPP_KEY
(32 random characters) andAPP_TOKEN
- Create empty database and set connection details
- You can specify
APP_URL_PREFIX
to add a prefix to all endpoints
- Set
- Run:
# Install dependencies and optimize composer autoloader
$ composer install --optimize-autoloader --no-dev
# Create all tables
$ php artisan migrate
Each request must have
App-Token
header with the correct token specified in.env
GET /threads/{clientId}
- Url
- int clientId (required)
POST /thread
- Body
- string title* - title of the new thread
- array(string) clients - UUIds of clients assigned to the thread
- string params - JSON with parameters for this thread
PUT /thread/{threadId}/{clientId?}
- Url
- int threadId* - Id of the thread to update
- string clientId - if specified will be checked if client have access to the thread
- Body
- string title - New title (not updated if null)
- string params - New params
DELETE /thread/{threadId}/{clientId?}
- Url
- int threadId* - Id of the thread to delete
- string clientId - if specified will be checked if client have access to the thread
POST /thread/clients/{threadId}/{clientId?}
- Url
- int threadId* - Id of the thread to delete
- string clientId - if specified will be checked if client have access to the thread
- Body
- array(string) clients - Ids of clients to add
DELETE /thread/clients/{threadId}/{clientId?}
- Url
- int threadId* - Id of the thread to delete
- string clientId - if specified will be checked if client have access to the thread
- Body
- array(string) clients - Ids of clients to remove
GET /messages/{threadId}/{clientId?}
- Url
- int threadId* - Id of the thread
- string clientId - if specified will be checked if client have access to the thread
- Query string
- int take - number of messages to take (default: 10)
- int skip - number of message to skip (default: 0)
POST /message/{threadId}
- Url
- int threadId* - Id of the thread
- Body
- string content* - Message content
- int clientId*
- string params - JSON with parameters for this messages
This project is licensed under the MIT License