API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

A Company Tree is a representation of how a Company is structured and is used to:

To learn more about Company Trees, see Company Tree.

Company Relationships

A Company Relationship describes the interaction between a Company and a Manufacturer, Supplier, Partner, Company Tree Node, etc.

Depending on the type of Relationship, the identifier for each Entity may appear in the Source or Destination field.

See the table below for a list of legal relationships and where the identifier of each entity will be placed in the resource.

Name Description Source Destination
Company-Group A Group in the first level of a Company Tree for the Company Company Group
Company-Location A Location in the first level of a Company Tree for the Company Company Location
Company-Division A Division in the first level of a Company Tree for the Company Company Division
Company-Supplier Supplier for the Company Supplier Company
Company-Carrier Carrier for the Company Carrier Company
Company-Partner Partner for the Company Partner Company

ENDPOINTS

Sandbox: https://entitymanagerdemo.iqmetrix.net/v1
Production: https://entitymanager.iqmetrix.net/v1

RESOURCES

Company

{
    "Id": 14146,
    "Name": "Kentel Corp",
    "DisplayName": "Kentel Corp",
    "Description": "Wireless accessories provider with store locations all across the globe.",
    "Roles": [
        {
            "Name": "Company"
        }
    ],
    "ClientEntityId": "123",
    "CreatedUtc": "2015-05-20T23:06:29.7700813Z",
    "LastModifiedUtc": "2015-05-20T23:06:29.7700813Z",
    "Attributes": {},
    "Logo": {
        "Id": "d22291d9-db1d-45e2-ab60-32ac9c145323",
        "Name": "globe-rocket.jpg",
        "Height": 341,
        "Href": "https://amsdemostorage.blob.core.windows.net/assets/d22291d9-db1d-45e2-ab60-32ac9c145323.jpg",
        "Md5Checksum": "d2d0b491ad3eecd9d8c3dabb0610197d",
        "MimeType": "image/jpeg",
        "Width": 450
    },
    "Relationships": [
        {
            "Id": 6267,
            "Source": 14146,
            "Destination": 14147,
            "CreatedUtc": "2015-11-20T18:22:10.931Z",
            "Version": 1
        }
    ],
    "SortName": "kentel corp",
    "Version": 1
}
Name Description  
Id (Integer) Unique identifier  
Name (String(250)) Name  
DisplayName (String(250)) Display Name  
Description (String(255)) Description  
Roles (Array[object]) The value must be Company  
Roles.Name (String) Name  
ClientEntityId (String) Identifier in an external system  
CreatedUtc (DateTime) Created date in UTC  
LastModifiedUtc (DateTime) Last modified date in UTC  
Attributes (Object) Set of key-value pairs that contain extra data  
Logo (Asset) A reference to an image  
Relationships (Array[Relationship]) See Company Relationships  
SortName (String) A string used for sorting  
Version (Integer) Latest revision number  
CorrelationId (String) Reserved for internal use  
Role (String) Reserved for internal use  
TypeId (Integer) Reserved for future use  

Relationship

{
    "Id": 6267,
    "Source": 14146,
    "Destination": 14147,
    "CreatedUtc": "2015-11-20T18:22:10.931Z",
    "Version": 1
}
Name Description  
Id (Integer) Identifier for the relationship  
Source (Integer) Identifier for a Vendor, Carrier, Partner or Company  
Destination (Integer) Identifier for a Group, Location, Division or Company  
CreatedUtc (DateTime) Date the relationship was formed, in UTC  
Version (Integer) Latest revision number  
Definition (Integer) Reserved for internal use  

Asset

{
    "Id": "d22291d9-db1d-45e2-ab60-32ac9c145323",
    "Name": "globe-rocket.jpg",
    "Height": 341,
    "Href": "https://amsdemostorage.blob.core.windows.net/assets/d22291d9-db1d-45e2-ab60-32ac9c145323.jpg",
    "Md5Checksum": "d2d0b491ad3eecd9d8c3dabb0610197d",
    "MimeType": "image/jpeg",
    "Width": 450
}
Name Description
Id (GUID) Unique identifier
Name (String) File name
Height (Integer) Height in pixels
Href (String) URL that points to an actual file where the digital asset is stored
Md5Checksum (String) String that can be used for upload integrity checks or comparing two assets
MimeType (String) Mime type
Width (Integer) Width in pixels

CompanyTree

Your Company Tree is a hierarchial representation of how your Company is structured, including the root Company, Groups, Divisions and Locations.

To learn more about Company Trees, see Company Tree.

{
    "Id": 14146,
    "Name": "Kentel Corp",
    "ClientEntityId": "123",
    "DisplayName": "Kentel Corp",
    "Description": "Wireless accessories provider with store locations all across the globe.",
    "Role": "Company",
    "Nodes": [
        {
            "Id": 14159,
            "Name": "T-hut Wireless",
            "ClientEntityId": "123",
            "DisplayName": "T-hut Wireless",
            "Description": "Division of Kiosks",
            "Role": "Division",
            "Nodes": []
        }
    ]
}
Name Description
Id (Integer) Company identifier
Name (String(250)) Company name
ClientEntityId (String) Identifier in an external system
DisplayName (String(250)) Display Name
Description (String(255)) Description
Role (String) Role
Nodes (Array[CompanyTreeNode]) The Company Tree hierarchy made up of Nodes

CompanyTreeNode

CompanyTreeNodes are used to represent hierarchy in a Company Tree. A Node can represent a Group, Division, Location or device.

{
    "Id": 14159,
    "Name": "T-hut Wireless",
    "ClientEntityId": "123",
    "DisplayName": "T-hut Wireless",
    "Description": "Division of Kiosks",
    "Role": "Division",
    "Nodes": []
}
Name Description
Id (Integer) Identifier
Name (String(250)) Name
ClientEntityId (String) Identifier in an external system
DisplayName (String(250)) Display Name
Description (String(255)) Description
Role (String) Role, possible values include: Company, Group, Division and Location
Nodes (Array[object]) Children

Location

A Location is a physical or virtual presence that may hold inventory or process transactions.

{
    "Id": 14202,
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "CreatedUtc": "2015-02-26T00:03:01.372Z",
    "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "Relationships": [],
    "SortName": "dufferin mall",
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    },
    "Version": 13
}
Name Description  
Id (Integer) Unique identifier  
Name (String(250)) Name  
DisplayName (String(250)) Display Name  
Description (String(255)) Description  
Roles (Array[object]) The Role of this Location, the value must be Location  
Roles.Name (String) Name  
CreatedUtc (DateTime) Created date in UTC  
LastModifiedUtc (DateTime) Last modified date in UTC  
Area (Area) Measurement of floor space  
Address (Address) Address  
Attributes (Object) Set of key-value pairs that contain extra data  
ClientEntityId (String) Identifier in an external system  
Contacts (Array[Contact]) Contact information  
Geography (object) Geographic coordinates of this Location  
Geography.Longitude (Decimal) Longitude, must be between -180 and 180  
Geography.Latitude (Decimal) Latitude, must be between -90 and 90  
Relationships (Array[object]) Relationship information, such as the parent node in the Company Tree  
SortName (String) A string used for sorting  
StoreHours (StoreHours) Store hours for this Location  
StorePhoneNumbers (Array[object]) Phone numbers  
StorePhoneNumbers.Description (String) Description  
StorePhoneNumbers.Number (String) Phone number  
StorePhoneNumbers.Extension (String) Extension  
TimeZone (object) Timezone information for the Location  
Id (String) Identifier. For a list of acceptable values, see Getting All Time Zones  
DaylightSavingTimeEnabled (Boolean) A flag to indicate if the Time Zone observes Daylight Savings Time  
Version (Integer) Latest revision number  
CorrelationId (String) Reserved for internal use  
LocationType (String) Reserved for future use  
LocationSubType (String) Reserved for future use  
Logo (Object) Reserved for internal use  
Role (String) Reserved for internal use  
TypeId (Integer) Reserved for future use  

Division

Division, as well as Groups, serve as generic buckets clients can use to organize the company tree. Divisions could be used to represent sub-brand or sub-company of a main company.

To learn more about Divisions, see Divisions.

{
    "Id": 14159,
    "Name": "T-hut Wireless",
    "DisplayName": "T-hut Wireless",
    "Description": "Division of Kiosks",
    "Roles": [
        {
            "Name": "Division"
        }
    ],
    "ClientEntityId": "187",
    "CreatedUtc": "2015-05-20T23:06:29.7700813Z",
    "LastModifiedUtc": "2015-05-20T23:06:29.7700813Z",
    "Attributes": {},
    "Logo": {
        "Id": "d22291d9-db1d-45e2-ab60-32ac9c145323",
        "Name": "globe-rocket.jpg",
        "Height": 341,
        "Href": "https://amsdemostorage.blob.core.windows.net/assets/d22291d9-db1d-45e2-ab60-32ac9c145323.jpg",
        "Md5Checksum": "d2d0b491ad3eecd9d8c3dabb0610197d",
        "MimeType": "image/jpeg",
        "Width": 450
    },
    "Relationships": [],
    "SortName": "t-hut wireless",
    "Version": 1
}
Name Description  
Id (Integer) Unique identifier  
Name (String(250)) Name  
DisplayName (String(250)) Display Name  
Description (String(255)) Description  
Roles (Array[object]) The value must be Division  
Roles.Name (String) Name  
ClientEntityId (String) Identifier in an external system  
CreatedUtc (DateTime) Created date in UTC  
LastModifiedUtc (DateTime) Last modified date in UTC  
Attributes (Object) Set of key-value pairs that contain extra data  
Logo (Asset) A reference to an image  
Relationships (Array[object]) Relationship information, such child Locations, Suppliers and Carriers  
SortName (String) A string used for sorting  
Version (Integer) Latest revision number  
CorrelationId (String) Reserved for internal use  
Role (String) Reserved for internal use  
TypeId (Integer) Reserved for future use  

Group

Managerial or geographical groupings.

To learn more about Groups, see Group.

{
    "Id": 14166,
    "Name": "Toronto",
    "DisplayName": "Toronto",
    "Description": "Group within Ontario",
    "Roles": [
        {
            "Name": "Group"
        }
    ],
    "ClientEntityId": "187",
    "CreatedUtc": "2015-05-20T23:06:29.7700813Z",
    "LastModifiedUtc": "2015-05-20T23:06:29.7700813Z",
    "Attributes": {},
    "Logo": {
        "id": "09fe1ee4-42b1-43a6-bd80-cd2bda21e90a",
        "name": "49ebd282-4161-4a9d-9b40-a5a20d144b6f.png",
        "height": 1024,
        "href": "https://amsdemo.iqmetrix.net/images/09fe1ee4-42b1-43a6-bd80-cd2bda21e90a.png",
        "md5Checksum": "1f88a2813737aa0019a63069586055ed",
        "mimeType": "image/png",
        "width": 502,
        "success": true,
        "sizeInBytes": 1227661
    },
    "Relationships": [],
    "SortName": "toronto",
    "Version": 1
}
Name Description  
Id (Integer) Unique identifier  
Name (String(250)) Name  
DisplayName (String(250)) Display Name  
Description (String(255)) Description  
Roles (Array[object]) The value must be Group  
Roles.Name (String) Name  
ClientEntityId (String) Identifier in an external system  
CreatedUtc (DateTime) Created date in UTC  
LastModifiedUtc (DateTime) Last modified date in UTC  
Attributes (Object) Set of key-value pairs that contain extra data  
Logo (Asset) A reference to an image  
Relationships (Array[object]) Relationship information, such child Locations, Suppliers and Carriers  
SortName (String) A string used for sorting  
Version (Integer) Latest revision number  
CorrelationId (String) Reserved for internal use  
Role (String) Reserved for internal use  
TypeId (Integer) Reserved for future use  

Address

A Location is a physical or virtual presence that may hold inventory or process transactions.

{
    "AddressLine1": "4970 Hillside Avenue",
    "AddressLine2": "Apt 115",
    "City": "Edmonton",
    "StateCode": "ON",
    "StateName": "Ontario",
    "CountryCode": "CA",
    "CountryName": "Canada",
    "Zip": "P9H 9I4"
}
Name Description
AddressLine1 (String) First line of Address
AddressLine2 (String) Second line of Address
City (String) City
StateCode (String) Code for the State in which this address resides. Based off the ISO 3166-2 standard. For a list of acceptable codes, see Getting All Countries
StateName (String) State/Province. Uses the ISO 3166-2 standard
CountryCode (String) Country Code. Uses the ISO 3166-1 alpha-2 standard. For a list of acceptable codes, see Getting All Countries
CountryName (String) Country
Zip (String) Zip or Postal Code

Area

{
    "Value": 1100,
    "Unit": "SqFt"
}
Name Description
Value (Integer) Value of the Area
Unit (String) Unit used for the Value, acceptable values are SqFt and SqM

TimeZone

{
    "Id": "Alaskan Standard Time",
    "DaylightSavingTimeEnabled": true
}
Name Description
Id (String) Identifier. For a list of acceptable values, see Getting All Time Zones
DaylightSavingTimeEnabled (Boolean) A flag to indicate if the Time Zone observes Daylight Savings Time

StoreHours

{
    "Monday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    },
    "Tuesday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    },
    "Wednesday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    },
    "Thursday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    },
    "Friday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    },
    "Saturday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    },
    "Sunday": {
        "Open": {
            "Hour": 10,
            "Minute": 0
        },
        "Close": {
            "Hour": 10,
            "Minute": 0
        }
    }
}
Name Description
Monday (WeekDay) Hours on Monday
Tuesday (WeekDay) Hours on Tuesday
Wednesday (WeekDay) Hours on Wednesday
Thursday (WeekDay) Hours on Thursday
Friday (WeekDay) Hours on Monday
Saturday (WeekDay) Hours on Saturday
Sunday (WeekDay) Hours on Sunday

WeekDay

{
    "Open": {
        "Hour": 10,
        "Minute": 0
    },
    "Close": {
        "Hour": 10,
        "Minute": 0
    }
}
Name Description
Open (object) Open time
Open.Hour (Integer)  
Open.Minute (Integer)  
Close (object) Close time
Close.Hour (Integer)  
Close.Minute (Integer)  

Contact

{
    "Name": "John Smith",
    "Description": "Store Manager",
    "PhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ]
}
Name Description
Name (String) Name
Description (String) Description
PhoneNumbers (array) Phone numbers
PhoneNumbers.Description (String) Description
PhoneNumbers.Number (String) Phone number
PhoneNumbers.Extension (String) Extension

REQUESTS

GET a Company

Request

GET /Companies({CompanyId})

Example Request

GET /Companies(14146)
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingACompany()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingACompany() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 14146,
    "Name": "Kentel Corp",
    "DisplayName": "Kentel Corp",
    "Description": "Wireless accessories provider with store locations all across the globe.",
    "Roles": [
        {
            "Name": "Company"
        }
    ],
    "ClientEntityId": "123",
    "CreatedUtc": "2015-05-20T23:06:29.7700813Z",
    "LastModifiedUtc": "2015-05-20T23:06:29.7700813Z",
    "Attributes": {},
    "Logo": {
        "Id": "d22291d9-db1d-45e2-ab60-32ac9c145323",
        "Name": "globe-rocket.jpg",
        "Height": 341,
        "Href": "https://amsdemostorage.blob.core.windows.net/assets/d22291d9-db1d-45e2-ab60-32ac9c145323.jpg",
        "Md5Checksum": "d2d0b491ad3eecd9d8c3dabb0610197d",
        "MimeType": "image/jpeg",
        "Width": 450
    },
    "Relationships": [
        {
            "Id": 6267,
            "Source": 14146,
            "Destination": 14147,
            "CreatedUtc": "2015-11-20T18:22:10.931Z",
            "Version": 1
        }
    ],
    "SortName": "kentel corp",
    "Version": 1
}

Company

GET a Company Tree

Request

GET /Companies({CompanyId})/Tree

Example Request

GET /Companies(14146)/Tree
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingACompanyTree()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingACompanyTree() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 14146,
    "Name": "Kentel Corp",
    "ClientEntityId": "123",
    "DisplayName": "Kentel Corp",
    "Description": "Wireless accessories provider with store locations all across the globe.",
    "Role": "Company",
    "Nodes": [
        {
            "Id": 14159,
            "Name": "T-hut Wireless",
            "ClientEntityId": "123",
            "DisplayName": "T-hut Wireless",
            "Description": "Division of Kiosks",
            "Role": "Division",
            "Nodes": []
        }
    ]
}

CompanyTree

POST a Location

Request

POST /Companies({CompanyId})/Tree/Nodes({NodeId})/Locations

Example Request

POST /Companies(14146)/Tree/Nodes(14159)/Locations
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    }
}
curl -X POST "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    }
}'
static IRestResponse CreatingALocation()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Name\":\"Dufferin Mall\",\"DisplayName\":\"Dufferin Mall\",\"Description\":\"This Location is used to clear out discounted inventory\",\"Roles\":[{\"Name\":\"Location\"}],\"Area\":{\"Value\":1100,\"Unit\":\"SqFt\"},\"Address\":{\"AddressLine1\":\"4970 Hillside Avenue\",\"AddressLine2\":\"Apt 115\",\"City\":\"Edmonton\",\"StateCode\":\"ON\",\"StateName\":\"Ontario\",\"CountryCode\":\"CA\",\"CountryName\":\"Canada\",\"Zip\":\"P9H 9I4\"},\"Attributes\":{},\"ClientEntityId\":\"123\",\"Contacts\":[{\"Name\":\"John Smith\",\"Description\":\"Store Manager\",\"PhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}]}],\"Geography\":{\"Longitude\":-104.612034,\"Latitude\":50.443559},\"StoreHours\":{\"Monday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Tuesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Wednesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Thursday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Friday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Saturday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Sunday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}}},\"StorePhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}],\"TimeZone\":{\"Id\":\"Alaskan Standard Time\",\"DaylightSavingTimeEnabled\":true}}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse CreatingALocation() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Name\":\"Dufferin Mall\",\"DisplayName\":\"Dufferin Mall\",\"Description\":\"This Location is used to clear out discounted inventory\",\"Roles\":[{\"Name\":\"Location\"}],\"Area\":{\"Value\":1100,\"Unit\":\"SqFt\"},\"Address\":{\"AddressLine1\":\"4970 Hillside Avenue\",\"AddressLine2\":\"Apt 115\",\"City\":\"Edmonton\",\"StateCode\":\"ON\",\"StateName\":\"Ontario\",\"CountryCode\":\"CA\",\"CountryName\":\"Canada\",\"Zip\":\"P9H 9I4\"},\"Attributes\":{},\"ClientEntityId\":\"123\",\"Contacts\":[{\"Name\":\"John Smith\",\"Description\":\"Store Manager\",\"PhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}]}],\"Geography\":{\"Longitude\":-104.612034,\"Latitude\":50.443559},\"StoreHours\":{\"Monday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Tuesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Wednesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Thursday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Friday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Saturday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Sunday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}}},\"StorePhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}],\"TimeZone\":{\"Id\":\"Alaskan Standard Time\",\"DaylightSavingTimeEnabled\":true}}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Name\":\"Dufferin Mall\",\"DisplayName\":\"Dufferin Mall\",\"Description\":\"This Location is used to clear out discounted inventory\",\"Roles\":[{\"Name\":\"Location\"}],\"Area\":{\"Value\":1100,\"Unit\":\"SqFt\"},\"Address\":{\"AddressLine1\":\"4970 Hillside Avenue\",\"AddressLine2\":\"Apt 115\",\"City\":\"Edmonton\",\"StateCode\":\"ON\",\"StateName\":\"Ontario\",\"CountryCode\":\"CA\",\"CountryName\":\"Canada\",\"Zip\":\"P9H 9I4\"},\"Attributes\":{},\"ClientEntityId\":\"123\",\"Contacts\":[{\"Name\":\"John Smith\",\"Description\":\"Store Manager\",\"PhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}]}],\"Geography\":{\"Longitude\":-104.612034,\"Latitude\":50.443559},\"StoreHours\":{\"Monday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Tuesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Wednesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Thursday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Friday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Saturday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Sunday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}}},\"StorePhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}],\"TimeZone\":{\"Id\":\"Alaskan Standard Time\",\"DaylightSavingTimeEnabled\":true}}";

response = RestClient.post 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 201 Content-Type: application/json
{
    "Id": 14202,
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "CreatedUtc": "2015-02-26T00:03:01.372Z",
    "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "Relationships": [],
    "SortName": "dufferin mall",
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    },
    "Version": 13
}

Location

PUT a Location

There are two different ways to update a location.

Option 1 requires knowing the NodeId of the parent of the Location, but has stronger validation.

Request

PUT /Companies({CompanyId})/Tree/Nodes({NodeId})/Locations({LocationId})

Example Request

PUT /Companies(14146)/Tree/Nodes(14159)/Locations(14202)
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Id": 14202,
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "CreatedUtc": "2015-02-26T00:03:01.372Z",
    "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "Relationships": [],
    "SortName": "dufferin mall",
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    },
    "Version": 13
}
curl -X PUT "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations(14202)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Id": 14202,
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "CreatedUtc": "2015-02-26T00:03:01.372Z",
    "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "Relationships": [],
    "SortName": "dufferin mall",
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    },
    "Version": 13
}'
static IRestResponse UpdatingALocation()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations(14202)");
    var request = new RestRequest(Method.PUT);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Id\":14202,\"Name\":\"Dufferin Mall\",\"DisplayName\":\"Dufferin Mall\",\"Description\":\"This Location is used to clear out discounted inventory\",\"Roles\":[{\"Name\":\"Location\"}],\"CreatedUtc\":\"2015-02-26T00:03:01.372Z\",\"LastModifiedUtc\":\"2015-02-27T00:03:06.392Z\",\"Area\":{\"Value\":1100,\"Unit\":\"SqFt\"},\"Address\":{\"AddressLine1\":\"4970 Hillside Avenue\",\"AddressLine2\":\"Apt 115\",\"City\":\"Edmonton\",\"StateCode\":\"ON\",\"StateName\":\"Ontario\",\"CountryCode\":\"CA\",\"CountryName\":\"Canada\",\"Zip\":\"P9H 9I4\"},\"Attributes\":{},\"ClientEntityId\":\"123\",\"Contacts\":[{\"Name\":\"John Smith\",\"Description\":\"Store Manager\",\"PhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}]}],\"Geography\":{\"Longitude\":-104.612034,\"Latitude\":50.443559},\"Relationships\":[],\"SortName\":\"dufferin mall\",\"StoreHours\":{\"Monday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Tuesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Wednesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Thursday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Friday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Saturday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Sunday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}}},\"StorePhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}],\"TimeZone\":{\"Id\":\"Alaskan Standard Time\",\"DaylightSavingTimeEnabled\":true},\"Version\":13}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse UpdatingALocation() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPut request = new HttpPut("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations(14202)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Id\":14202,\"Name\":\"Dufferin Mall\",\"DisplayName\":\"Dufferin Mall\",\"Description\":\"This Location is used to clear out discounted inventory\",\"Roles\":[{\"Name\":\"Location\"}],\"CreatedUtc\":\"2015-02-26T00:03:01.372Z\",\"LastModifiedUtc\":\"2015-02-27T00:03:06.392Z\",\"Area\":{\"Value\":1100,\"Unit\":\"SqFt\"},\"Address\":{\"AddressLine1\":\"4970 Hillside Avenue\",\"AddressLine2\":\"Apt 115\",\"City\":\"Edmonton\",\"StateCode\":\"ON\",\"StateName\":\"Ontario\",\"CountryCode\":\"CA\",\"CountryName\":\"Canada\",\"Zip\":\"P9H 9I4\"},\"Attributes\":{},\"ClientEntityId\":\"123\",\"Contacts\":[{\"Name\":\"John Smith\",\"Description\":\"Store Manager\",\"PhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}]}],\"Geography\":{\"Longitude\":-104.612034,\"Latitude\":50.443559},\"Relationships\":[],\"SortName\":\"dufferin mall\",\"StoreHours\":{\"Monday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Tuesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Wednesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Thursday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Friday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Saturday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Sunday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}}},\"StorePhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}],\"TimeZone\":{\"Id\":\"Alaskan Standard Time\",\"DaylightSavingTimeEnabled\":true},\"Version\":13}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Id\":14202,\"Name\":\"Dufferin Mall\",\"DisplayName\":\"Dufferin Mall\",\"Description\":\"This Location is used to clear out discounted inventory\",\"Roles\":[{\"Name\":\"Location\"}],\"CreatedUtc\":\"2015-02-26T00:03:01.372Z\",\"LastModifiedUtc\":\"2015-02-27T00:03:06.392Z\",\"Area\":{\"Value\":1100,\"Unit\":\"SqFt\"},\"Address\":{\"AddressLine1\":\"4970 Hillside Avenue\",\"AddressLine2\":\"Apt 115\",\"City\":\"Edmonton\",\"StateCode\":\"ON\",\"StateName\":\"Ontario\",\"CountryCode\":\"CA\",\"CountryName\":\"Canada\",\"Zip\":\"P9H 9I4\"},\"Attributes\":{},\"ClientEntityId\":\"123\",\"Contacts\":[{\"Name\":\"John Smith\",\"Description\":\"Store Manager\",\"PhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}]}],\"Geography\":{\"Longitude\":-104.612034,\"Latitude\":50.443559},\"Relationships\":[],\"SortName\":\"dufferin mall\",\"StoreHours\":{\"Monday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Tuesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Wednesday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Thursday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Friday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Saturday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}},\"Sunday\":{\"Open\":{\"Hour\":10,\"Minute\":0},\"Close\":{\"Hour\":10,\"Minute\":0}}},\"StorePhoneNumbers\":[{\"Description\":\"Main Line\",\"Number\":\"5555555555\",\"Extension\":\"1234\"}],\"TimeZone\":{\"Id\":\"Alaskan Standard Time\",\"DaylightSavingTimeEnabled\":true},\"Version\":13}";

response = RestClient.put 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Locations(14202)', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 14202,
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "CreatedUtc": "2015-02-26T00:03:01.372Z",
    "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "Relationships": [],
    "SortName": "dufferin mall",
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    },
    "Version": 13
}

Location

GET a Location for a Company

Request

GET /Companies({CompanyId})/Locations({LocationId})

Example Request

GET /Companies(14146)/Locations(14202)
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations(14202)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingALocationForACompany()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations(14202)");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingALocationForACompany() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations(14202)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations(14202)', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 14202,
    "Name": "Dufferin Mall",
    "DisplayName": "Dufferin Mall",
    "Description": "This Location is used to clear out discounted inventory",
    "Roles": [
        {
            "Name": "Location"
        }
    ],
    "CreatedUtc": "2015-02-26T00:03:01.372Z",
    "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
    "Area": {
        "Value": 1100,
        "Unit": "SqFt"
    },
    "Address": {
        "AddressLine1": "4970 Hillside Avenue",
        "AddressLine2": "Apt 115",
        "City": "Edmonton",
        "StateCode": "ON",
        "StateName": "Ontario",
        "CountryCode": "CA",
        "CountryName": "Canada",
        "Zip": "P9H 9I4"
    },
    "Attributes": {},
    "ClientEntityId": "123",
    "Contacts": [
        {
            "Name": "John Smith",
            "Description": "Store Manager",
            "PhoneNumbers": [
                {
                    "Description": "Main Line",
                    "Number": "5555555555",
                    "Extension": "1234"
                }
            ]
        }
    ],
    "Geography": {
        "Longitude": -104.612034,
        "Latitude": 50.443559
    },
    "Relationships": [],
    "SortName": "dufferin mall",
    "StoreHours": {
        "Monday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Tuesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Wednesday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Thursday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Friday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Saturday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        },
        "Sunday": {
            "Open": {
                "Hour": 10,
                "Minute": 0
            },
            "Close": {
                "Hour": 10,
                "Minute": 0
            }
        }
    },
    "StorePhoneNumbers": [
        {
            "Description": "Main Line",
            "Number": "5555555555",
            "Extension": "1234"
        }
    ],
    "TimeZone": {
        "Id": "Alaskan Standard Time",
        "DaylightSavingTimeEnabled": true
    },
    "Version": 13
}

Location

GET All Locations for a Company

Request

GET /Companies({CompanyId})/Locations

Example Request

GET /Companies(14146)/Locations
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAllLocationsForACompany()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAllLocationsForACompany() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Locations', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
[
    {
        "Id": 14202,
        "Name": "Dufferin Mall",
        "DisplayName": "Dufferin Mall",
        "Description": "This Location is used to clear out discounted inventory",
        "Roles": [
            {
                "Name": "Location"
            }
        ],
        "CreatedUtc": "2015-02-26T00:03:01.372Z",
        "LastModifiedUtc": "2015-02-27T00:03:06.392Z",
        "Area": {
            "Value": 1100,
            "Unit": "SqFt"
        },
        "Address": {
            "AddressLine1": "4970 Hillside Avenue",
            "AddressLine2": "Apt 115",
            "City": "Edmonton",
            "StateCode": "ON",
            "StateName": "Ontario",
            "CountryCode": "CA",
            "CountryName": "Canada",
            "Zip": "P9H 9I4"
        },
        "Attributes": {},
        "ClientEntityId": "123",
        "Contacts": [
            {
                "Name": "John Smith",
                "Description": "Store Manager",
                "PhoneNumbers": [
                    {
                        "Description": "Main Line",
                        "Number": "5555555555",
                        "Extension": "1234"
                    }
                ]
            }
        ],
        "Geography": {
            "Longitude": -104.612034,
            "Latitude": 50.443559
        },
        "Relationships": [],
        "SortName": "dufferin mall",
        "StoreHours": {
            "Monday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            },
            "Tuesday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            },
            "Wednesday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            },
            "Thursday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            },
            "Friday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            },
            "Saturday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            },
            "Sunday": {
                "Open": {
                    "Hour": 10,
                    "Minute": 0
                },
                "Close": {
                    "Hour": 10,
                    "Minute": 0
                }
            }
        },
        "StorePhoneNumbers": [
            {
                "Description": "Main Line",
                "Number": "5555555555",
                "Extension": "1234"
            }
        ],
        "TimeZone": {
            "Id": "Alaskan Standard Time",
            "DaylightSavingTimeEnabled": true
        },
        "Version": 13
    }
]

Array[Location]

POST a Division

Divisions may be added to the root Company node, or to a Division or Group node.

A Division cannot be created if one already exists at the same level with the same name.

That is, you can have a Division and Group with the same name under the same parent or two Division with the same name in different parts of the tree, but you cannot have two Divisions with the same name and the same parent.

Request

POST /Companies({CompanyId})/Tree/Nodes({NodeId})/Divisions

Example Request

POST /Companies(14146)/Tree/Nodes(14159)/Divisions
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Name": "T-hut Wireless",
    "DisplayName": "T-hut Wireless",
    "Description": "Division of Kiosks",
    "ClientEntityId": "187",
    "Attributes": {}
}
curl -X POST "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Divisions" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Name": "T-hut Wireless",
    "DisplayName": "T-hut Wireless",
    "Description": "Division of Kiosks",
    "ClientEntityId": "187",
    "Attributes": {}
}'
static IRestResponse CreatingADivision()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Divisions");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Name\":\"T-hut Wireless\",\"DisplayName\":\"T-hut Wireless\",\"Description\":\"Division of Kiosks\",\"ClientEntityId\":\"187\",\"Attributes\":{}}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse CreatingADivision() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Divisions");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Name\":\"T-hut Wireless\",\"DisplayName\":\"T-hut Wireless\",\"Description\":\"Division of Kiosks\",\"ClientEntityId\":\"187\",\"Attributes\":{}}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Name\":\"T-hut Wireless\",\"DisplayName\":\"T-hut Wireless\",\"Description\":\"Division of Kiosks\",\"ClientEntityId\":\"187\",\"Attributes\":{}}";

response = RestClient.post 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Divisions', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 201 Content-Type: application/json
{
    "Id": 14159,
    "Name": "T-hut Wireless",
    "DisplayName": "T-hut Wireless",
    "Description": "Division of Kiosks",
    "Roles": [
        {
            "Name": "Division"
        }
    ],
    "ClientEntityId": "187",
    "CreatedUtc": "2015-05-20T23:06:29.7700813Z",
    "LastModifiedUtc": "2015-05-20T23:06:29.7700813Z",
    "Attributes": {},
    "Logo": {
        "Id": "d22291d9-db1d-45e2-ab60-32ac9c145323",
        "Name": "globe-rocket.jpg",
        "Height": 341,
        "Href": "https://amsdemostorage.blob.core.windows.net/assets/d22291d9-db1d-45e2-ab60-32ac9c145323.jpg",
        "Md5Checksum": "d2d0b491ad3eecd9d8c3dabb0610197d",
        "MimeType": "image/jpeg",
        "Width": 450
    },
    "Relationships": [],
    "SortName": "t-hut wireless",
    "Version": 1
}

Division

POST a Group

Groups may be added to the root Company node, or to a Division or Group node.

A Group cannot be created if one already exists at the same level with the same name.

That is, you can have a Division and Group with the same name under the same parent or two Groups with the same name in different parts of the tree, but you cannot have two Groups with the same name and the same parent.

Request

POST /Companies({CompanyId})/Tree/Nodes({NodeId})/Groups

Example Request

POST /Companies(14146)/Tree/Nodes(14159)/Groups
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Name": "Toronto",
    "DisplayName": "Toronto",
    "Description": "Group within Ontario",
    "ClientEntityId": "187",
    "Attributes": {}
}
curl -X POST "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Groups" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Name": "Toronto",
    "DisplayName": "Toronto",
    "Description": "Group within Ontario",
    "ClientEntityId": "187",
    "Attributes": {}
}'
static IRestResponse CreatingAGroup()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Groups");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Name\":\"Toronto\",\"DisplayName\":\"Toronto\",\"Description\":\"Group within Ontario\",\"ClientEntityId\":\"187\",\"Attributes\":{}}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse CreatingAGroup() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Groups");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Name\":\"Toronto\",\"DisplayName\":\"Toronto\",\"Description\":\"Group within Ontario\",\"ClientEntityId\":\"187\",\"Attributes\":{}}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Name\":\"Toronto\",\"DisplayName\":\"Toronto\",\"Description\":\"Group within Ontario\",\"ClientEntityId\":\"187\",\"Attributes\":{}}";

response = RestClient.post 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)/Groups', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 201 Content-Type: application/json
{
    "Id": 14166,
    "Name": "Toronto",
    "DisplayName": "Toronto",
    "Description": "Group within Ontario",
    "Roles": [
        {
            "Name": "Group"
        }
    ],
    "ClientEntityId": "187",
    "CreatedUtc": "2015-05-20T23:06:29.7700813Z",
    "LastModifiedUtc": "2015-05-20T23:06:29.7700813Z",
    "Attributes": {},
    "Logo": {
        "id": "09fe1ee4-42b1-43a6-bd80-cd2bda21e90a",
        "name": "49ebd282-4161-4a9d-9b40-a5a20d144b6f.png",
        "height": 1024,
        "href": "https://amsdemo.iqmetrix.net/images/09fe1ee4-42b1-43a6-bd80-cd2bda21e90a.png",
        "md5Checksum": "1f88a2813737aa0019a63069586055ed",
        "mimeType": "image/png",
        "width": 502,
        "success": true,
        "sizeInBytes": 1227661
    },
    "Relationships": [],
    "SortName": "toronto",
    "Version": 1
}

Group

DELETE a Group or Division

This operation cannot be undone.

This request removes the Node referred to by NodeId from the Company Tree along with all of its children.

Only Divisions and Groups can be deleted this way.

If the Node or any of its children include Entities other than Groups or Divisions, the request will be rejected.

Request

DELETE /Companies({CompanyId})/Tree/Nodes({NodeId})

Example Request

DELETE /Companies(14146)/Tree/Nodes(14159)
Authorization: Bearer (Access Token)

curl -X DELETE "https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)" -H "Authorization: Bearer (Access Token)"
static IRestResponse DeletingAGroupOrDivision()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)");
    var request = new RestRequest(Method.DELETE);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse DeletingAGroupOrDivision() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpDelete request = new HttpDelete("https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.delete 'https://entitymanagerdemo.iqmetrix.net/v1/Companies(14146)/Tree/Nodes(14159)', {
     :'Authorization' => 'Bearer (Access Token)',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json

Searching by ClientEntityId

This request allows you to search your Company Tree using the ClientEntityId field.

This request returns an array of objects that summarize Entities matching the search criteria.

The following resource types are considered ‘Entities’: Company, Division, Group, Location, device

Request

GET /Entities({CompanyId})/Nodes?$filter={ClientEntityId} eq '{ClientEntityId}'

Example Request

GET /Entities(14146)/Nodes?$filter=187 eq '{ClientEntityId}'
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://entitymanagerdemo.iqmetrix.net/v1/Entities(14146)/Nodes?$filter=187 eq '{ClientEntityId}'" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse SearchingByCliententityid()
{
    var client = new RestClient("https://entitymanagerdemo.iqmetrix.net/v1/Entities(14146)/Nodes?$filter=187 eq '{ClientEntityId}'");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse SearchingByCliententityid() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://entitymanagerdemo.iqmetrix.net/v1/Entities(14146)/Nodes?$filter=187 eq '{ClientEntityId}'");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://entitymanagerdemo.iqmetrix.net/v1/Entities(14146)/Nodes?$filter=187 eq '{ClientEntityId}'', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
[
    {
        "Id": 14202,
        "Name": "Dufferin Mall",
        "ClientEntityId": "123",
        "DisplayName": "Dufferin Mall",
        "Description": "This Location is used to clear out discounted inventory",
        "Role": "Location",
        "Path": [
            {
                "Id": 14202,
                "Name": "Dufferin Mall",
                "ClientEntityId": "123",
                "DisplayName": "Dufferin Mall",
                "Description": "This Location is used to clear out discounted inventory",
                "Role": "Location"
            }
        ]
    }
]

ERRORS

HTTP Status Code Description How to Resolve
HTTP 400 New node {x} must be related to its parent role.
Parent node {y} must be in same tree as Company {z}
Ensure the NodeId is a valid CompanyTreeNode and is in the correct Company Tree
HTTP 400 Invalid Canadian postal code. Should have valid
letters and format A1A 1A1 where A is a letter and 1 is a digit.
Ensure Postal/Zip Code is valid
HTTP 400 Request Parameter Doesn't Match Expected Value Ensure all Required parameters are provided, see Description of Error for more details
HTTP 400 Please move or delete attached locations
before deleting this entity
Ensure Node to be deleted does not have child Locations
HTTP 400 '{x}' should not be empty. Ensure required parameters are included
HTTP 400 '{x}' must be between 0 and {y} characters.
You entered {z} characters.
Ensure required parameters are within size limitations
HTTP 400 'Latitude/Longitude' should not be empty Ensure both Latitude and Longitude are provided, or Geography is null
HTTP 400 'Latitude' must be between -90 and 90.
You entered {x}
Ensure Latitude is between -90 and 90
HTTP 400 'Longitude' must be between -180 and 180.
You entered {x}
Ensure Longitude is between -180 and 180
HTTP 404 Entity Not Found Ensure CompanyId and LocationId<br/> are accurate and the Location belongs to the Company
HTTP 409 Entity resource already modified by an
earlier request
Ensure Version is included in request and the Version value provided in the request data matches the Version for the resource in the database
HTTP 409 An Entity already exists with the same name
and role at this level.
Ensure an instance of the resource you are trying to create does not already exist with the same name
Was this page helpful?