GET - Get all requests

The GDPR API allows you to create GDPR requests and get their status. This page documents the requests endpoint.

Request structure

Route

The GDPR API exposes a GET endpoint to get all requests stored:

https://api.batch.com/1.0/BATCH_API_KEY/gdpr/requests

Here is a valid cURL example:

curl -H "Content-Type: application/json" \
     -H "X-Authorization: BATCH_REST_API_KEY" \
     -X GET "https://api.batch.com/1.0/BATCH_API_KEY/gdpr/requests"

The BATCH_API_KEY value is either your Live, Dev or SDK Batch API key from the settings page of your app within the dashboard (⚙ Settings → General).

Headers

In order to authenticate with the API, you need to provide your company REST API Key as the value of the X-Authorization header. You can find it in ⚙ Settings → General.

Responses

Success

If the GET to the API endpoint is successful you will receive an HTTP 200 confirmation and information about all GDPR requests.

This information is an array of all requests we currently know of for your application.

Here is an example:

[
  {
    "request_id": "6c256bd1-485a-47d1-8c36-7e3d5be013aa",
    "request_date": "2021-01-03T16:52:16.051",
    "status": "done",
    "request_type": "review",
    "trigger_type": "api",
    "error": "user not found",
    "id": {
      "type": "advertising_id",
      "value": "196b3360-59d7-408a-8e99-c4be99c4fff0"
    }
  },
  {
    "request_id": "b17774dc-3a97-41af-be5f-6ed3fd09f032",
    "request_date": "2021-01-19T16:52:16.051",
    "status": "pending",
    "request_type": "review",
    "trigger_type": "api",
    "id": {
      "type": "custom_id",
      "value": "john.doe"
    }
  },
  {
    "request_id": "7e2142f1-b0a3-4ed0-aef3-67d3f41270b6",
    "request_date": "2020-11-04T10:37:06.512",
    "status": "done",
    "error": "user not found",
    "request_type": "remove",
    "trigger_type": "dashboard",
    "id": {
      "type": "custom_id",
      "value": "foobar"
    }
  }
]

Each object in the array contains exactly the same information as you would get if you made a GET request with the request id.

Note: Expired requests are not returned by this API.

Failure

If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.

  • AUTHENTICATION_INVALID (Http status code: 401, Error code: 10)
  • API_MISUSE (Http status code: 403, Error code: 12)
  • ROUTE_NOT_FOUND (HTTP status code: 404, Error code: 20)
  • MISSING_PARAMETER (HTTP status code: 400, Error code: 30)
  • MALFORMED_PARAMETER (HTTP status code: 400, Error code: 31)
  • SERVER_ERROR (HTTP status code: 500, Error code: 1)
  • MAINTENANCE_ERROR (HTTP status code: 503, Error code: 2)