• iOS
  • Android
  • Windows
  • Cordova
  • Web
  • Unity
  • Adobe Air
  • Dashboard
  • API
  • Guides
  • FAQ
  • API > GDPR API

    GET - Get request

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

    Request structure

    Route

    The GDPR API exposes a GET endpoint to get the status of a single GDPR request:

    https://api.batch.com/1.0/BATCH_API_KEY/gdpr/request/REQUEST_ID

    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/request/REQUEST_ID"
    

    The REQUEST_ID value is the token you get when creating the request.

    The BATCH_API_KEY value is either your Live or Dev 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.

    Responses

    Success

    If the GET to the API endpoint is successful you will receive an HTTP 200 confirmation and information about the GDPR request depending on the request type and status.

    • Finished review request :
    {
        "status": "done",
        "id": {
            "type": "custom_id",
            "value": "john.doe"
        },
        "data_url": "https://api.batch.com/1.0/[APIKEY]/gdpr/request/[REQUEST_ID]/results/[RESULT_ID].zip"
    }
    

    The data_url value allows you two download a zip file containing the requested data.

    • Pending request :
    {
        "status": "pending",
        "id": {
            "type": "custom_id",
            "value": "john.doe"
        }
    }
    
    • Finished remove request :
    {
        "status": "done",
        "id": {
            "type": "custom_id",
            "value": "john.doe"
        }
    }
    
    • Request in error :
    {
        "status": "done",
        "id": {
            "type": "custom_id",
            "value": "john.doe"
        },
        "error": "user not found"
    }
    

    The error field gives you some information about what went wrong.

    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)
    • 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)