Partager via


Retrieve the Metadata of Media Items

 

Applies To: Windows Server 2012 Essentials

Retrieves the metadata of media items of a certain media type with the specified sorting and grouping options.

URI Template

GET services/builtin/MediaManagement.svc/metadata/item/mediaType/{mediaTypeData}/groupingMethod/{groupingMethodData}/sortProperty/{sortPropertyData}/sortOrder/{sortOrderData}/index/{startingIndexData}/count/{requestedCountData}?grouping={groupingData}

{mediaTypeData}
The media type. Choose from one of the following values.

Media Type Value Meaning
music Audio clips.
photo Photos.
video Video clips.

{groupingMethodData}
The grouping method. Choose from one of the following values.

Grouping Method Value Applicable Media Types Meaning
album music Group by album.
albumartist music Group by album artist.
all music, photo, or video Group by media type.
artist music Group by artist.
date photo Group by date.
folder photo or video Group by folder.
genre music Group by musical genre (style).
playlist music Group by playlist.
rating music Group by rating.

{sortPropertyData}
The metadata property on which to sort the media items. Choose from one of the following values.

Metadata Property Type Meaning
date Sort by date.
default Sort by the default metadata property type in the web service.
title Sort by title.

{sortOrderData}
The sort order. Choose from one of the following values.

Sort Order Value Meaning
ASC Sort in ascending order.
default Sort in the default sort order.
DESC Sort in descending order.

{startingIndexData}
The numerical position of the first media item to be retrieved.

{requestedCountData}
The requested number of media items to be retrieved.

{groupingData}
The container path. To specify the root container, leave this parameter empty.

Sample Request

GET https://www.contoso.com/services/builtin/MediaManagement.svc/metadata/item/mediaType/photo/groupingMethod/all/sortProperty/date/sortOrder/ASC/index/0/count/100?groupingData= HTTP/1.1  
Accept: application/xml  
Cookie: ASP.NET_SessionId=********************  
Canary: *********************  
Host: domainname  
Content-Length: 0  

Sample Response

HTTP/1.1 200 OK  
<MetadataResult  
    xmlns="http://contracts.microsoft.com/WindowsServerEssentials/2011/09/WebApi"  
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Result>  
    <MetadataBase i:type="MetadataItem">  
      <Date>11/16/2004</Date>  
      <Id>B-358</Id>  
      <Title>Exif_JPEG_422</Title>  
      <TypeName>MetadataItem</TypeName>  
      <Album>[No Keywords]</Album>  
      <AlbumArtist>[Unknown Artist]</AlbumArtist>  
      <Duration i:nil="true"/>  
      <ParentFullPath/>  
      <Rating i:nil="true"/>  
      <Resolution>640x480</Resolution>  
      <Size>106524</Size>  
    </MetadataBase>  
    <MetadataBase i:type="MetadataItem">  
      <Date>11/16/2004</Date>  
      <Id>B-372</Id>  
      <Title>Exif_JPEG_422</Title>  
      <TypeName>MetadataItem</TypeName>  
      <Album>[No Keywords]</Album>  
      <AlbumArtist>[Unknown Artist]</AlbumArtist>  
      <Duration i:nil="true"/>  
      <ParentFullPath/>  
      <Rating i:nil="true"/>  
      <Resolution>640x480</Resolution>  
      <Size>105677</Size>  
    </MetadataBase>  
    <MetadataBase i:type="MetadataItem">  
      <Date>11/19/2004</Date>  
      <Id>B-373</Id>  
      <Title>Exif_JPEG_422</Title>  
      <TypeName>MetadataItem</TypeName>  
      <Album>[No Keywords]</Album>  
      <AlbumArtist>[Unknown Artist]</AlbumArtist>  
      <Duration i:nil="true"/>  
      <ParentFullPath/>  
      <Rating i:nil="true"/>  
      <Resolution>640x480</Resolution>  
      <Size>100079</Size>  
    </MetadataBase>  
    <MetadataBase i:type="MetadataItem">  
      <Date>11/16/2004</Date>  
      <Id>B-374</Id>  
      <Title>Exif_JPEG_422</Title>  
      <TypeName>MetadataItem</TypeName>  
      <Album>[No Keywords]</Album>  
      <AlbumArtist>[Unknown Artist]</AlbumArtist>  
      <Duration i:nil="true"/>  
      <ParentFullPath/>  
      <Rating i:nil="true"/>  
      <Resolution>640x480</Resolution>  
      <Size>107086</Size>  
    </MetadataBase>  
    <MetadataBase i:type="MetadataItem">  
      <Date>11/16/2004</Date>  
      <Id>B-375</Id>  
      <Title>Exif_JPEG_422</Title>  
      <TypeName>MetadataItem</TypeName>  
      <Album>[No Keywords]</Album>  
      <AlbumArtist>[Unknown Artist]</AlbumArtist>  
      <Duration i:nil="true"/>  
      <ParentFullPath/>  
      <Rating i:nil="true"/>  
      <Resolution>640x480</Resolution>  
      <Size>93239</Size>  
    </MetadataBase>  
    <MetadataBase i:type="MetadataItem">  
      <Date>11/16/2004</Date>  
      <Id>B-376</Id>  
      <Title>Exif_JPEG_422</Title>  
      <TypeName>MetadataItem</TypeName>  
      <Album>[No Keywords]</Album>  
      <AlbumArtist>[Unknown Artist]</AlbumArtist>  
      <Duration i:nil="true"/>  
      <ParentFullPath/>  
      <Rating i:nil="true"/>  
      <Resolution>640x480</Resolution>  
      <Size>106418</Size>  
    </MetadataBase>  
  </Result>  
  <TotalMatches>6</TotalMatches>  
</MetadataResult>  

Error Codes

Error Code Error Message
400 One or more parameters are not valid.
401 Access is denied to the requested resource.
404 The path does not exist.

See Also

Web Service Methods