Marketing API Version

Publisher Reports

Permissions

A user access token with Atlas API capability is required to request reach overlap report details.

Create Publisher Report

You can create publisher reports by making an HTTP POST request. It will update the report if it already exists.

To get more information, see the details of the Report API.

An example of the request and response:

Request:


https://graph.facebook.com/<API_VERSION>/<PUBLISHER_ID>/reports? reports=[{ "name":"Test Publisher Report", "version":null,"description":"", "definition":{ "report_type":"publisher","column_definitions":[{"area":"serving","attribution_model":null,"category":"standard","key":"advertiser_id","name":"Advertiser ID","aggregation_usage":"dimension"},{"area":"serving","attribution_model":"last_touch","category":"standard","key":"counters_clicks","name":"Clicks","aggregation_usage":"metric"}], "date_range":{"type":"relative","date_unit":"day","quantity":"0","time_zone":"America/New_York"}, "time_zone":"America/New_York", "filters":{"publisher_ids":["11002200632400"]} }, "file_format":"xlsx", "is_email_enabled":false, "email_addresses":[], "email_suffix":"", }]

List of dimension, metric and filter fields can be found here.

Execute Datapassback Reports

You can execute DPB reports for a publsiher to create a reportrun by making an HTTP POST request.

An example of the request and response:

Request:

https://graph.facebook.com/<API_VERSION>/<PUBLISHER_ID>/report_runs?report_ids=[<REPORT_ID>]

Response:

{
  "data": [
    {
      "id": "11002200634100", 
      "success": true
    }
  ]
}

Curl Example

A curl example to execute DPB reports for a publisher:


curl \ -F 'report_ids=[<REPORT_ID>]' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/<PUBLISHER_ID>/report_runs

Download Datapassback Reports

Downloading Datapassback report will return a data file in csv format.

You can get DPB reports by making an HTTP GET request.

An example of the request and response:

Request:

https://lookaside.fbsbx.com/adsatlas/download/passback/?access_token=<ACCESS_TOKEN>&id=<REPORT_RUN_ID>&filename=TestReportDownload

Response:

The response will be a file download generated named TestReportDownload.csv

Curl Example

A curl example to create reportruns of your reports:

curl -G \ 
  -d 'id=<REPORT_RUN_ID>' \
  -d 'filename=TestReportDownload' \
  -d 'access_token=<ACCESS_TOKEN>' \
https://lookaside.fbsbx.com/adsatlas/download/passback