Share via


GetItemsByIds Method

The GetItemsByIds method of the Imaging service returns the items with the specified IDs.

Parameters

strListName   The name of the list on the current Web site.

ids   The IDs of the items that are to be returned.

Return Value

A Microsoft.SharePoint.SoapServer.SoapXml object that contains the following:

<Library name="strListName " xmlns="http://schemas.microsoft.com/sharepoint/soap/ois/">
  <z:row xmlns:z="#RowsetSchema" ows_ID="1" ows_Created="2002-05-02 19:41:36"
    ows_Author="1;#User_Alias" ows_Modified="2002-05-02 19:41:36"
    ows_Editor="1;#User_Alias" ows__ModerationStatus="0"
    ows_FileRef="1;#t1/55VGXIE6.jpg"
    ows_Last_x0020_Modified="1;#2002-05-02 19:41:36"
    ows_Created_x0020_Date="1;#2002-05-02 19:41:36"
    ows_File_x0020_Size="1;#30917" ows_FSObjType="1;#0"
    ows_CheckoutExpires="1;#" ows_CheckedOutUserId="1;#"
    ows_FileLeafRef="1;#55VGXIE6.jpg" ows_VirusStatus="1;#30917"
    ows_CheckedOutTitle="1;#" ows_Modified_x0020_By="DOMAIN\User_Alias"
    ows_owshiddenversion="0" ows_File_x0020_Type="jpg"
    ows_LinkFilenameNoMenu="55VGXIE6.jpg" ows_LinkFilename="55VGXIE6.jpg"
    ows_DocIcon="jpg" ows_ServerUrl="/t1/55VGXIE6.jpg"
    ows_EncodedAbsUrl="http://Server_Name/t1/55VGXIE6.jpg"
    ows_BaseName="55VGXIE6" ows_FileSizeDisplay="30917"
    ows_LinkSharing="<a href="http://Server_Name/_layouts/1033/ShrOpt.aspx?
      obj=,document,{5DE3F393-52CF-4644-BA74-FF868C120A05}">
      ["Has Unique Perms" column value]</a>"
    ows_ImageWidth="736"
    ows_ImageHeight="467"
    ows_ThumbnailUrl="http://Server_Name/t1/_t/55VGXIE6_jpg.jpg"
    ows_WebImgUrl="http://Server_Name/t1/_w/55VGXIE6_jpg.jpg"
    ows_NameOrTitle="jpg" ows_SelectedFlag="0" ows_ImageSize="736"
    ows_RequiredField="t1/55VGXIE6.jpg" />
    .
    .
    .
</Library>

Error Values

The following table shows errors that may be returned by the GetItemsByIds method.

Error Code Description
0x1 ListNotFound: The requested list is not found.
0x2 IsNotLibrary: The requested list, although found, is not a picture library.
0x3 ItemNotFound: The requested list item is not found.
0x4 FolderNotFound: The requested folder is not found.
0x5 InvalidArgument: One or more arguments are not valid.
0x6 FileExists: The file already exists, and the user doesn't specify the overwrite option.

SOAP Request Format

The following is a sample SOAP request. The placeholders shown need to be replaced with actual values.

POST /_vti_bin/imaging.asmx HTTP/1.1
Host: Server_Name
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/ois/GetItemsByIds"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetItemsByIds xmlns="http://schemas.microsoft.com/sharepoint/soap/ois/">
      <strListName>string</strListName>
      <ids>
        <unsignedInt>unsignedInt</unsignedInt>
        <unsignedInt>unsignedInt</unsignedInt>
      </ids>
    </GetItemsByIds>
  </soap:Body>
</soap:Envelope>

SOAP Response Format

The following is a sample SOAP response. The placeholders shown will be replaced with actual values.

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetItemsByIdsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/ois/">
      <GetItemsByIdsResult>
        <xsd:schema>schema</xsd:schema>xml</GetItemsByIdsResult>
    </GetItemsByIdsResponse>
  </soap:Body>
</soap:Envelope>

Requirements

Platforms: Microsoft Windows Server 2003

Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Imaging.asmx