Powered by Temper

JSON Network API

The JSON Network Location API can be used to export and import (create, update, delete) an Organization's Network Locations using JSON format.

 

To export Network Locations, execute a GET request to this URL:

https://api.kainexus.com/api/public/v1/json/networkLocationList

To export an individual Network Location, execute a GET request to this URL:

https://api.kainexus.com/api/public/v1/json/networkLocation?id=XYZ

(where XYZ is the ID of the Network Location) 

 

To update a list of Network Locations, execute a PUT request to this URL:

https://api.kainexus.com/api/public/v1/json/networkLocationList

To update an individual Network Location, execute a PUT request to this URL:

https://api.kainexus.com/api/public/v1/json/networkLocation

 

Example Curl Script:

curl -s -D - --user api:APIKEY https://api.kainexus.com/api/public/v1/json/networkLocationList -d @FILEPATH -X PUT -H "Content-Type: application/json"

 See The API Module for more information on how to configure API keys.

 

Things to note:

  1. If an ID is provided, the existing Network Location with that ID will be updated.
  2. If an ID is not provided, and a Network Location exists with the name specified, the network location with that name will be updated.
  3. If no ID is specified and no Location exists with the specified name, a new Network Location will be created.
  4. The Parent Location can be referenced by name or ID.
  5. The Level Type can be referenced by name or ID. 
  6. To delete a Network Location, include "delete": true in the request

Example JSON format for a list of Network Locations:

{
"items": [
{
"id": 5,
"name": "KaiNexus Corporation",
"levelType": {
"id": 4,
"name": "System"
}
},
{
"id": 29,
"name": "Corporate",
"levelType": {
"id": 1,
"name": "Department"
},
"parent": {
"id": 5,
"name": "KaiNexus Corporation"
}
},
{
"id": 16,
"name": "Accounting",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
},
{
"id": 15,
"name": "Customer Experience",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
},
{
"id": 3,
"name": "Development",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
},
{
"id": 30,
"name": "Marketing",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
},
{
"id": 32,
"name": "Product Management",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
},
{
"id": 4,
"name": "Sales",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
}
]
}

Example JSON format for an individual Network Location (id=16):

{
"item": {
"id": 16,
"name": "Accounting",
"levelType": {
"id": 12,
"name": "Administration"
},
"parent": {
"id": 29,
"name": "Corporate"
}
}
}

 

Failed updates will return an error containing a code and message that can be referenced below:

Error Code Explanation
NOT_FOUND  If receiving an error of NOT_FOUND, this could be due to one of the following:
  • Could not find a Network Location by ID.
  • A Parent type was not found by ID or name
  • A Level Type was not found by ID or name
EMPTY  If receiving an error of EMPTY, this could be due to one of the following:
  • The JSON is empty.
  • The name is blank.
SIZE  If receiving an error of SIZE, this could be due to one of the following:
  • A field exceeded its minimum or maximum size.
NOT_EMPTY

If receiving an error of NOT_EMPTY, this could be due to one of the following:

  • You are deleting a Network Location that is the parent of another Network Location
  • You are deleting a Network Location that has users currently assigned to it.
ACCESS_DENIED  If receiving an error of ACCESS_DENIED, this could be due to one of the following:
  • The API Key in use does not have Quality Administrator permission.

 

 

Have more questions? Submit a request