
This resource address creates a label and returns the ID of the created label.
The label name must be unique. The event element in the
payload body must be either marker or duration.
| URL Parameters | |
|---|---|
| format | The format of the posted data. Can be either
json (default) or xml. This value overrides the Accept header if
both are present. |
| Response Headers | |
|---|---|
| Content-type | The MIME type of the data in the response
body. Depending upon the value of the format parameter or Accept header, either
application/xml or application/json. |
Upon success, MarkLogic Server returns status code 200 (OK) and the ID of the created label.
manage-admin role, or the following
privilege: http://marklogic.com/xdmp/privileges/manage-admin
The structure of the data in the request body is as follows:
label:label
cat label.xml
==>
<label xmlns="http://marklogic.com/manage/meters/label">
<name>new label</name>
<event>marker</event>
<start_dt>2013-10-08T00:00:00</start_dt>
<end_dt>2013-10-09T00:00:00</end_dt>
<text>label text</text>
<meta><info>more information</info></meta>
</label>
curl -i -X POST --digest -u admin:password \
-H "Content-type: application/xml" -d @label.xml \
http://localhost:8002/manage/v2/meters/labels
==> Posts the label to MarkLogic Server and returns the
generated id.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.