• iOS
  • Android
  • Windows
  • Web
  • Cordova
  • Unity
  • Adobe Air
  • Dashboard
  • API
  • Guides
  • FAQ
  • API > In-App Campaigns API

    POST - Delete In-App campaign

    The delete endpoint allows you to remove an In-App campaign using its token number.

    Request structure

    Route

    The In-App campaigns API exposes a POST endpoint at: https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/delete/CAMPAIGN_TOKEN

    Here are examples of valid cURL, PHP or Python requests syntax:

    curl -X POST "https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/delete/CAMPAIGN_TOKEN" \
    -H "Content-Type: application/json" \
    -H "X-Authorization: BATCH_REST_API_KEY"
    use GuzzleHttp\Client;
    $client = new Client();
    $response = $client->request("POST", "https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/delete/CAMPAIGN_TOKEN", [
        "headers" => [
            "Content-Type" => "application/json",
            "X-Authorization" => "BATCH_REST_API_KEY"
        ]
    ]);
    import requests, json
    response = requests.request("POST", "https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/delete/CAMPAIGN_TOKEN", 
        headers={
            'Content-Type': 'application/json'
            'X-Authorization': 'BATCH_REST_API_KEY'
        }
    )

    The CAMPAIGN_TOKEN value is the token you receive when you successfully create an In-App campaign using the API.

    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 POST to the API endpoint is successfull you will receive an HTTP 200 confirmation.

    Failure

    If the GET 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)
    • SERVER_ERROR (Http status code: 500, Error code: 0)