# Get reporting list

GET https://services.leadconnectorhq.com/ad-publishing/google/reporting/list

Retrieve a list of Google campaigns or ad groups with reporting data. Deprecated: use GET /ad-publishing/google/reporting/rows with header version: v4.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `adPublishing.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location identifier |
| `listType` | string | Yes | Report list type |
| `startDate` | string | Yes | Report start date |
| `endDate` | string | Yes | Report end date |
| `campaignId` | string | No | Campaign identifier (required when listType is adGroups, ads, or keywords) |
| `type` | string | Yes | Integration type |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-04-15"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/google/reporting/list": {
      "get": {
        "summary": "Get reporting list",
        "operationId": "getReportingList",
        "description": "Retrieve a list of Google campaigns or ad groups with reporting data. Deprecated: use GET /ad-publishing/google/reporting/rows with header version: v4.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-04-15"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location identifier",
            "schema": {
              "example": "fRMewNQIxSyZ5R4nQyit",
              "type": "string"
            }
          },
          {
            "name": "listType",
            "required": true,
            "in": "query",
            "description": "Report list type",
            "schema": {
              "example": "campaigns",
              "enum": [
                "campaigns",
                "ads",
                "adGroups",
                "keywords"
              ],
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "required": true,
            "in": "query",
            "description": "Report start date",
            "schema": {
              "example": "2022-01-11",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": true,
            "in": "query",
            "description": "Report end date",
            "schema": {
              "example": "2022-01-31",
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "required": false,
            "in": "query",
            "description": "Campaign identifier (required when listType is adGroups, ads, or keywords)",
            "schema": {
              "example": "196684453527082",
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": true,
            "in": "query",
            "description": "Integration type",
            "schema": {
              "example": "INTEGRATION",
              "enum": [
                "AD_MANAGER",
                "INTEGRATION"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One entry per entity, shaped by `listType`. `campaigns` keeps Google's nested `{ campaign, metrics }` row and only adds the attributed revenue block when `type=AD_MANAGER`; `adGroups` and `ads` flatten the entity onto the row and always carry revenue; `keywords` flattens `name` and `id` from the criterion and carries no revenue at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReportingListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "adPublishing.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "GetReportingListResponse": {
        "type": "array",
        "items": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "campaign": {
                  "type": "object",
                  "description": "Campaign fields, nested as Google returns them rather than flattened onto the row",
                  "additionalProperties": true,
                  "example": {
                    "resourceName": "customers/6776452901/campaigns/22209847663",
                    "id": "22209847663",
                    "name": "Spring promotion",
                    "status": "PAUSED"
                  }
                },
                "metrics": {
                  "description": "Google Ads metrics for the period",
                  "example": {
                    "impressions": 6041,
                    "clicks": 180,
                    "costMicros": 5421341,
                    "averageCpc": 864547.05,
                    "conversions": 0,
                    "averageCpm": 25877259.57,
                    "costPerConversion": 0,
                    "ctr": 0.115
                  },
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "impressions": {
                          "description": "Impressions",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 6041
                        },
                        "clicks": {
                          "description": "Clicks",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 180
                        },
                        "costMicros": {
                          "description": "Spend in micros — divide by 1,000,000 for account currency",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 5421341
                        },
                        "averageCpc": {
                          "type": "number",
                          "description": "Average cost per click, in micros",
                          "example": 864547.05
                        },
                        "conversions": {
                          "type": "number",
                          "description": "Conversions",
                          "example": 0
                        },
                        "averageCpm": {
                          "type": "number",
                          "description": "Average cost per thousand impressions, in micros",
                          "example": 25877259.57
                        },
                        "costPerConversion": {
                          "type": "number",
                          "description": "Cost per conversion, in micros",
                          "example": 0
                        },
                        "ctr": {
                          "type": "number",
                          "description": "Click-through rate as a fraction, not a percentage",
                          "example": 0.115
                        }
                      },
                      "title": "GoogleReportingMetricsDTO"
                    }
                  ]
                },
                "revenue": {
                  "type": "string",
                  "description": "Attributed revenue. Present only for `type=AD_MANAGER`.",
                  "example": "0.00"
                },
                "sales": {
                  "type": "string",
                  "description": "Attributed sales count. `type=AD_MANAGER` only.",
                  "example": "0"
                },
                "leads": {
                  "type": "string",
                  "description": "Attributed leads count. `type=AD_MANAGER` only.",
                  "example": "0"
                },
                "averageRevenue": {
                  "type": "string",
                  "description": "Average revenue per sale. `type=AD_MANAGER` only.",
                  "example": "0.00"
                }
              },
              "required": [
                "campaign",
                "metrics"
              ],
              "title": "GoogleReportingListCampaignRowDTO"
            },
            {
              "type": "object",
              "properties": {
                "resourceName": {
                  "type": "string",
                  "description": "Google Ads resource name",
                  "example": "customers/6776452901/adGroups/177462089489"
                },
                "id": {
                  "type": "string",
                  "description": "Entity id",
                  "example": "177462089489"
                },
                "name": {
                  "type": "string",
                  "description": "Entity name. Ad rows drop the ad name during flattening, so it is not always present.",
                  "example": "Ad Group 1"
                },
                "status": {
                  "type": "string",
                  "description": "Entity status",
                  "example": "ENABLED"
                },
                "adGroupName": {
                  "type": "string",
                  "description": "Parent ad group name. Ad rows only.",
                  "example": "Ad Group 1"
                },
                "adGroupId": {
                  "type": "string",
                  "description": "Parent ad group id. Ad rows only.",
                  "example": "177462089489"
                },
                "metrics": {
                  "description": "Google Ads metrics for the period",
                  "example": {
                    "impressions": 6041,
                    "clicks": 180,
                    "costMicros": 5421341,
                    "averageCpc": 864547.05,
                    "conversions": 0,
                    "averageCpm": 25877259.57,
                    "costPerConversion": 0,
                    "ctr": 0.115
                  },
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "impressions": {
                          "description": "Impressions",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 6041
                        },
                        "clicks": {
                          "description": "Clicks",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 180
                        },
                        "costMicros": {
                          "description": "Spend in micros — divide by 1,000,000 for account currency",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 5421341
                        },
                        "averageCpc": {
                          "type": "number",
                          "description": "Average cost per click, in micros",
                          "example": 864547.05
                        },
                        "conversions": {
                          "type": "number",
                          "description": "Conversions",
                          "example": 0
                        },
                        "averageCpm": {
                          "type": "number",
                          "description": "Average cost per thousand impressions, in micros",
                          "example": 25877259.57
                        },
                        "costPerConversion": {
                          "type": "number",
                          "description": "Cost per conversion, in micros",
                          "example": 0
                        },
                        "ctr": {
                          "type": "number",
                          "description": "Click-through rate as a fraction, not a percentage",
                          "example": 0.115
                        }
                      },
                      "title": "GoogleReportingMetricsDTO"
                    }
                  ]
                },
                "revenue": {
                  "type": "string",
                  "description": "Attributed revenue, as a string",
                  "example": "0"
                },
                "sales": {
                  "type": "string",
                  "description": "Attributed sales count, as a string",
                  "example": "0"
                },
                "leads": {
                  "type": "string",
                  "description": "Attributed leads count, as a string",
                  "example": "0"
                },
                "averageRevenue": {
                  "type": "string",
                  "description": "Average revenue per sale, as a string",
                  "example": "0"
                }
              },
              "required": [
                "id",
                "metrics",
                "revenue",
                "sales",
                "leads",
                "averageRevenue"
              ],
              "title": "GoogleReportingListItemDTO"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Criterion id, flattened from `adGroupCriterion.criterionId`",
                  "example": "303338616"
                },
                "name": {
                  "type": "string",
                  "description": "Keyword text, flattened from `adGroupCriterion.keyword.text`",
                  "example": "running shoes"
                },
                "adGroupName": {
                  "type": "string",
                  "description": "Name of the ad group the keyword belongs to",
                  "example": "Ad Group 1"
                },
                "metrics": {
                  "description": "Google Ads metrics for the period",
                  "example": {
                    "impressions": 6041,
                    "clicks": 180,
                    "costMicros": 5421341,
                    "averageCpc": 864547.05,
                    "conversions": 0,
                    "averageCpm": 25877259.57,
                    "costPerConversion": 0,
                    "ctr": 0.115
                  },
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "impressions": {
                          "description": "Impressions",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 6041
                        },
                        "clicks": {
                          "description": "Clicks",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 180
                        },
                        "costMicros": {
                          "description": "Spend in micros — divide by 1,000,000 for account currency",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 5421341
                        },
                        "averageCpc": {
                          "type": "number",
                          "description": "Average cost per click, in micros",
                          "example": 864547.05
                        },
                        "conversions": {
                          "type": "number",
                          "description": "Conversions",
                          "example": 0
                        },
                        "averageCpm": {
                          "type": "number",
                          "description": "Average cost per thousand impressions, in micros",
                          "example": 25877259.57
                        },
                        "costPerConversion": {
                          "type": "number",
                          "description": "Cost per conversion, in micros",
                          "example": 0
                        },
                        "ctr": {
                          "type": "number",
                          "description": "Click-through rate as a fraction, not a percentage",
                          "example": 0.115
                        }
                      },
                      "title": "GoogleReportingMetricsDTO"
                    }
                  ]
                },
                "adGroupCriterion": {
                  "type": "object",
                  "description": "Google's raw criterion object, passed through alongside the flattened fields",
                  "additionalProperties": true,
                  "example": {
                    "resourceName": "customers/6776452901/adGroupCriteria/175603784313~303338616",
                    "criterionId": "303338616",
                    "keyword": {
                      "text": "running shoes",
                      "matchType": "BROAD"
                    }
                  }
                },
                "adGroup": {
                  "type": "object",
                  "description": "Google's raw ad group object, passed through alongside the flattened fields",
                  "additionalProperties": true,
                  "example": {
                    "resourceName": "customers/6776452901/adGroups/175603784313",
                    "id": "175603784313",
                    "name": "Ad Group 1"
                  }
                },
                "keywordView": {
                  "type": "object",
                  "description": "Google's keyword view resource, passed through",
                  "additionalProperties": true,
                  "example": {
                    "resourceName": "customers/6776452901/keywordViews/175603784313~303338616"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "adGroupName",
                "metrics"
              ],
              "title": "GoogleReportingListKeywordRowDTO"
            }
          ]
        }
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code for an unexpected server error",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Error message describing the server failure",
            "example": "Internal Server Error"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-04-15'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-04-15'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ad-publishing/google/reporting/list"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-04-15"
}

params = {
    "locationId": "<LOCATIONID>",
    "listType": "<LISTTYPE>",
    "startDate": "<STARTDATE>",
    "endDate": "<ENDDATE>",
    "type": "<TYPE>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-04-15',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-04-15")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-04-15")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-04-15"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-04-15"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/google/reporting/list?locationId=<LOCATIONID>&listType=<LISTTYPE>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
