Platformstay API documentation

All requests for the API must occur through the following link - http://api.host.com/v1/

Response could be either in Json or Xml format. Particular format may be defined in Accept header.

    Accept: application/json
    Accept: application/xml

Authorization

Authorization occurs through POST request for the following endpoint /auth/login.

The request body must consist of two parameters:

Request Content-Type must be - application/json

If authorization is successful then system will return the following response

HTTP Status Code: 200
{
    "message":"Authorization is successful",
    "accessToken": "user token",
    "defaultHomePage": "User home page",
    "firstName": "User First Name",
    "surname": "User Surname"
}

If authorization is failed then system will return the following response

HTTP Status Code: 401
{
    "message":"Invalid credentials",
}

In order to request to the rest API must be added Authorization header

Authorization: Basic access_token

Generated token could be used during 1 day.

Log out

For the system log out must be sent GET request with the following endpoint - /auth/logout

User token will be destroyed.

Resources

Access to the resources occurs as - /resource

System support the following requests:

    GET /resource: list of all resources by page;
    HEAD /resource: information about all resources;
    POST /resource: creation if new copy ;
    GET /resource/123: detailed infromation about resource #123;
    HEAD /resource/123: hight level information about resource #123;
    PATCH /resource/123 (also PUT) /resource/123: updating information about resource #123;
    DELETE /resource/123: deleting resource #123;
    OPTIONS /resource: list of supported requests to the /resource;
    OPTIONS /resource/123: list of supported requests to the /resource/123.

Powered by platformstay.com