Retrieve aggregated Facebook ad reporting metrics for a account
http
GET https://services.leadconnectorhq.com/ad-publishing/facebook/reportingAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | fRMewNQIxSyZ5R4nQyit | Account identifier |
groupBy | string | Yes | month | Time grouping interval |
startDate | string | Yes | 2022-01-11 | Report start date |
endDate | string | Yes | 2022-01-31 | Report end date |
type | string | Yes | AD_MANAGER or INTEGRATION | Integration source type |
fields | string[] | Yes | Comma-separated reporting fields |
Responses
200 - Response
400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X GET 'https://services.leadconnectorhq.com/ad-publishing/facebook/reporting' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/reporting', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'GET',
'https://services.leadconnectorhq.com/ad-publishing/facebook/reporting',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/facebook/reporting');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);