API Operations for Locations

Summary

Operation Name: Retrieve a Location by Location ID
Relative API Request Path: ~/api/v1/locations/{locationID}
HTTP Verb: GET
Description: Retrieve a single Location by Location ID.

Operation Name: Retrieve all Locations
Relative API Request Path: ~/api/v1/locations
HTTP Verb: GET
Description: Retrieve a collection of currently defined Locations.

Operation Name: Create a Location (Issuetrak 10.3+)
Relative API Request Path: ~/api/v1/locations
HTTP Verb: Post
Description: Create a new location with a specific LocationID.

Operation Name: Retrieve all Locations (Issuetrak 10.3+)
Relative API Request Path: ~/api/v1/locations
HTTP Verb: Put
Description: Update an existing location by specificed LocationID.

Retrieve a Location by Location ID

Description: This API method retrieves an Location from the Issuetrak data store for a specified Location ID. The “locationID” parameter must correspond to an existing Location. If there is no such Location ID, an error message will be returned with an HTTP response status code of 404.

When retrieving an Location using the API, no special character decoding (e.g., HTML decoding &lt; as < or &gt; as >) is performed. Therefore, please note that the LocationName returned via the API method represents the LocationName as stored within the Issuetrak database. Thus, when retrieving an Location created through the Issuetrak web interface where HTML encoding of the LocationName is performed, the API consumer may desire to perform additional client-side decoding.

A successful response will include an HTTP status code of 200 (OK) and a response body containing a serialized ReadLocationDTO instance.

Response DTO Schema:

ReadLocationDTO
{
 ExtensionData (array[KeyValuePair[String,Object]]),
 Metadata (array[KeyValuePair[String,Object]]),
 LocationID": 0,
 LocationName“: ”",
 DisplayOrder": 0
}

Request HTTP Verb: GET

Response Status Codes:

  • Success: 200
  • Invalid Location ID: 400 (Bad Request, e.g., a negative integer is supplied)
  • Non-existent Location: 404
  • Invalid Location ID: 422 (Unprocessable Entity, e.g., a non-numeric value is supplied)

Response DTO Property Notes:

  • The ExtensionData property is not used in version 1 of the API.
  • The Metadata property provides a key/value collection of additional data about the API operation and/or the response body.
  • BREAKING CHANGES from Previous API Versions:
    • The “AutoAssignTo” (string) property has been removed as of Issuetrak API 10.0.

Sample Request URL: ~/api/v1/locations/11

Sample Response:

{
 “ExtensionData”: [],
 “Metadata”: [
  {
   “Key”: “APIVersion”,
   “Value”: “v1”
  },
  {
   “Key”: “QueryDate”,
   “Value”: “2014-12-09T20:19:23.9695584Z”
  }
 ],
 “LocationID”: 11,
 “LocationName”: “Duplicate Ticket”,
 “DisplayOrder”: 0
}

Retrieve all Locations

Description: This API method retrieves a collection of all currently-defined Locations from the Issuetrak data store.

When retrieving an Location using the API, no special character decoding (e.g., HTML decoding &lt; as < or &gt; as >) is performed. Therefore, please note that the LocationName returned via the API method represents the LocationName as stored within the Issuetrak database. Thus, when retrieving an Location created through the Issuetrak web interface where HTML encoding of the LocationName is performed, the API consumer may desire to perform additional client-side decoding.

A successful response will include an HTTP status code of 200 (OK) and a response body containing a serialized collection of ReadLocationDTO instance.

Response DTO Schema:

{
 “IsPageIndexZeroBased”: false,
 “PageIndex”: 0,
 “CountForPage”: 0,
 “PageSize”: 0,
 “TotalCount”: 0,
 “Collection”: [
  {
   “ExtensionData”: [
    “KeyValuePair[String,Object]”
   ],
   “Metadata”: [
    “KeyValuePair[String,Object]”
   ],
   “LocationID”: 0,
   “LocationName”: "",
   “DisplayOrder”: 0
  }
 ]
}

Request HTTP Verb: GET

Response Status Codes:

  • Success: 200
  • Non-existent Location: 404

Response DTO Property Notes:

  • The IsPageIndexZeroBased property value is always true. This property is included for use in future API versions.
  • The PageIndex property value is always 0. This property is included for use in future API versions.
  • The CountForPage property value is always the same as TotalC*o*unt. This property is included for use in future API versions.
  • The PageSize property value is always the maximum value for a signed, 32-bit integer. This property is included for use in future API versions.
  • The TotalCount property value is the number of records returned in the collection.
  • The Collection property is an array containing the ReadLocationDTO objects returned.
  • The ExtensionData property is not implemented in v1 of the API.
  • BREAKING CHANGES from Previous API Versions:
    • The “AutoAssignTo” (string) property has been removed as of Issuetrak API 10.0.

Sample Request URL: ~/api/v1/locations

Sample Response:

{
 “IsPageIndexZeroBased”: true,
 “PageIndex”: 0,
 “CountForPage”: 1,
 “PageSize”: 2147483647,
 “TotalCount”: 1,
 “Collection”: [
  {
   “ExtensionData”: [“KeyValuePair[String,Object]”],
   “Metadata”: [“KeyValuePair[String,Object]”],
   “LocationID”: 0,
   “LocationName”: "",
   “DisplayOrder”: 0
  }
 ]
}

Create a Location

Description: This API method creates a new Location associated with a specific LocationID within the Issuetrak data store. The CreateLocationDTO object conveys the properties of the new Location. Because LocationID values must be unique, the specified LocationID value must not currently exist. If the LocationID currently exists, an error message will be returned with a 400 HTTP status code.

The response code on success will be 201 (Created), and the response body will represent the text value representing the ID of the newly-created Location.

When creating a Location using the API, no special character encoding (e.g., HTML decoding &lt; as < or &gt; as >) is performed.

All string properties have a maximum length of 50 unless specified otherwise.

Response DTO Schema:

CreateLocationDTO {
 LocationID (string),
 LocationName (string),
 Address1 (string),
 Address2 (string),
 City (string),
 State (string),
 Zip (string),
 Country (string),
 Phone (string),
 Phone2 (string),
 Fax (string),
 Email (string),
 ContactPerson (string),
 RegionID (integer),
 IsActive (boolean),
 UserDefined1 (string),
 UserDefined2 (string),
 UserDefined3 (string),
 OrganizationID (integer)
}

Request HTTP Verb: POST

Response Status Codes:

  • Success: 201
  • Invalid Data: 400 (Bad Request, e.g., a negative integer is supplied)
  • Invalid Location DTO: 422 (Unprocessable Entity, e.g., a non-numeric value is supplied)

Response DTO Property Notes:

  • The LocationID property value is required. Maximum length of 25.
  • The Locationname property value is not required.
  • The Address1 property value is not required.
  • The Address2 property value is not required.
  • The City property value is not required.
  • The State property value is not required.
  • The Zip property value is not required.
  • The Country property value is not required.
  • The Phone property value is not required.
  • The Phone2 property value is not required.
  • The Fax property value is not required.
  • The Email property value is not required. Maximum length of 100.
  • The ContactPerson property value is not required.
  • If the RegionID property value is specified, the value must reference an existing, active Region within the Issuetrak application.
  • The IsActive property value is required.
  • The UserDefined1 property value is not required.
  • The UserDefined2 property value is not required.
  • The UserDefined3 property value is not required.
  • If the OrganizationID property value is specified, the value must reference an existing Organization within the Issuetrak application.

Sample Request URL: ~/api/v1/locations

Update a Location

Description: This API method updates an existing Location associated with a specific LocationID within the Issuetrak data store. The UpdateLocationDTO object conveys the properties of the Location. If invalid data are supplied, an error message will be returned with a 400 HTTP status code.

The response code on success will be 200 (OK), and the response body will represent the text value representing the ID of the Location.

When updating a Location using the API, no special character encoding (e.g., HTML decoding &lt; as < or &gt; as >) is performed.

All string properties have a maximum length of 50 unless specified otherwise.

Response DTO Schema:

UpdateLocationDTO {
 LocationID (string),
 LocationName (string),
 Address1 (string),
 Address2 (string),
 City (string),
 State (string),
 Zip (string),
 Country (string),
 Phone (string),
 Phone2 (string),
 Fax (string),
 Email (string),
 ContactPerson (string),
 RegionID (integer),
 IsActive (boolean),
 UserDefined1 (string),
 UserDefined2 (string),
 UserDefined3 (string),
 OrganizationID (integer)
}

Request HTTP Verb: PUT

Response Status Codes:

  • Success: 201
  • Invalid Data: 400 (Bad Request, e.g., a negative integer is supplied)
  • Invalid Location DTO: 422 (Unprocessable Entity, e.g., a non-numeric value is supplied)

Response DTO Property Notes:

  • The LocationID property value is required. Maximum length of 25.
  • The Locationname property value is not required.
  • The Address1 property value is not required.
  • The Address2 property value is not required.
  • The City property value is not required.
  • The State property value is not required.
  • The Zip property value is not required.
  • The Country property value is not required.
  • The Phone property value is not required.
  • The Phone2 property value is not required.
  • The Fax property value is not required.
  • The Email property value is not required.
  • The ContactPerson property value is not required. Maximum length of 100.
  • If the RegionID property value is specified, the value must reference an existing, active Region within the Issuetrak application.
  • The IsActive property value is required.
  • The UserDefined1 property value is not required.
  • The UserDefined2 property value is not required.
  • The UserDefined3 property value is not required.
  • If the OrganizationID property value is specified, the value must reference an existing Organization within the Issuetrak application

Sample Request URL: ~/api/v1/locations