Attribute REST Services

List all attributes

Method

GET
URL/rest/jip-api/1.0/attribute/list.json
Sample Response
[
  {
    "attributeName": "CPU",
    "id": 10
 },
  {
    "attributeName": "Computer Name",
    "id": 8
 },
  {
    "attributeName": "Date of Purchase",
    "id": 17
 },
  {
    "attributeName": "First Name",
    "id": 1
 },
  {
    "attributeName": "Gender",
    "id": 4,
    "values": [
      {
        "id": 4,
        "sortOrder": 0,
        "attributeValue": "Male"
 },
      {
        "id": 5,
        "sortOrder": 0,
        "attributeValue": "Female"
 }
    ]
  },
  {
    "attributeName": "IP",
    "id": 6
 },
  {
    "attributeName": "JIRA User",
    "id": 9
 },
  {
    "attributeName": "Keyboard",
    "id": 14,
    "values": [
      {
        "id": 6,
        "sortOrder": 0,
        "attributeValue": "Standard Windows Q"
 },
      {
        "id": 7,
        "sortOrder": 1,
        "attributeValue": "Wireless"
 },
      {
        "id": 8,
        "sortOrder": 2,
        "attributeValue": "Multimedia"
 }
    ]
  },
  {
    "attributeName": "Last Name",
    "id": 2
 },
  {
    "attributeName": "License Key",
    "id": 12
 },
  {
    "attributeName": "MAC Address",
    "id": 16
 },
  {
    "attributeName": "Memory",
    "id": 11
 },
  {
    "attributeName": "Model",
    "id": 18
 },
  {
    "attributeName": "Monitor",
    "id": 13
 },
  {
    "attributeName": "Mouse",
    "id": 15,
    "values": [
      {
        "id": 9,
        "sortOrder": 0,
        "attributeValue": "Standard Mouse"
 },
      {
        "id": 10,
        "sortOrder": 1,
        "attributeValue": "Wireless Mouse"
 },
      {
        "id": 11,
        "sortOrder": 2,
        "attributeValue": "Optical Mouse"
 },
      {
        "id": 12,
        "sortOrder": 3,
        "attributeValue": "Bluetooth Mouse"
 }
    ]
  },
  {
    "attributeName": "Organization",
    "id": 3,
    "values": [
      {
        "id": 3,
        "sortOrder": 0,
        "attributeValue": "Customer Care"
 },
      {
        "id": 2,
        "sortOrder": 0,
        "attributeValue": "System Department"
 },
      {
        "id": 1,
        "sortOrder": 0,
        "attributeValue": "Software Department"
 }
    ]
  },
  {
    "attributeName": "Serial Number",
    "id": 7
 },
  {
    "attributeName": "Server Name",
    "id": 5
 },
  {
    "attributeName": "Storage Type",
    "id": 19,
    "values": [
      {
        "id": 13,
        "sortOrder": 0,
        "attributeValue": "FATA"
 },
      {
        "id": 14,
        "sortOrder": 1,
        "attributeValue": "SATA"
 },
      {
        "id": 15,
        "sortOrder": 2,
        "attributeValue": "SSD"
 }
    ]
  }
]

List single attribute

Method

GET
URL/rest/jip-api/1.0/attribute/[attributeId].json


Sample Response
{
  "attributeName": "Organization",
  "attributeType": "ListBox",
  "id": 3,
  "values": [
    {
      "id": 3,
      "sortOrder": 0,
      "attributeValue": "Customer Care"
    },
    {
      "id": 2,
      "sortOrder": 0,
      "attributeValue": "System Department"
    },
    {
      "id": 1,
      "sortOrder": 0,
      "attributeValue": "Software Department"
    }
  ]
}
Possible Error Response
{
  success:
  false,
  message:
  "Could not find form with id:[id]"
}

Create a new attribute

Method

POST
URL/rest/jip-api/1.0/attribute.json


Request Body
{
  "attributeName": "Storage Type",
  "attributeType": "DropdownList",
  "values": [
    {
      "sortOrder": 0,
      "attributeValue": "FATA"
    },
    {
      "sortOrder": 1,
      "attributeValue": "SATA"
    },
    {
      "sortOrder": 2,
      "attributeValue": "SSD"
    }
  ]
}
Request Body(for non-multi valued attributes)
{
  "attributeName": "Test Text Sample Attribute",
  "attributeType": "Test Text",
  "values": [ ]
}
Success Message
{
    "success": true,
    "message": "Attribute[Test Text Sample Attribute] created successfully"
}
Possible Failure Messages
{
  "success": false,
  "message": "[attributeValue] should not be empty"
}

{
  "success": false,
  "message": "Please define at least one attribute value for type [DropdownList]"
}

Update attribute

Method

PUT
URL/rest/jip-api/1.0/attribute/[attributeId].json


Request Body(for multi value types (e.g. DropdownList))
{
  "attributeName": "Storage Type",
  "attributeType": "DropdownList",
  "values": [
    {
      "sortOrder": 0,
      "attributeValue": "FATA2"
    },
    {
      "sortOrder": 1,
      "attributeValue": "SATA2"
    },
    {
      "sortOrder": 2,
      "attributeValue": "SSD2"
    }
  ]
}
Request Body(for single value for the attributes that have not multiple values (e.g. Textbox))
{
    "attributeName": "CPU"
}
Success Message
{
  "success": true,
  "message": "Attribute[89] updated successfully"
}
Possible Failure Messages
{
  "success": false,
  "message": "attributeType should be one of [DropdownList,ListBox,ListBoxMultiple,Text,TextArea,RadioButtonList,CheckboxList,DatePicker,DatetimePicker,UserPicker]"
}
{
  "success": false,
  "message": "attributeName or attributeType should not be empty"
}
{
  "success": false,
  "message": "Could not find attribute with id:190"
}

Delete attribute

Method

DELETE
URL/rest/jip-api/1.0/attribute/[attributeId].json


Success Message
{
  "success": true
  "message": "Attribute[attributeId] deleted successfully"
}
Possible Failure Message
{
  "success": false
  "message": "Attribute[attributeId] could not be found"
}