Api - gsmirnoff/marketing GitHub Wiki
api root : /api
common response: {"code":0, response:{...method response...}}
methods:
allowed to all
- GET /api/ping
response: {"Ping Succeeded"}
- POST /api/auth
request:
{"name": "blah-blah", password: "blah-blah-pass"}
response:
{..., "token":{"token":"some_token", expires:expire_time}}
*GET /api/pages/:page - list of page sections
response:
[{page object 1}, {page object 2}]
!!!following methods will be moved to admin section!!!
*POST /api/pages/:page - create new
request:
{title:'page title', content:{valid json or string}}
response:
same as request - created entity
*PUT /api/pages/:page/:id - updates existing entity
request/response:
same as in POST
*DELETE /api/pages/"page/:id - deletes existing entity
response:
"Delete successful"
allowed to admin
(client should send "token" header with token value from auth response)
- GET /api/auth/check
response {"Admin auth verified"}