Creating an Entry
To create a new Entry you create a correctly structured JSON data set and send it to the entries list URL of the Event you want to add it to. The entry must be sent as a POST
request. Many fields can be omitted from the data structure you submit, since they contain system generated values. All you really need to include to create an entry, is the payload
field:
{ "payload":[ { "name": "basic", "value": "This is a new entry." } ] }
Using curl
you would save the modified JSON data in a file (say new-entry.json
) and submit it like this:
curl --include -u user:password -X POST -H "Content-Type: application/json" \ > http://host-ip-address/live-center-editorial/event/24/entries --upload-file new.json
You need to include a Content-Type
header with the request, specifying the data MIME type (application/json
).
The JSON format requires you to escape any quote marks in field values using a preceding backslash (\
). This is commonly required when inserting HTML into rich text fields, for example:
{ "payload":[ { "name": "xhtml", "value": "<p class=\"myclass\">Hello world</p>" } ] }
Embedding Foreign Content
Live Center allows foreign content from social media sites such as Twitter and YouTube to be embedded in entries' rich text fields (see Using Embed Codes). To do this when editing a JSON payload, you must insert the foreign content's URL as an XHTML anchor (a
) element, and include two special CSS classes:
esc-social-embed
-
This class indicates that the link is to be rendered as embedded content rather than an ordinary link.
esc-tag-
providerName-
Where providerName is one of
Youtube
,Twitter
,Vimeo
,Vine
orInstagram
. This identifies the source of the foreign content. No other sources of foreign content are currently supported.
The following example shows a payload containing an embedded YouTube video:
"payload":[ { "name": "xhtml", "value": "<p><a class=\"esc-social-embed esc-tag-Youtube\" href=\"https://www.youtube.com/watch?v=yVwAodrjZMY"></a></p>" } ]