GDPR Withdrawal of Consent API

GDPR Overview

For GDPR compliance, users who provide consent have the ability to withdraw consent at any time (see our FAQ for more information). MoPub informs our downstream partners when the user has withdrawn consent so that they, as an independent controller of the user’s personal data, can meet any independent obligations they may have to honor the user’s choice to withdraw consent, including by not engaging in further processing of the user’s personal data unless they have other legal grounds for such processing.

API Overview

The Withdrawal of Consent API supports two separate outputs where downstream partners can retrieve the Advertising IDs of users that have withdrawn their consent or check which dates the reports are available for.

The List Reports endpoint contains the dates of the available reports.

The Fetch Report endpoint only contains the advertising IDs of the users that have withdrawn their consent. These are users that previously provided consent and chose to withdraw such consent at a later date.

Reports are available daily for only the previous 21 days. All dates are in UTC.

The API requires a valid API key in order to retrieve the data. Please contact your account manager or dspsupport@mopub.com to retrieve an API Key.

List Report

Request

The report can be retrieved by making an HTTP GET request and providing authentication.

Required Parameters

Type Header Field Header Value
Header x-api-key API Key provided by MoPub.

Note: the “X-API-Key”/”x-api-key” header key is not case-insensitive, but the header value, the actual API key, is.

Endpoint

/public/api/v1/consent_reporting/list_reports

Format

curl -H "x-api-key: $API_KEY" https://demand.mopub.com/public/api/v1/consent_reporting/list_reports

Sample Request

curl -H "x-api-key: V9We52QGLDjkSY8e58l8IAYR9a3299" https://demand.mopub.com/public/api/v1/consent_reporting/list_reports

Response

The response provides the dates of the available reports. Reports are only available for 21 days.

Structure

This endpoint returns a JSON blob with a single top-level key.

Attribute Type Description
available_reports object A mapping from date (a string in ISO extended “YYYY-MM-DD” format) to a corresponding URL that can be used to fetch the report for that date (see “Fetch Report,” below).

Sample Response

{
  "available_reports": {
    "2018-07-01": "https://demand.mopub.com/public/api/v1/consent_reporting/fetch_report?date=2018-07-01",
    "2018-07-02": "https://demand.mopub.com/public/api/v1/consent_reporting/fetch_report?date=2018-07-01"
  }
}

Fetch Report

Request

The report can be retrieved by making an HTTP GET request and providing authentication. This will return a 302 redirect to a temporary URL (valid for 60 seconds) that can be used to download the report. The URLs are valid for 60 seconds.

Required Parameters

Type Header Field Value
Header x-api-key API key provided by MoPub.

Note: the “X-API-Key”/”x-api-key” header key is not case-insensitive, but the header value, the actual API key, is.
Request Field date YYYY-MM-DD in UTC.

Endpoint

/public/api/v1/consent_reporting/fetch_report

Format

curl -L -H "x-api-key: $API_KEY" https://demand.mopub.com/public/api/v1/consent_reporting/fetch_report?date=2018-07-01

Sample Request

curl -L -H "x-api-key: V9We52QGLDjkSY8e58l8IAYR9a3299" https://demand.mopub.com/public/api/v1/consent_reporting/fetch_report?date=2018-07-01

Response

The response is a redirect to a temporary URL (valid for 60 seconds) that can be used to download the file, which is formatted as a newline-delimited list of raw IFAs.

Status Codes

HTTP Status Description Error Message
400 Bad request— for example, the date parameter is missing or invalid. Valid date param required: “?date=YYYY-MM-DD”. Example: “?date=2018-07-01”.
403 Requests missing or containing an invalid x-api-key header will be immediately rejected with HTTP status 403/unauthorized.

Additionally, using an HTTP method other than GET (e.g. POST) will trigger this error.
403 Forbidden
404 Report is not available for the specified date in the Fetch Report. Also sent if the requested date is outside of the permitted date range (in the future or more than 21 days in the past). No report available for 2010-01-01.
500 Internal server error. Please try again later. An error occurred while trying to process the request.

Last updated October 10, 2018

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2018 MoPub Inc.