API Operations for Classes

Summary

Operation Name: Retrieve a Class by Class ID
Relative API Request Path: ~/api/v1/classes/{classID}
HTTP Verb: GET
Description: Retrieve a single Class by Class ID.

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


 

Retrieve a Class by Class ID

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

When retrieving a Class using the API, no special character decoding (e.g., HTML decoding &lt; as < or &gt; as >) is performed. Therefore, please note that the Class Name returned via the API method represents the Class Name as stored within the Issuetrak database. Thus, when retrieving a Class created through the Issuetrak web interface where HTML encoding of the ClassName 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 ReadClassDTO instance.

Response DTO Schema:
ReadClassDTO
{
 ExtensionData (array[KeyValuePair[String,Object]]),
 Metadata (array[KeyValuePair[String,Object]]),
 ClassID: (integer),
 ClassName: (string),
 DisplayOrder: (number),
 IsActive: (boolean)
}
CustomKeyValuePairDataElement 
{
 Key (string),
 Value (object)
}

Request HTTP Verb: GET

Response Status Codes:

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

Response Properties:

  • The Metadata property provides a key / value collection of additional data about the API operation and / or the response body.

Sample Request URL: ~/api/v1/classes/1

Sample Response:
{
 “ExtensionData”: [],
 “Metadata”: [
  {
   “Key”: “APIVersion”,
   “Value”: “12.5”
  },
  {
   “Key”: “QueryDate”,
   “Value”: “2014-12-09T20:19:23.9695584Z”
  }
 ],
 “ClassID”: 11,
 “ClassName”: “General”,
 “DisplayOrder”: 1,
 “IsActive”: false
}

 

Retrieve all Classes

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

When retrieving a Class using the API, no special character decoding (e.g., HTML decoding &lt; as < or &gt; as >) is performed. Therefore, please note that the ClassName returned via the API method represents the ClassName as stored within the Issuetrak database. Thus, when retrieving a Class created through the Issuetrak web interface where HTML encoding of the ClassName 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 ReadClassDTO instance.

Response DTO Schema:
QueryResultsContainer[ReadClassDTO]
{
 IsPageIndexZeroBased (boolean),
 PageIndex (integer),
 CountForPage (integer),
 PageSize (integer),
 TotalCount (integer),
 Collection (Array[ReadClassDTO])
}
ReadClassDTO
{
 ExtensionData (Array[CustomKeyValuePairDataElement]),
 Metadata (Array[CustomKeyValuePairDataElement]),
 ClassID (integer),
 ClassName (string),
 DisplayOrder (number),
 IsActive (boolean)
}
CustomKeyValuePairDataElement
{
 Key (string),
 Value (object)
} 

Request HTTP Verb: GET

Response Status Codes:

  • Success: 200
  • Non-existent Class: 404
Response Properties:
  • 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 TotalCount. 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 ReadClassDTO objects returned.

Sample Request URL: ~/api/v1/classes/

Sample Response:
{
  “IsPageIndexZeroBased”: true,
  “PageIndex”: 0,
  “CountForPage”: 1,
  “PageSize”: 2147483647,
  “TotalCount”: 1,
  “Collection”: [
   {
    "ExtensionData": [],
    "Metadata": [
     {
      "Key": "APIVersion",
      "Value": "12.5"
     },
     {
      "Key": "QueryDate",
      "Value": "2020-12-16T15:05:29.4366741Z"
     }
   ],
   “ClassID”: 1,
   “ClassName”: “General”,
   “DisplayOrder”: 1,
   “IsActive”: false
  }
 ]
}