Network API

JSON Network API

The JSON Network Location API can be used to export and update an organization's Network

Making Requests

Requests to KaiNexus Network Location API are sent to different variations of the following URL:

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

GET requests to this URL will export Network information, and PUT requests to this URL will allow you to update existing Network information and add new Locations. 

Check out this article for information on how to use Postman to make API requests. 

Exporting Network Locations

To export a list of all 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=XXXXX
  • Replace XXXXX with the ID of the Network Location

Updating Network Locations

To update multiple 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 this article 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.
    • The API Key in use does not have Quality Administrator permission.
    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.