API Operations for User Types

Summary

Operation Name: Retrieve a User Type by UserTypeID
Relative API Request Path: ~/api/v1/usertypes/{usertypeID}
HTTP Verb: GET
Description: Retrieve a single User Type by User Type ID.

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

Retrieve a User Type by UserTypeID

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

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

Response DTO Schema:

ReadUserTypeDTO
{
 ExtensionData (array[KeyValuePair[String,Object]]),
 Metadata (array[KeyValuePair[String,Object]]),
 “UserTypeID”: 0,
 “UserTypeName”: ”"
}

Request HTTP Verb: GET

Response Status Codes:

  • Success: 200
  • Invalid User Type ID: 400 (Bad Request, e.g., a negative integer is supplied)
  • Non-existent User Type: 404
  • Invalid User Type 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.

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

Sample Response:

{
 “ExtensionData”: [],
 “Metadata”: [
  {
   “Key”: “APIVersion”,
   “Value”: “10.2”
  },
  {
   “Key”: “QueryDate”,
   “Value”: “2015-08-10T17:34:42.1369273Z”
  }
 ],
 “UserTypeID”: 1,
 “UserTypeName”: “Agent”
}

Retrieve all User Types

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

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

Response DTO Schema:

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

Request HTTP Verb: GET

Response Status Codes:

  • Success: 200
  • Non-existent UserType: 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 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 ReadUserTypeDTO objects returned.
  • The ExtensionData property is not implemented in v1 of the API.

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

Sample Response:

{
 “IsPageIndexZeroBased”: true,
 “PageIndex”: 0,
 “CountForPage”: 2,
 “PageSize”: 2147483647,
 “TotalCount”: 2,
 “Collection”: [
  {
   “ExtensionData”: [],
   “Metadata”: [
    {
     “Key”: “APIVersion”,
     “Value”: “10.2”
    },
    {
     “Key”: “QueryDate”,
     “Value”: “2015-08-10T17:37:43.2050323Z”
    }
   ],
   “UserTypeID”: 1,
   “UserTypeName”: “Agent”
  },
  {
   “ExtensionData”: [],
   “Metadata”: [
    {
     “Key”: “APIVersion”,
     “Value”: “10.2”
    },
    {
     “Key”: “QueryDate”,
     “Value”: “2015-08-10T17:37:43.2050323Z”
    }
   ],
   “UserTypeID”: 2,
   “UserTypeName”: “EndUser”
  }
 ]
}