Adds a property to a document.
- Short Name
- POST
- Parent
- Type
- Extension
- Since
- 1.1
- Path
rest/projectdoc/1/document
/{id}/property/{name}
Adds a property to a document.
There is no undo!
It is strongly recommended to run commands only on backed-up instances!
Make a backup of your data before starting to work with this API! Consider to run your experiments on a copy of the production data!
Properties do not track modification date and ETag. Therefore the returned information refers to the enclosing document.
Path Parameter
All path parameters are required to be specified.
name
The name of the requested property.
id
The unique identifier of the requested projectdoc document.
Representation
The format of the representation to post to the URL may be XML or JSON.
Here is the basic structure in JSON:
{
"name": "",
"value": "",
"controls": "",
"position": "",
"ref": ""
}
Only the following position values are allowed:
before
- insert the new property before the referenced (ref
) propertyafter
- insert the new property after the referenced (ref
) propertyfirst
- insert the new property at the first positionlast
- insert the new property at the last position
The ref
parameter allows to specify an existing document property. This is relevant if new properties are added relative to an existing property. If the property specified by ref
cannot be found, 404
is returned.
Examples
The following examples show usage scenarios for this service.
For all examples keep in mind: The name of the property, as well as the document it is part of, is specified in the URL.
Shows how a property is added in front of an existing property (Sort Key
in this case).
{
"value": "The value of the new property.",
"position": "before",
"ref": "Sort Key"
}
Besides setting the value, the controls may also be set.
{
"value": "The value of the new property.",
"controls": "hide",
"position": "before",
"ref": "Sort Key"
}