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: | |
| dp-key | dialogportal™ master key that uniquely identifies the account to submit a form for |
| ext-key | External key that uniquely identifies the account to submit a form for |
| ext-type | Type of external key |
| form-id | Numeric value that identifies the form |
Request body: | A JSON array of form field values. The value data types depend on the field types - text strings for "Text" fields, integer options for "Singlechoice" fields and arrays of integer options for "Multichoice" fields. Endpoint 8006: Enumerate fields can be used to determine the fields and datatypes required for the form. Code Block |
---|
|
|
[
{
"fieldID": 87,
"value": "This is a text field"
},
/content/tagged
Request body: | JSON data with information about the content to be created. 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. Note |
---|
String data values will only be compared with string filter values, and numeric data values will only be compared with numeric filter values. So ensure that numeric values are entered as numbers, i.e. 5.9 not "5.9" . Numeric values are not culture-specific. Use a period "." as decimal separator, and do not use thousand separators. |
| | 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 |
---|
title | 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": {
"fieldIDwidth": 88"300px",
"valueheight": 134
},
{"50px",
"fieldIDa": 895.5,
"valueb": [ 13615,
138 ] }
] |
| Request body: | JSON data with same JSON array that was received Code Block |
---|
| [
"uniqueKey": 97531
{ },
"fieldIDactiveFrom": 87,
"2014-01-01T01:00Z",
"valueactiveTo": "This is a text field"
},
2014-03-25T23:00Z",
"overrideData": {
"fieldIDuniqueKey": 88,97531
}
} |
Code Block |
---|
title | Example 2: Create a single pixel image |
---|
| {
"valuetags": 134[ }"tag1" ],
{
"content": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
"fieldIDcontentType": 89,
"image/gif",
"valuetitle": [ 136, 138 ]
}
]"clear1x1.gif"
} |
|
Response body: | A 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 | Form data submitted Content created successfully. |
| 303 | Form data already submitted for this account |
| 400 | Invalid data: field was not recognized |
| 404 | Form or account not found. The following sub codes may be returned: |
404.1 | User not found |
404.2 | External user could not be found
|
404.4 | Form not found400.1Override failed - multiple content items matched Note |
---|
Can only ever be returned in conjunction with overrideData |
|