Excerpt |
---|
Create contentAdd 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: | POST /user/content/tagged | ||||||
Request body: | Sample request Code Block | | |||||
|
Required fields: | ||
tags | An array of Tags. At least one Tag must be present in the array. Tags must be url-safe, conforming to Regular Expression pattern: [a-zA-Z]+[a-zA-Z0-9-_]* |
Optional fields: | ||||
content | The content, formatted as a base64 encoded text string. | |||
contentType | The content mime-type, i.e. "image/gif" or "text/plain". If omitted, the content type is set to "text/html" if content is included, or "application/json" if data is included. | |||
data | A dictionary of strings or decimal values. These values can be used for search filtering.
| |||
title | A title string. | |||
activeFrom | A UTC date specifying the start of the content availability period. | |||
activeTo | A UTC date specifying the end of the content availability period. | |||
overrideData | A dictionary of strings or decimal values. When this field is present, any single tagged content item in the system with the same tags and matching all overrideData fields will be removed from the system and replaced with this content. Multiple matched content will result in a 400.1 error. |
Code Block | ||
---|---|---|
| ||
{ "tags": [ "t1", "t2" ], "content": "PGh0bWw+PGJvZHk+TW9yZSBIVE1MIGNvbnRlbnQ8L2JvZHk+PC9odG1sPg==", // optional - defaults to"contentType": "text/html", "contentdata": "base64 encoded content string", // required { "width": "300px", "valueheight": 6.8"50px", "a": 5.5, "b": 15, "uniqueKey": 97531 }, // optional - decimal "activeFrom": "2014-01-01T01:00Z", "activeFromactiveTo": "2014-0103-01T0125T23:00Z", "overrideData": { // optional - ISO UTC date"uniqueKey": 97531 } } |
Code Block | ||
---|---|---|
| ||
{ "activeTotags": "2014-03-25T23:00Z[ "tag1" ], "content": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", // optional - ISO UTC date"contentType": "image/gif", "title": "clear1x1.gif" } |
Response body:
Response body on successA JSON object containing the "contentID" of the newly created content. This identifier is used to publish content, and to connect entities to private content.
Code Block | ||
---|---|---|
| ||
{ "contentID": 4567 } |
Status codes:
201
Content created successfully.
Override failed - multiple content items matched
Note |
---|
Can only ever be returned in conjunction with |