# Account Hierarchy

<mark style="color:blue;">`GET`</mark> `https://us-central1-appgregator.cloudfunctions.net/googleads/customers/account-hierarchy/`

#### Query Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4        |
| connection\_name<mark style="color:red;">\*</mark> | String | ga-06       |
| customer\_id<mark style="color:red;">\*</mark>     | String | 1894250756  |

#### Headers

| Name                                               | Type   | Description                                                                           |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------- |
| client\_id<mark style="color:red;">\*</mark>       | String | [xxxx-xxxx.apps.googleusercontent.com](https://xxxx-xxxx.apps.googleusercontent.com/) |
| client\_secret<mark style="color:red;">\*</mark>   | String | XXX-XXXX                                                                              |
| developer\_token<mark style="color:red;">\*</mark> | String | XXXX                                                                                  |
| x-api-key<mark style="color:red;">\*</mark>        | String | U2FsdG...                                                                             |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
[
    {
        "clientCustomer": "customers/1191136596",
        "resourceName": "customers/1894250756/customerClients/1191136596",
        "level": 1,
        "timeZone": "Asia/Jakarta",
        "manager": false,
        "descriptiveName": "account_testing",
        "currencyCode": "IDR",
        "id": 1191136596
    },
    {
        "clientCustomer": "customers/2121064707",
        "resourceName": "customers/1894250756/customerClients/2121064707",
        "level": 1,
        "timeZone": "Asia/Jakarta",
        "manager": true,
        "descriptiveName": "test-manager",
        "currencyCode": "IDR",
        "id": 2121064707
    },
    {
        "clientCustomer": "customers/1894250756",
        "resourceName": "customers/1894250756/customerClients/1894250756",
        "level": 0,
        "timeZone": "Asia/Jakarta",
        "manager": true,
        "descriptiveName": "test_appgre",
        "currencyCode": "IDR",
        "id": 1894250756
    },
    {
        "clientCustomer": "customers/9551647295",
        "resourceName": "customers/1894250756/customerClients/9551647295",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "My Client JagdishTest",
        "currencyCode": "USD",
        "id": 9551647295
    },
    {
        "clientCustomer": "customers/8171576147",
        "resourceName": "customers/1894250756/customerClients/8171576147",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "Testing-Client1",
        "currencyCode": "USD",
        "id": 8171576147
    },
    {
        "clientCustomer": "customers/6980850315",
        "resourceName": "customers/1894250756/customerClients/6980850315",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "Testing-Client2",
        "currencyCode": "USD",
        "id": 6980850315
    },
    {
        "clientCustomer": "customers/7444505521",
        "resourceName": "customers/1894250756/customerClients/7444505521",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "Testing-Client3",
        "currencyCode": "USD",
        "id": 7444505521
    },
    {
        "clientCustomer": "customers/4580611368",
        "resourceName": "customers/1894250756/customerClients/4580611368",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "Testing-Client4",
        "currencyCode": "USD",
        "id": 4580611368
    },
    {
        "clientCustomer": "customers/9884186799",
        "resourceName": "customers/1894250756/customerClients/9884186799",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "Testing-Client4",
        "currencyCode": "USD",
        "id": 9884186799
    },
    {
        "clientCustomer": "customers/9619431323",
        "resourceName": "customers/1894250756/customerClients/9619431323",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "Testing-Client5",
        "currencyCode": "USD",
        "id": 9619431323
    },
    {
        "clientCustomer": "customers/1624976691",
        "resourceName": "customers/1894250756/customerClients/1624976691",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "client20",
        "currencyCode": "USD",
        "id": 1624976691
    },
    {
        "clientCustomer": "customers/9370357443",
        "resourceName": "customers/1894250756/customerClients/9370357443",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "client21",
        "currencyCode": "USD",
        "id": 9370357443
    },
    {
        "clientCustomer": "customers/9028296625",
        "resourceName": "customers/1894250756/customerClients/9028296625",
        "level": 1,
        "timeZone": "America/New_York",
        "manager": false,
        "descriptiveName": "client22",
        "currencyCode": "USD",
        "id": 9028296625
    }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="NodeJs - Axios" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://us-central1-appgregator.cloudfunctions.net/googleads/customers/account-hierarchy?name=ft-4&connection_name=ga-06&customer_id=1894250756',
  headers: { 
    'client_id': 'XXXX-XXXX.apps.googleusercontent.com', 
    'client_secret': 'XXX-XXXX', 
    'developer_token': 'XXXX', 
    'x-api-key': 'U2FsdG...'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl --location --request GET 'https://us-central1-appgregator.cloudfunctions.net/googleads/customers/account-hierarchy?name=ft-4&connection_name=ga-06&customer_id=1894250756' \
--header 'client_id: XXXX-XXXX.apps.googleusercontent.com' \
--header 'client_secret: XXX-XXXX' \
--header 'developer_token: XXXX' \
--header 'x-api-key: U2FsdG...'
```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/googleads/customers/account-hierarchy?name=ft-4&connection_name=ga-06&customer_id=1894250756',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'client_id: XXXX-XXXX.apps.googleusercontent.com',
    'client_secret: XXX-XXXX',
    'developer_token: XXXX',
    'x-api-key: U2FsdG...'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
