GDPR Withdrawal-of-Consent API
GDPR Overview
For GDPR compliance, users who provide consent can withdraw consent at any time (refer to 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 to honor the user’s choice to withdraw consent, including 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 who have withdrawn their consent, or check the dates for which reports are available.
-
The List Reports endpoint contains the dates of the available reports.
-
The Fetch Report endpoint only contains the advertising IDs of the users who have withdrawn their consent. These are users who previously granted consent and chose to withdraw that 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 email mopub-mediation@twitter.com to retrieve an API Key.
List Report
Request
Retrieve the report 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 (or x-api-key ) header key is not case-sensitive, but the header value (that is, the actual API key) is case-sensitive. |
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 you can use to fetch the report for that date (refer to Fetch Report). |
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
Retrieve the report by making an HTTP GET
request and providing authentication. This will return a 302
redirect to a temporary URL (valid for 60 seconds) that you can use 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 (or x-api-key ) header key is not case-sensitive, but the header value (that is, the actual API key) is case-sensitive. |
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 you can use 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 , such as 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 December 03, 2020
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.
© 2020 MoPub (a division of Twitter, Inc.)