TerritoryResource Resource

GET /territories

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

Request Parameters
name type description
parentTerritoryIds query a String holding one or more parent territory ids (separated by comma) for which corresponding territories are to be returned.
territoryIds query a String holding one or more territory ids (separated by comma) for which corresponding territories are to be returned.
Response Codes
code condition
200 Zero or more territories were returned
500 An error occured.
Response Body
media type data type description
application/xml;charset=utf-8 (custom) zero or more SerialTerritory.

Example

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

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

                
...
                
              

POST /territories

Creates a territory. 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 MTTerritory (XML) the SerialTerritory which is to be created.
Response Codes
code condition
200 The territory was created.
500 An error occured.
Response Body
media type data type description
application/xml;charset=utf-8 (custom) the created SerialTerritory.

Example

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

                
<territory>
  <code>...</code>
  <country>...</country>
  <name>...</name>
  <weight>...</weight>
  <id>...</id>
  <updated>...</updated>
</territory>

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

                
...
                
              

DELETE /territories/{territoryId}

Deletes a territory.

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

Example

Request
DELETE /territories/{territoryId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

PUT /territories/{territoryId}

Updates a territory.

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

Example

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

                
<territory>
  <code>...</code>
  <country>...</country>
  <name>...</name>
  <weight>...</weight>
  <id>...</id>
  <updated>...</updated>
</territory>

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

                
...