Introduction
This API will update a hierarchy level (also known as "division") in your existing Hierarchy.
Feature notes:
- The request should only contain 1 extra parameter. Ex: division + parent OR division + division_to_update.
- When changing the division's parent, all of its child divisions will accompany it.
Good to know
API response format:
Our APIs return data in either JSON or XML format (depending on request by .json or .xml).
About this API
Resource Information
Response formats | JSON (default), XML |
HTTP Method | PUT |
Response family | Hierarchy |
Header | Authorization: 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
PUT Data
Update data as key value.
Parameters
Key | Description | Example value |
division | This is a required field. The division you want to make changes to. | Amsterdam |
division_to_update | The new name for the division | North Holland |
parent | The new parent for the division | Netherlands |
Example Request
To call this API through cURL:
curl -H "Authorization: Bearer XXXXX" -X PUT https://api.eu.customergauge.com/v4.1/hierarchy.json -d division=Amsterdam -d division_to_update="North Holland"
Example Result
Message reported on successful operation:
{
"Data": {
"message": "Division has been updated successfully"
}
}
Message reported on failed operation:
{
"Error": {
"Message": "Required field 'id' not supplied",
"Code": 300004
}
}
Not the API you're looking for?
Related APIs:
Or view: