Retrieve the Metadata of Media Items

 

Updated: October 9, 2012

Applies To: Windows Server 2012 Essentials

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

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 ValueMeaning
musicAudio clips.
photoPhotos.
videoVideo clips.

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

Grouping Method ValueApplicable Media TypesMeaning
albummusicGroup by album.
albumartistmusicGroup by album artist.
allmusic, photo, or videoGroup by media type.
artistmusicGroup by artist.
datephotoGroup by date.
folderphoto or videoGroup by folder.
genremusicGroup by musical genre (style).
playlistmusicGroup by playlist.
ratingmusicGroup by rating.

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

Metadata Property TypeMeaning
dateSort by date.
defaultSort by the default metadata property type in the web service.
titleSort by title.

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

Sort Order ValueMeaning
ASCSort in ascending order.
defaultSort in the default sort order.
DESCSort 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.

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  

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 CodeError Message
400One or more parameters are not valid.
401Access is denied to the requested resource.
404The path does not exist.

Web Service Methods

Show: