Skip to main content

Create annotation

This API is responsible for creating an annotation.

[POST]/api/v1/annotations

Response: The id of the newly created annotation.

Header

Header used on this API are those taken from header standards of TS Digital.

Content-type is accepted in application/json

Query Parameters

No query parameters are needed to make this request.

Body

{
  "id": "string",
  "type": "string",
  "text": "string",
  "classification": "string",
  "ownership": {
    "type": "WS",
    "identifier": "string"
  },
  "referencing_date": "string",
  "reference_period": "string",
  "reference_type": "string",
  "reference_ids": [
    "string"
  ],
  "item_classifier": "string",
  "inserted_by": "string"
}
  • id: the identifier of the annotation, if not specified a random UUID will be generated instead
  • type: specifies the annotation type.
  • text: contains information about the annotation. Depending on the type, the information contained can be:
    • note text: the text value, in case the annotation is of type NOTE
    • folder name: the name of the folder, in case the annotation is of type FOLDER
  • classification: the classification of the annotation
  • ownership: specifies the ownership of the annotation. It contains the following 2 fields:
    • type: it can be WS or ITEM
    • identifier: the item identifier
  • referencing_date: the referencing date
  • reference_period: the year of reference
  • reference_type: the reference type, at the moment the only possible value is DOCSTORE
  • reference_ids: the ids of the related documents
  • item_classifier: it can be ACCOUNTANT or COMPANY
  • inserted_by: the name of the creator of the annotation

Response

On successful response

If successful, the API responds with HTTP code 200(OK) with the following body:

{
  "id": "string"
}
  • id: the unique identifier of the annotation
On error response

In the event of an error, the API responds with a body JSON with the following format:

{
  "code": "string",
  "timestamp": "2022-10-28T13:01:00.754Z",
  "message": "string",
  "subErrors": [
    {}
  ]
}
  • code: A string representation of the HTTP error code, linked with the returned http error
  • timestamp: Date and time of the answer, expressed as a string.
  • message: Message expressing error.

Possible errors are:

  • 400: The request is malformed (parameters with incorrect format, invalid or inconsistent parameters).
  • 401: An authorization token has not been provided or the authorization token provided is invalid (eg: it has expired).
  • 403: The provided token is valid, but the user is not authorized to perform the operation.
  • 500: An unexpected error occurred.