Overview

Push API

What are the Batch APIs?

With Batch RESTful APIs you can easily send custom data and push notifications to take advantage of Batch’s advanced features from your own systems. There are 7 APIs you can use to cover your needs: engaging with your users, sending custom user data and being GDPR-compliant.

engage your users

All Batch engagement channels: Mobile push, Web push and In-App messages can be completely used remotely via our APIs.

  • The Transactional API is made for 1-to-1 or 1-to-few interactions. It allows you to send push notifications to a specific list of user IDs (push token, Advertising IDs or Custom User IDs) based on events in your back-end (e.g. "You have a new friend request").
  • The Push Campaigns API is made for 1-to-many interactions. It allows you to send push notifications in mass to your users according to targeting criteria (using your custom data or Batch generated data) or with your own segmentation engine with Custom Audiences.
  • The In-App campaigns API allows you to send customized In-App messages to your users, the targeting method being quite close to the Campaigns API.

send custom data

You probably want to send Batch some custom data for campaign targeting and message personnalisation purposes. Our APIs enables you to send us data at three different scale: the app, a group of users and a single user.

  • The App Data API allows you to send custom data you associated to your application. This is particularly useful if you need app-level in your campaigns, such as dates or attributes (e.g. Quick! Premium subscription discount will end in 3 days)
  • The Custom Audience API allows you to send Batch specific lists of user IDs for your push and In-App campaign targeting. Your own segmentation will then be available on the dashboad as a Custom Audience.
  • The Custom Data API to send custom data on specific custom user IDs (iOS/Android) to improve your campaign targetings and personnalization with your own custom data.

Protecting your users' data

Being GDPR-compliant, Batch let you make requests to fetch and/or delete user data from our database. Our GDPR API allows you to make those requests and regain control of Batch's collected user data.

get data export

Batch let you make requests to get data from our database. Our EXPORT API allows you to make those requests and get back data concerning to your audience.

Take a look at this guide if you want to know more on how to use our APIs.

How do I get started?

Prerequisites

Before sending your first notification with Batch REST API, make sure you have:

  • Your Batch REST API key.
  • Your app API key or your website SDK API key.
  • At least a Developer plan for the Push Campaigns API.
  • At least a Startup plan for the Custom Data API.

You will find these IDs in your app settings, on Batch dashboard (⚙️ Settings → General). Please note you need to be the manager of the account to see the REST API key.

Request headers

You will need to use the same api keys and headers for both the campaigns or the transactional API. Here is an example of a valid request syntax:

curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X POST -d
"@payload.json" "https://api.batch.com/1.1/BATCH_API_KEY/campaigns/create"
curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X GET
"https://api.batch.com/1.1/BATCH_API_KEY/campaigns/stats/CAMPAIGN_TOKEN"
  • BATCH_REST_API_KEY is your REST API key. It goes in the X-Authorization header.
  • BATCH_API_KEY is you app API key or the SDK API key of your website. It is the one that goes in the URL.