AudioFileResource Resource

POST /audiofiles

Creates an audio file. Regardless of the provided state of the fields id and updated, these fields will be automatically populated upon creation. An audio file can be created by submitting a SerialAudioFile along with (1) a source entity from which audio data should be taken or (2) the audio data which is to be used. See https://www.ietf.org/rfc/rfc2388.txt for more details.

Security Roles Allowed
CreateAlbumAndTrack
Request Parameters
name type description
data formdata a SerialAudioFile which is to be created.
sourceEntity formdata an existing SerialImportableFile from which audio data should be used. Providing this parameter ignores sourceFile, and will use the type of the sourceEntity. Last, the quality will be set to high.
sourceFile formdata audio data for the audio file which is to be created. Providing this parameter ignores sourceEntity.
Request Body
media type data type
multipart/form-data (custom)
Response Codes
code condition
200 The audio file was created.
500 An error occured.
Response Body
media type data type description
application/xml;charset=utf-8 (custom) the created SerialAudioFile.

Example

Request
POST /audiofiles
Content-Type: multipart/form-data
Accept: application/xml;charset=utf-8

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/xml;charset=utf-8

                
...
                
              

DELETE /audiofiles/{audioFileId}

Deletes an audio file.

Security Roles Allowed
DeleteAlbumAndTrack
Request Parameters
name type description
audioFileId path a String holding an id which represents the audio file which is to be deleted.
Response Codes
code condition
204 The audio file was deleted.
404 The audio file does not exist.
500 An error occured.

Example

Request
DELETE /audiofiles/{audioFileId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

PUT /audiofiles/{audioFileId}

Updates an audio file.

Security Roles Allowed
EditAlbumAndTrack
Request Parameters
name type description
audioFileId path a String holding an id which represents the audio file which is to be updated.
Request Body
media type data type description
application/xml MTAudioFile (XML) the SerialAudioFile which is to be updated.
Response Codes
code condition
200 The audio file was updated.
400 The resource ID does not match the payload ID.
404 The audio file does not exist.
409 The audio file has been updated or deleted by another process.
500 An error occured.
Response Body
media type data type description
application/xml;charset=utf-8 (custom) the updated SerialAudioFile.

Example

Request
PUT /audiofiles/{audioFileId}
Content-Type: application/xml
Accept: application/xml;charset=utf-8

                
<audioFile>
  <bitRate>...</bitRate>
  <duration>...</duration>
  <id>...</id>
  <quality>...</quality>
  <sampleRate>...</sampleRate>
  <size>...</size>
  <track>
    <album>
      <comment>...</comment>
      <created>...</created>
      <distribute>...</distribute>
      <id>...</id>
      <library/>
      <number>...</number>
      <status>...</status>
      <title>...</title>
      <updated>...</updated>
    </album>
    <alternativeTitle>...</alternativeTitle>
    <agreementRelationships>
      <agreementRelationship>
        <agreement/>
        <id>...</id>
        <track/>
        <value>...</value>
        <updated>...</updated>
      </agreementRelationship>
    </agreementRelationships>
    <audioFiles>
      <audioFile/>
    </audioFiles>
    <bpm>...</bpm>
    <created>...</created>
    <description>...</description>
    <genreRelationships>
      <genreRelationship>
        <genre/>
        <id>...</id>
        <track/>
        <updated>...</updated>
      </genreRelationship>
    </genreRelationships>
    <hierarchyNodeRelationships>
      <hierarchyNodeRelationship>
        <created>...</created>
        <hierarchyNode/>
        <id>...</id>
        <updated>...</updated>
      </hierarchyNodeRelationship>
    </hierarchyNodeRelationships>
    <id>...</id>
    <keywordRelationships>
      <keywordRelationship>
        <id>...</id>
        <keyword/>
        <track/>
        <updated>...</updated>
      </keywordRelationship>
    </keywordRelationships>
    <number>...</number>
    <parent/>
    <publicDomain>...</publicDomain>
    <shares>
      <share>
        <id>...</id>
        <role>...</role>
        <stakeholder/>
        <track/>
        <value>...</value>
        <updated>...</updated>
      </share>
    </shares>
    <status>...</status>
    <title>...</title>
    <token>...</token>
    <version>...</version>
    <versioned>...</versioned>
    <versionType>...</versionType>
    <year>...</year>
    <updated>...</updated>
  </track>
  <type>...</type>
  <updated>...</updated>
</audioFile>

                
              
Response
HTTP/1.1 200 OK
Content-Type: application/xml;charset=utf-8

                
...