Data/descriptor-api/v1.1/descriptor/music-moods

Jump to: navigation, search

Descriptor/MusicMoods

Returns the moods in music that are recognized by Rovi Music.

Syntax

descriptor/musicmoods?apikey=apikey&sig=sig [&moodids=moodids] [&format=format] [&country=country] [&language=language]

Request Example 1

Request all moods that are recognized by Rovi Music.

Request Example 2

Request the mood for mood ID XA0000000931.

Request Example 3

Request the mood for mood ID XA0000000931 in an XML response.

Request Parameters

Sort none.gif  Click to re-sort

Parameter Required Description
apikey Yes Access code that authorizes your request for data from Rovi.
sig Yes A calculated, 32-hex-digit authorization code. To perform the calculation, execute the MD5 function on the concatenation of the following three ASCII strings:
  • Your API key.
  • The secret key you received with your API key.
  • The Unix time. Unix time is a timestamp supported in most development environments, and is generally defined as the number of seconds since January 1, 1970 00:00:00 GMT.

Express the alpha hex digits as lower case.

Perform the calculation at the time of each request to be sure it's within a five-minute window of the server time. If you're testing the call in a browser, use our online signature generator to perform the calculation.

country No Country the language parameter applies to. The current release of the API supports only US.
format No Format of the returned data: json or xml. The default is JSON.
language No Language of the response data. This request supports only en (English).
moodids No A specific mood ID you want information about.

To specify multiple mood IDs, specify a comma-separated list, like this: moodids=XA0000000933,XA0000000701,XA0000000704.

Response

Response Header

ResponseTypeDescription
buildstringThe software release level of the API.
codeintegerHTTP status code. See the status field for the text part of the code.
durationintegerServer processing time in milliseconds. The difference between startTime and endTime.
endTimestringWhen the server sent the response (UTC time).
messagesMessage [ ]Elements of a multiple HTTP response status message.
parametersparametersThe parameters that were included in the request.
serverNamestringName of the server that processed the request.
startTimestringWhen the server received the request (UTC time).
statusstringText part of the HTTP status code, which is shown in the code field.
viewviewSummary of items returned in a list of items.

Response for Descriptor/MusicMoods

ResponseTypeDescription
moods Mood [ ] The moods requested.

JSON Response Example

Here's the response to Request Example 2, which asks for the mood for mood ID XA0000000931. The response is formatted with extra spaces and carriage returns to make it easy to read.
Requested with http://api.rovicorp.com/data/v1.1/descriptor/musicmoods?apikey=apikey&sig=sig&
moodids=XA0000000931
.
{
    status: "ok",
    code: 200,
    messages: null,
    build: "1.0",
    parameters: {
        apiKey: "apikey",
        id: "XA0000000931"
    },
    view: {
        total: 1
    },
    serverName: "ubuntu",
    startTime: "2012-10-26T01:16:08Z",
    endTime: "2012-10-26T01:16:11Z",
    duration: 3857,
    moods: [
        {
            id: "XA0000000931",
            name: "Acerbic"
        }
    ]
}

XML Response Example

Here's the response to Request Example 3, which asks for the mood for mood ID XA0000000931 in an XML response.
Requested with http://api.rovicorp.com/data/v1.1/descriptor/musicmoods?apikey=apikey&sig=sig&
moodids=XA0000000931&format=xml
.
<Moods xmlns="com.rovicorp.metadataservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <status>ok</status>
    <code>200</code>
    <messages i:nil="true"/>
    <build>1.0</build>
    <parameters>
        <apiKey>apikey</apiKey>
        <id>XA0000000931</id>
        <format>xml</format>
    </parameters>
    <view>
    <total>1</total>
    </view>
    <serverName>ubuntu</serverName>
    <startTime>2012-10-26T01:21:04Z</startTime>
    <endTime>2012-10-26T01:21:07Z</endTime>
    <duration>2878</duration>
    <moods>
      <Mood>
         <id>XA0000000931</id>
         <name>Acerbic</name>
      </Mood>
    </moods>
</Moods>


See Also

↑ Top

 
 
Personal tools