getItemsRequest

Returns a set of items in a container (folders, address books, or libraries). There are three ways to specify the items to return: specify the container in the container's element, specify the item IDs in the items element, or specify a filter.

Request

<getItemsRequest>
<container type="types:uid" />
<view type="string"/>
<filter type="types:Filter" />
<items type="types:ItemRefList" />
<count type="int" />

Response

<getItemsResponse>
<items type="types:Items />
<sids type="string" />
<status type="types:Status" />

Elements

container

(optional) Specifies the folder, address book, or library container ID. If the container is not specified, the filter is used. If the filter is not present, an error is returned.

view

Specifies the elements returned for each item. The view reduces the amount of data returned. If a view is not specified, all item elements are returned.

filter

Specifies the items to return based on a filter.

items

Specifies a list of item ids to return.

sids

If “sids” is supplied in the view, the items are returned in the as a space delimited string of sid (short ID's) values.

GroupWise 2012 and later.

count

Specifies the number of items to return. If the count element is -1, all items are returned.

items

Returns the specified items.

code

Specifies the error number related to the event. 0 indicates that the request was successful.

status

Returns the success or failure of the method.

Remarks

This method is used to get the following item types:

  • Folders

  • Query Folders

  • Shared Folders

  • GroupWise Address Book

  • Personal Address Book

  • Documents

  • Libraries

If a container is not supplied, either a filter or an item reference list is required to limit the search. Also, if the container is not specified, all folders are searched.

The getItemsRequest reads all the items in the specified container. The number of items returned can be reduced by providing the count element. For example, if a container has 4,000 items, getItemsRequest returns all 4,000 items if a count is not specified. If a count of 200 is specified, 4,000 items are read and only 200 items are returned. Reading all the items in a container and returning a subset of items is not efficient.

Be aware that getItemsRequest returns only 5,000 items. If the more than 5,000 items are available, an error message is returned, directing you to refine your search criteria.

You can use filters to limit your searches.

Example

This section contains several examples on retrieving items.

Get Folder Items

<getItemsRequest>
   <container>7.domain1.po1.100.0.1.0.1@16</container> 
</getItemsRequest>

<getItemsResponse> 
   <items> 
      <item type="Mail"> 
         <id>45003893.domain1.po1.100.16E3837.1.FBA.1@1:7.
               domain1.po1.100.0.1.0.1@16</id> 
         <version>3</version> 
         <modified>2012-09-07T22:44:53Z</modified> 
         <container>7.domain1.po1.100.0.1.0.1@16</container> 
         <created>2012-09-07T21:19:47Z</created> 
         <status> 
            <opened>1</opened> 
            <read>1</read> 
         </status> 
         <msgId>45003893.domain1.po1.200.20000CB.1.1532.1</msgId> 
         <messageId><45003893.2618.00CB.0@phantom.com></messageId> 
         <source>received</source> 
         <delivered>2012-09-07T21:19:47Z</delivered> 
         <security>Normal</security> 
         <subject>Attachment attached</subject> 
         <distribution> 
            <from> 
               <displayName>u1</displayName> 
               <email>u1@phantom.com</email> 
               <uuid>1DEB6970-175B-0000-890F-6E00D5004E00</uuid> 
            </from> 
            <to>u1</to> 
            <sendoptions> 
               <statusTracking>None</statusTracking> 
            </sendoptions> 
         </distribution> 
         <options> 
            <priority>Standard</priority> 
         </options> 
         <hasAttachment>1</hasAttachment> 
         <size>1801</size> 
      </item> 
   </items> 
   <status> 
      <code>0</code> 
   </status> 
</getItemsResponse>

Library

<getItemsRequest> 
   <container>domain1.po1.po1 Library@67</container> 
   <view/> 
   <filter/> 
   <count>0</count> 
   </getItemsRequest>

<getItemsResponse> 
   <items> 
      <item type="Document"> 
         <id>domain1.po1.po1 Library:5@68</id> 
         <version>5</version> 
         <container>domain1.po1.po1 Library@67</container> 
         <created>2012-09-13T10:45:49Z</created> 
         <subject>This is a zip file that contains a 
                 PALM Dictionary</subject> 
         <library> 
            <displayName>po1 Library</displayName> 
            <email>po1 Library@phantom.com</email> 
         </library> 
         <documentNumber>5</documentNumber> 
         <documentTypeName>Document</documentTypeName> 
         <author> 
            <displayName>u1</displayName> 
            <email>u1@phantom.com</email> 
            <uuid>1DEB6970-175B-0000-890F-6E00D5004E00</uuid> 
         </author> 
         <creator> 
            <displayName>u1</displayName> 
            <email>u1@phantom.com</email> 
            <uuid>1DEB6970-175B-0000-890F-6E00D5004E00</uuid> 
         </creator> 
         <officialversion>2</officialversion> 
         <currentversion>2</currentversion> 
         <current> 
            <entry> 
               <displayName>Creator Access</displayName> 
               <email>C</email> 
               <rights> 
                  <read>1</read> 
                  <edit>1</edit> 
                  <delete>1</delete> 
                  <share>1</share> 
                  <manage>1</manage> 
               </rights> 
            </entry> 
         </current> 
         <official> 
            <entry> 
               <displayName>Creator Access</displayName> 
               <email>C</email> 
               <rights> 
                  <read>1</read> 
                  <edit>1</edit> 
                  <delete>1</delete> 
                  <share>1</share> 
                  <manage>1</manage> 
               </rights> 
            </entry> 
         </official> 
         <other> 
            <entry> 
               <displayName>Creator Access</displayName> 
               <email>C</email> 
               <rights> 
                  <read>1</read> 
                  <edit>1</edit> 
                  <delete>1</delete> 
                  <share>1</share> 
                  <manage>1</manage> 
               </rights> 
            </entry> 
         </other> 
      </item> 
   </items> 
   <status> 
      <code>0</code> 
    </status> 
</getItemsResponse>

Filter

The following filtered request retrieves tasks in the specified container:

<getItemsRequest>
   <container>A.AutoDomain.AutoPO1.100.0.1.0.1@19</container>
   <filter>
   <element> 
      <op>eq</op> 
      <field>@type</field> 
      <value>Task</value>
   </element>
   </filter>
</getItemsRequest>

The following filtered request retrieves personal or received items in the specified container:

<getItemsRequest>
   <container>A.AutoDomain.AutoPO1.100.0.1.0.1@19</container>
   <filter>
      <elements> 
         <op>or</op> 
         <element>
            <op>eq</op>
            <field>source</field>
            <value>received</value>
         </element>
         <element>
            <op>eq</op>
            <field>source</field>
            <value>personal</value>
         </element> 
      </elements>
   </filter>
</getItemsRequest>

The following filtered request retrieves items in the specified container that were received after 5:00pm UTC on September 12, 2012:

<getItemsRequest>
   <container>A.AutoDomain.AutoPO1.100.0.1.0.1@19</container>
   <filter>
      <elements> 
      <op>and</op> 
         <element>
            <op>gte</op>
            <field>startDate</field>
            <value>2012-09-12T17:00:00Z</value>
         </element>
         <element>
            <op>eq</op>
            <field>source</field>
            <value>received</value>
         </element> 
      </element>
   </filter>
</getItemsRequest>