9001: Create content
Add tagged content to the system. The content must be published using endpoint 9003: Publish content before it can be accessed.
New tagged content is generally appended to the system - existing data is pushed back, but may still appear in searches depending on search limits, activeTo/activeFrom dates etc.
However in certain circumstances it can be desirable to replace content. This can be done using the overrideData field, which provides a dictionary to be matched against existing content data. When a single content item matches all tags and all overrideData fields, that content will be removed before the new data is created. If no content is matched the new content is created as usual. And if more than one item is matched, a 400.1 error will be reported, and no content created.
Endpoint ID: | 9001 | |||||||||||||||||||||||||||||||
Method: | ||||||||||||||||||||||||||||||||
URL: | /content/tagged | |||||||||||||||||||||||||||||||
Request body: | JSON data with information about the content to be created.
Example 1: Create HTML content. Existing content with tags \["t1","t2"\] and data\["uniqueKey"\]=97531 will be replaced.{
"tags": [ "t1", "t2" ],
"content": "PGh0bWw+PGJvZHk+TW9yZSBIVE1MIGNvbnRlbnQ8L2JvZHk+PC9odG1sPg==",
"contentType": "text/html",
"data": {
"width": "300px",
"height": "50px",
"a": 5.5,
"b": 15,
"uniqueKey": 97531
},
"activeFrom": "2014-01-01T01:00Z",
"activeTo": "2014-03-25T23:00Z",
"overrideData": {
"uniqueKey": 97531
}
}Example 2: Create a single pixel image {
"tags": [ "tag1" ],
"content": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
"contentType": "image/gif",
"title": "clear1x1.gif"
} | |||||||||||||||||||||||||||||||
Response body: |
Example{
"contentID": 4567
} | |||||||||||||||||||||||||||||||
Status codes: | 201 | Content created successfully. | ||||||||||||||||||||||||||||||
| 400.1 | Override failed - multiple content items matched Can only ever be returned in conjunction with | ||||||||||||||||||||||||||||||