Introduction

This API allows you to add new hierarchy levels in your existing Hierarchy.


Good to know

API response format:

Our APIs return data in either JSON or XML format (depending on request by .json or .xml).


Deleting hierarchy nodes:

You can only delete the lowest hierarchy nodes (nodes without children).


Referencing deleted hierarchy nodes:

Prior to deletion, please make sure any hierarchy nodes you want to delete are not referenced on survey records, report filters, campaigns, etc.

Failure to do so will result (but may not be limited to) the following:

  • For survey records; records will only show up for Global users
  • Report filters; this filter value will be ignored
  • Campaigns; no match will be found with templates having the deleted hierarchy node


Creating hierarchy

Parent is not required but when is not chosen it will go to Global by default


About this API

Resource Information

Response formatsJSON (default), XML
HTTP MethodPOST
Response familyHierarchy
HeaderAuthorization: Bearer XXXXX


Resource URL

Europe Production Server: https://api.eu.customergauge.com/v4.1/hierarchy.json

US Production Server: https://api.us.customergauge.com/v4.1/hierarchy.json

Australia Production Server: https://api.au.customergauge.com/v4.1/hierarchy.json


Authentication

OAuth2 Authentication is used to connect to this API. In order to create the Connected App, which is needed to generate the Access Token, Administrator access to CustomerGauge is needed. Once you've created your Connected App, you can acquire a Bearer Access Token by calling our OAuth2/Token API:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded"
-d "grant_type=client_credentials&client_id={{ Client ID }}&client_secret={{ Client Secret }}"
https://auth.{{ apiRegion }}.customergauge.com/oauth2/token

The acquired Bearer Access Token is used in the Authorization header in your API request.


How to call

POST Data

Post data as key value.


Parameters

KeyData
division (required)Amsterdam
parentNetherlands


Example Request

To call this API through cURL:

curl -H "Authorization: Bearer XXXXX" -X POST https://api.eu.customergauge.com/v4.1/hierarchy.json -d division=Amsterdam -d parent=Netherlands


Example Result

Message reported on successful operation:

{
  "Data": {
    "id": "2"
  }
}


Message reported on failed operation:

{
  "Error": {
    "Message": "Required field 'division' not supplied",
    "Code": 300004
  }
}


Not the API you're looking for?


Related APIs:


Or view: