Labels API
Last updated
Last updated
In order to be able to use Labels API you must have an individual User API token, which can be found in space settings in devtodev system.
You will be able to see the interface unit with User API token in space settings only in case your price plan and access rights (role) allow you to use devtodev API. You can discard User API token or create it again on the same page.
Pay your attention that if you use several spaces, each of them will have an individual User API token.
The result of the request is the obtaining of the list of all existing labels categories for the app.
Request:
POST
Response:
The request is used to remove or rename a category. The category can be removed only if its full name is specified. One request can remove only one category. In case the parameter move_labels_to_category is specified, labels that belong to the category that is going to be removed will be transfered to the specified category. If the specified category doesn't exist, it will be created. If move_labels_to_category is not specified, all the labels that belong to the category will be removed.
Request:
POST
Response:
The result of the request is the obtaining of the list of labels that are presented as objects.
You can use filters to get some specific labels you need. In case no filter is specified, you will receive the whole list of labels. It is possible to use any combination of fields in a filter.
Request:
POST
Response:
The filter can be described with an object, where the following comparison operators can be the properties:
The empty object describes the filter that selects all the events in which the parameter value is not null or empty string.
In case the specified category doesn't exist, it will be created. If string values of fields exceed the maximum, they will be cut off.
If you need to specify an event without time length, start_date must be equal to end_date or end_date must not be specified.
Request:
POST
Response:
To edit a label you need to specify its identifier (id). All the specified fields for the label will be replaced. In case the specified category doesn't exist, it will be created.
If it is necessary to change the dates of an event, you must specify start_date. It is impossible to specify end_date without specifying start_date. If the label is used in relation to a continuous event (start_data and end_date are different timestamps), but in an edited version only the start_date is received, the label becomes a point that characterizes an instant event.
Request:
POST
Response:
The request is used to delete one or several labels. To delete a label its identifier is required. The request without specified identifiers is not valid.
Request:
POST
Response:
Error handling
In case there is an error in a request, the response is made in the following format:
where
status_code (number) - the general status of an error
errors (array) - an array of error descriptions
code (number) - the exact code of an error from the table of errors
msg (string) - a brief description of an error
The list of possible errors is given in a table.
Not more than 30 labels in one request on labels creation
Not more than 500 labels to be created in a calendar day for User API token
Not more than 200 labels to be created in a calendar day for an app