Setting and Updating Metadata

Introduced into R2.1, the MediaItem API supports the ability to set and update metadata name/value pairs on items that exist within your account using the updateMediaItemFields. The parameters required are:

Account Name (username)
The username you use to log in to the yospaceCDS Content Management Console
Password (password)
The password associated with the username you use to log in to the yospaceCDS Content Management Console
GUID (guid)
The original GUID of the item to set or update metadata. If the item was ingested via the MediaItem API, then construct this field as contentProviderId-mediaItemId. An example: 234820-3928391. Ask support@yospace.com for your Content Provider ID.
Input Configuration ID (inputConfigurationId)
The Input Configuration ID on which the item was originally ingested. If the item was ingested via the MediaItem API, then use the value -1.
Media Item Field (mediaItemFields)
Field Name fieldName
The name of the field to be set or updated.
Field Value value
The value to be set or updated.

An example request:

<soap:Envelope
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
  <ns2:updateMediaItemFields
       xmlns:ns2="http://www.yospace.com/tundra/MediaItemManagement/">
    
    <username>petshow</username>
    <password>Wf</password>
    <guid>2134712-2131019</guid>
    <inputConfigurationId>-1</inputConfigurationId>
    
    <mediaItemFields>
       <fieldName>title</fieldName>
       <value>My new title</value>
    </mediaItemFields>
    
    <mediaItemFields>
       <fieldName>keywords</fieldName>
       <value>My new keywords</value>
    </mediaItemFields>
  
  </ns2:updateMediaItemFields>
 </soap:Body>
</soap:Envelope> 

Possible status code (with descriptions) are as follows:

  • 200, OK
  • 601, AUTHENTICATION_FAIL
  • 602, BAD_CONTENT_GROUP_ID
  • 604, USER_DOES_NOT_OWN_RESOURCE
  • 606, NO_SUCH_MRSS_MEDIA_ITEM (the Media Item does not have a metadata field record associated with it)
  • 609, FIELD_SETTING_ERRORS
  • 599, GENERAL_ERROR

The response will contain a status of each field that was set along with its status code. The status codes that can be associated with a field are:

  • 605, NO_SUCH_FIELD_DEFINITION (the field name you have used is not valid for your metadata schema)
  • 607, EXCEPTION_SETTING_FIELD (the value you supplied was not permitted)
  • 608, FIELD_VALUE_SET_OK

An example response:

<soap:Envelope
   xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
     
    <ns2:updateMediaItemFieldsResponse
         xmlns:ns2="http://www.yospace.com/tundra/MediaItemManagement/">
       
      <statusCode>200</statusCode>
      <statusDescription>OK</statusDescription>
      
      <mediaItemFields>
         <fieldName>title</fieldName>
         <statusCode>608</statusCode>
         <statusDescription>FIELD_VALUE_SET_OK</statusDescription>
      </mediaItemFields>
      
      <mediaItemFields>
         <fieldName>keywords</fieldName>
         <statusCode>605</statusCode>
         <statusDescription>NO_SUCH_FIELD_DEFINITION</statusDescription>
      </mediaItemFields>
       
    </ns2:updateMediaItemFieldsResponse>
  </soap:Body>
</soap:Envelope>