Перейти к основному содержимому

Universal Booking Subsystem (0.1.2)

Download OpenAPI specification:Download

License: MIT

REST API для Universal Booking Subsystem (UBS).

auth

Everything about authentication and authorization

Register a new user (Sign Up)

Creates a new user in the system.

Responses

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Bad request - Invalid input data",
  • "details": [
    ]
}

User login (Sign In)

Authenticates the user and returns a JWT pair.

Request Body schema: application/json
required
login
required
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "login": "yukhno",
  • "password": "asdf"
}

Response samples

Content type
application/json
{
  • "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "session": "f9648812-d9e9-40ee-b4eb-3d9f6d827dce",
  • "user": {
    }
}

Activate user account via link

Activates a new user account using a unique activation link sent to the user via email after registration.

path Parameters
link
required
string

The special activation link key

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

User logout (Sign Out)

Invalidates the current access token.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Check user authentication

Returns user data if access token is valid.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "session": "f9648812-d9e9-40ee-b4eb-3d9f6d827dce",
  • "user": {
    }
}

Regenerate JWT token pair

Issues new access and refresh tokens.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "session": "f9648812-d9e9-40ee-b4eb-3d9f6d827dce",
  • "user": {
    }
}

user

Everything about operations with users

Delete the user

Delete the authorized user

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get the user settings

Returns current settings of the user.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{ }

Reset user settings

Resets settings to default or updates them.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get user command history

Returns the history of user actions.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • { }
]

Reset user command history

Clears user history log.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

calendars

Everything about operations with calendars

List current user's calendars

Every user can have multiple calendars linked to a master calendar in UBS.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create a calendar

Adds a new calendar to the user's account.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "calendar_id": "c828ce68-4c5a-4491-b76a-af3d888d3f97",
  • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  • "calendar_type_id": 0,
  • "calendar_properties": {
    }
}

Update a calendar

Edits the details of a user's calendar.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "calendar_id": "c828ce68-4c5a-4491-b76a-af3d888d3f97",
  • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  • "calendar_type_id": 0,
  • "calendar_properties": {
    }
}

Delete a calendar

Deletes a calendar from the user's account.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

calendar items

Everything about operations with calendar items

Get all calendar item types

Returns a list of all calendar item types available in this system. This information can be used for the item_type_id field when creating a new calendar item.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "1": "timecluster",
  • "2": "domain",
  • "3": "project",
  • "4": "workpackage",
  • "5": "task",
  • "6": "milestone",
  • "7": "reminder",
  • "8": "note",
  • "9": "periodical"
}

Getting all the calendar items

Returns all calendar items by the current user. If you want to set a specific time range, then you can do it with start and end in-query parameters.

Authorizations:
bearerAuth
query Parameters
start
string <date-time>

The start of time range

finish
string <date-time>

The end of time range

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create calendar item

Adds an event or time slot to the calendar.

Authorizations:
bearerAuth
Request Body schema: application/json
required
item_id
string or null <uuid>

The calendar item's ID

item_type_id
required
integer
Enum: 1 2 3 4 5 6 7 8 9

The calendar item's type ID

calendar_id
required
string <uuid>

The calendar's ID of the current calendar item

item_parent_id
string or null <uuid>

Parent item's ID

required
object

An additionnal proprerties of the calendar item

item_start
required
string <date-time>

Фактическое время начала события

item_finish
string or null <date-time>

Фактическое время окончания события

item_tags
Array of strings or null

Список тегов, связанных с элементом

item_name
required
string

Название элемента календаря

Responses

Request samples

Content type
application/json
Example

Action Description

Add a new Time Cluster which:

  • has every day next time blocks:
    • from 4:00 until 4:30
  • additionaly has every week:
    • on Mon-Fri from 5:00 until 7:15
    • on Mon-Fri from 8:15 until 10:00
    • on Mon-Fri from 18:45 until 20:45
    • on Sat-Sun from 5:00 until 9:00
    • on Sun from 18:00 until 20:45

Fields Description

  • item_id: optional ::
    The UUID of this calendar item. (If this field not set, then UUID will be generated automaticaly)

  • item_type_id: mandatory ::
    The TypeID of the calendar item.
    List of an available value you received with: GET /api/v2/calendar/item/types

  • calendar_id: optional ::
    The calendar's UUID of the calendar item. (IF this field not set, then system must be used the UUID of the "Master Calendar" of the current user)

  • item_name: optional ::
    The display name of this timecluster. (defalut value: new cluster)

  • item_parent_id: optional ::
    The Parent calendar item's UUID. (defalut value: null -- it means this item is the root item)

  • item_start: optional ::
    The activation date & time of this Timecluster. (value by defalut: 2000-01-01 00:00:00.000 +0000)

  • item_finish: optional ::
    The deactivation date & time of this Timecluster. *(value by defalut: null -- it is means never)

  • item_tags: optional ::
    The tags' list. *(value by default: [] | empty array)

  • item_properties: optional ::
    The settings of the current Timecluster.
    Available properties for Timeclusters (any others properties must be ignored for Timeclusters):

    • start: optional :: The describe rules of dependence start datetime value
      • after: datatime
      • before: datetime
      • predecessors: []
      • successors: []
    • finish: optional :: TBD
    • duration: TBD
    • repeat: optional :: TBD
      • from: Time
      • every: 0
      • until: time
      • period: TBD
    • note: TBD
{
  • "item_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "item_type_id": 1,
  • "calendar_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "item_name": "Time for me",
  • "item_parent_id": null,
  • "item_properties": {
    },
  • "item_start": "2000-01-01 00:00:00.000 +0000",
  • "item_finish": null,
  • "item_tags": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "item_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "item_type_id": 1,
  • "calendar_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "item_name": "Time for me",
  • "item_parent_id": null,
  • "item_properties": {
    }
}

Get a specific calendar item

Returns information about a specific calendar item.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid>

The UUID of the calendar item

Responses

Response samples

Content type
application/json
{
  • "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
  • "item_type_id": 1,
  • "calendar_id": "c828ce68-4c5a-4491-b76a-af3d888d3f97",
  • "item_parent_id": "4a3df6a9-08f2-44ec-ba8e-7d8a7a360cd5",
  • "item_properties": {
    },
  • "item_start": "2000-01-01 00:00:00.000 +0000",
  • "item_finish": "2019-08-24T14:15:22Z",
  • "item_tags": [
    ],
  • "item_name": "string"
}

Update calendar item

Modifies an existing calendar item.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid>

The UUID of the calendar item

Request Body schema: application/json
required
item_id
string or null <uuid>

The calendar item's ID

item_type_id
required
integer
Enum: 1 2 3 4 5 6 7 8 9

The calendar item's type ID

calendar_id
required
string <uuid>

The calendar's ID of the current calendar item

item_parent_id
string or null <uuid>

Parent item's ID

required
object

An additionnal proprerties of the calendar item

item_start
required
string <date-time>

Фактическое время начала события

item_finish
string or null <date-time>

Фактическое время окончания события

item_tags
Array of strings or null

Список тегов, связанных с элементом

item_name
required
string

Название элемента календаря

Responses

Request samples

Content type
application/json
{
  • "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
  • "item_type_id": 1,
  • "calendar_id": "c828ce68-4c5a-4491-b76a-af3d888d3f97",
  • "item_parent_id": "4a3df6a9-08f2-44ec-ba8e-7d8a7a360cd5",
  • "item_properties": {
    },
  • "item_start": "2000-01-01 00:00:00.000 +0000",
  • "item_finish": "2019-08-24T14:15:22Z",
  • "item_tags": [
    ],
  • "item_name": "string"
}

Response samples

Content type
application/json
{
  • "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
  • "item_type_id": 1,
  • "calendar_id": "c828ce68-4c5a-4491-b76a-af3d888d3f97",
  • "item_parent_id": "4a3df6a9-08f2-44ec-ba8e-7d8a7a360cd5",
  • "item_properties": {
    },
  • "item_start": "2000-01-01 00:00:00.000 +0000",
  • "item_finish": "2019-08-24T14:15:22Z",
  • "item_tags": [
    ],
  • "item_name": "string"
}

Delete calendar item

Removes a specific item from the calendar.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid>

The UUID of the calendar item

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}