Add a Label
You can add a new label using the POST method on the labels endpoint. You need a token with write privileges, otherwise a 401 or 403 will be sent back.
Label format
All fields for a label are mandatory and correspond to the identifiers of the label plus its value.
POST http://host.28.io/v1/_queries/public/api/labels?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
"AID" : "my-archive",
"SectionURI" : "http://www.example.com/my-section",
"ReportElement" : "my:Dimension",
"Role" : "http://http://www.xbrl.org/2003/role/verboseLabel/"
"Language" : "de-CH",
"Value" : "Das isch mis dimensiönli"
}
In general, any object output by a GET on the labels endpoint will be accepted in a POST, so that you can take labels from an existing archive with a GET and feed them into another archive with a POST.
You can post several labels at a time by sending them concatenated, with no comma separator.
In case of success, the response body contains a copy of the label objects as they have been stored, after post-processing.
Common HTTP errors
- 400: when the input is invalid or contains duplicate labels or inconsistent information.
- 401: when the token is missing.
- 403: when you do not have the appropriate write access credentials.
- 404: when the archive, section or report element is not found.
- 409: when the label already exists.
Further reference
The reference for the REST API including the JSound schema for the input is documented here