GenreResource Resource

GET /genres

Returns all genres optionally filtered by one or more available filtering options.

Request Parameters
name type description
genreIds query a String holding one or more genre ids (separated by comma) for which corresponding hierarchy nodes are to be returned.
parentGenreIds query
Response Codes
code condition
200 Genres were returned.
400 One or more required arguments were not provided.
404 The provided genre id does not correspond to an genre.
500 An error occured.
Response Body
media type data type description
application/xml;charset=utf-8 (custom) zero or more SerialGenre.

Example

Request
GET /genres
Content-Type: */*
Accept: application/xml;charset=utf-8

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

                
...
                
              

POST /genres

Creates a genre. Regardless of the provided state of the fields id and updated, these fields will be automatically populated upon creation.

Request Body
media type data type description
application/xml MTGenre (XML) the SerialGenre which is to be created.
Response Codes
code condition
200 The genre was created.
500 An error occured.
Response Body
media type data type description
application/xml;charset=utf-8 (custom) the created SerialGenre.

Example

Request
POST /genres
Content-Type: application/xml
Accept: application/xml;charset=utf-8

                
<genre>
  <id>...</id>
  <name>...</name>
  <parent/>
  <updated>...</updated>
</genre>

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

                
...
                
              

DELETE /genres/{genreId}

Deletes a genre.

Request Parameters
name type description
genreId path a String holding an id which represents the genre which is to be deleted.
Response Codes
code condition
204 The genre was deleted.
404 The genre does not exist.
500 An error occured.

Example

Request
DELETE /genres/{genreId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

PUT /genres/{genreId}

Updates a genre.

Request Parameters
name type description
genreId path a String holding an id which represents the genre which is to be updated.
Request Body
media type data type description
application/xml MTGenre (XML) the SerialGenre which is to be updated.
Response Codes
code condition
200 The genre was updated.
400 The resource ID does not match the payload ID.
404 The genre does not exist.
409 The genre 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 SerialGenre.

Example

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

                
<genre>
  <id>...</id>
  <name>...</name>
  <parent/>
  <updated>...</updated>
</genre>

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

                
...