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 basically three APIs you can use in your app to cover all your marketing needs:
Take a look at this guide if you want to know more on how to use our APIs.
Before sending your first notification with Batch REST API, make sure you have:
You will find them in your app settings, on Batch dashboard (⚙️ Settings → General).
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_KEYis your REST API key. It goes in the
BATCH_API_KEYis you app API key or the SDK API key of your website. It is the one that goes in the URL.