Add Items

To add items to a list or inbox, you need to submit a POST request to the list or inbox with a text/uri-list document in the body of your request. The document must contain the web service URIs of the content items you want to add to the list or inbox. To add two content items to a list, for example, you would need to first create a file containing your list of URIs, called uri-list.txt in this example:

http://host-ip-address/webservice/escenic/content/1093403
http://host-ip-address/webservice/escenic/content/1093556       

And then submit it with the following post request:

curl --include -u user:password -X POST -H "Content-Type: text/uri-list" \
> http://host-ip-address/webservice/escenic/list-pool/listID --upload-file uri-list.txt
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
X-ECE-Active-Connections: 1
Location: http://host-ip-address/webservice/escenic/list-pool/15585
ETag: "2218338705"
Vary: Accept
Content-Type: application/atom+xml
Content-Length: 2566
Date: Mon, 04 Apr 2016 13:20:18 GMT

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <author>
    <name>Escenic Content Engine</name>
  </author>
  <id>http://host-ip-address/webservice/escenic/list-pool/15585</id>
  <link rel="self" href="http://host-ip-address/webservice/escenic/list-pool/15585" type="application/atom+xml"/>
  <updated>2016-04-04T12:56:07.124Z</updated>
  <title type="text">My List</title>
  <link rel="http://www.vizrt.com/types/relation/changelog" href="http://host-ip-address/webservice/escenic/changelog/list/15585" type="application/atom+xml"/>
  <link rel="http://www.vizrt.com/types/relation/home-section" href="http://host-ip-address/webservice/escenic/section/1" type="application/atom+xml" title="Home"/>
  <entry>
    <id>http://host-ip-address/webservice/escenic/list-pool/handle/16795</id>
    <updated>2016-04-04T12:56:07.125Z</updated>
    <title type="text">(type=1 ,id=1093403 ,pubId=-1)</title>
    <link rel="edit" href="http://host-ip-address/webservice/escenic/list-pool/handle/16795" type="application/atom+xml"/>
    <link rel="self" href="http://host-ip-address/webservice/escenic/list-pool/handle/16795" type="application/atom+xml"/>
    <link rel="about" href="http://host-ip-address/webservice/escenic/content/1093403" type="application/atom+xml"/>
    <content type="application/vnd.vizrt.payload+xml">
      <vdf:payload xmlns:vdf="http://www.vizrt.com/types" model="http://host-ip-address/webservice/escenic/publication/demo/model/content-type/com.escenic.poolentry">
        <vdf:field name="com.escenic.priority">
          <vdf:value>-1</vdf:value>
        </vdf:field>
        <vdf:field name="com.escenic.pinned">
          <vdf:value>false</vdf:value>
        </vdf:field>
      </vdf:payload>
    </content>
  </entry>
  <entry>
    <id>http://host-ip-address/webservice/escenic/list-pool/handle/16796</id>
    <updated>2016-04-04T12:56:07.125Z</updated>
    <title type="text">(type=1 ,id=1093556 ,pubId=-1)</title>
    <link rel="edit" href="http://host-ip-address/webservice/escenic/list-pool/handle/16796" type="application/atom+xml"/>
    <link rel="self" href="http://host-ip-address/webservice/escenic/list-pool/handle/16796" type="application/atom+xml"/>
    <link rel="about" href="http://host-ip-address/webservice/escenic/content/1093556" type="application/atom+xml"/>
    <content type="application/vnd.vizrt.payload+xml">
      <vdf:payload xmlns:vdf="http://www.vizrt.com/types" model="http://host-ip-address/webservice/escenic/publication/demo/model/content-type/com.escenic.poolentry">
        <vdf:field name="com.escenic.priority">
          <vdf:value>-1</vdf:value>
        </vdf:field>
        <vdf:field name="com.escenic.pinned">
          <vdf:value>false</vdf:value>
        </vdf:field>
      </vdf:payload>
    </content>
  </entry>
</feed>

The response is an Atom feed. The document contains links back to the two content items you have just added, and to the list pool handles that have been created for them.

If you now retrieve the list or in-box's list pool feed, you will see that the two new entries have been inserted at the top of the list. New entries are always added at the top by default. See Insert/Move Items for instructions on how to insert entries in any other position.

Note that you can get the response in the form of an XHTML document rather than an Atom feed by including an accept header in your request:

curl --include -u user:password -X POST -H "Content-Type: text/uri-list" -H "Accept: application/xhtml+xml"\
> http://host-ip-address/webservice/escenic/list-pool/listID --upload-file uri-list.txt