Attribute Value API

JSON Attribute Value API

Use API to create, update, and delete Attribute Values

Attribute Values are the various selections a User can make when they click on an Attribute. Organizations have a wide variety of Attributes used on their Templates and may need to frequently update Attribute Values in the Admin section of KaiNexus. This can be a time-consuming process depending on the number and complexity of Attribute Values. 

Example of an Attribute with four Attribute Values in the Admin Section of KaiNexus

JSON Attribute Value API helps you automate the creation, upkeep, and removal of Attribute Values to save maintenance time. 

Ofie Profile PicPro Tip: If you are unfamiliar with KaiNexus API, then we recommend learning more about our API capabilities in this article

What can Attribute Value API do? 

Export

Use Attribute Value API to export a list of your organization's Attribute Values in JSON format. Exporting in JSON format is useful when you want to:

  • Reference the correct JSON format before creating or updating Attribute Values
  • Transfer Attribute Value information to another application. 

Update 

You can use Attribute Value API to update your organization's Attribute Values. This includes changing Attribute Value information such as folder, description, name, Location, and more. 

Create 

You can use Attribute Value API to create new Attribute Values for your organization. This is useful when you want to add new Values to an existing Attribute. 

Ofie Profile PicWarning: You cannot create new Attributes through API. There must be an existing Attribute in KaiNexus to create new Attribute Values. 

How does it work? 

KaiNexus provides an endpoint where you can access Attribute Value information. To make a call, you will need an API Key and an API tool. 

Ofie Profile PicPro Tip: We recommend using Postman for your API calls. It's easy to use and works well with KaiNexus API. 

Authentication

API Keys are used for authenticating calls to KaiNexus API. Check out this article for instructions on how you can find your organization's API Keys and copy them to your clipboard. 

If you are using Postman, select Basic Auth as the Authorization Type. Enter "api" as the username and the API Key as the password. 

Exporting Attribute Values

After authentication, you can make your first Attribute Value API call. We recommend starting with a GET request to retrieve a list of Attribute Values in JSON format. This will be useful as a reference of the correct JSON format when updating or creating Attribute Values.

Make the GET request to the following URL:

api.kainexus.com/api/public/v1/json/itemAttributeValueList
  • This call will retrieve information for all Attribute Values in your organization in JSON format. 

Exporting specific Attribute Values

If you rather export a specific Attribute Value instead of all Attribute Values in your organization, you must know the ID of the Attribute Value.

The easiest way to find the ID for an Attribute Value is by navigating to Admin > Organization > Attributes in KaiNexus. Select an Attribute to see its Attribute Values. 

  • Hover your mouse over a column header. A dropdown arrow will appear. 
  • Select the dropdown arrow 
  • Select Columns
  • Select the checkbox next to ID to add an ID column to the list of Attributes. You will now see the unique identifier for each Attribute Value in the list. 

When you have the ID, you can export a specific Attribute Value in JSON format by executing a GET request to the following URL: 

api.kainexus.com/api/public/v1/json/itemAttributeValue?id=XXXXX
  • Replace XXXXX with the Attribute Value ID

Updating or Creating Attribute Values

After you have exported an Attribute Value in JSON format, you can use that code as a reference to update or create new Attribute Values. To update or create a new Attribute Value, execute a  PUT request to the following URL:

api.kainexus.com/api/public/v1/json/itemAttributeValueList

The API will recognize if the Attribute Value already exists or if a new one needs to be created.

  • If an ID is provided in the body of your code, the existing Attribute Value with that ID will be updated.
  • If an ID is not provided in the body of your code and an Attribute Value exists with the name specified, the Attribute Value with that name will be updated.
  • If no ID is specified in the body of your code and no Attribute Value exists with the specified name, a new Attribute Value will be created.

Ofie Profile PicPro Tip: To delete an Attribute Value, include "delete":true in the request. 

Example JSON format

{
  "item": {
      "id": 305,
      "name": "High",
      "description": "High priority projects require immediate attention.",
      "glyphIcon": "fas fa-arrow-up",
      "color": "ff0000",
      "type": {
          "id": 81,
          "name": "Priority"
      },
      "rank": 2.0,
       "includeNote": true,
       "requireNote": false,
       "archived": false,
      "locations": [
          {
              "id": 557,
              "name": "Engineering"
          }
      ],
      "groups": [],
       "folder": false
   }

Here is a table explaining which KaiNexus element each Key:Value pair represents:

Key Value
id The ID of the Attribute Value
name The name of the Attribute Value
description The description that appears as a tooltip when users hover over the Attribute Value
glyphIcon The icon associated with the Attribute Value
color The hexcode for the color of the Attribute Value's icon
type id The Attribute's ID.
type name The Attribute's name.
rank The order Attribute Values appear in
includeNote True / False status of the Include Note checkbox being selected
requireNote True / False status of the Require Note checkbox being selected
archived True / False status of the Attribute Value being archived
location id The ID of the Network Location assigned to the Attribute Value
location name The name of the Network Location assigned to the Attribute Value
groups The Group the Attribute Value is assigned. Empty brackets show the Attribute Value is not assigned a Group. 
folder True/False status of whether the Attribute Value is a folder
parent Name of the folder the Attribute Value is located within