### Getting Started Guides Source: https://doc.batch.com/readme New users can find step-by-step tutorials and feature overviews to effectively use the Batch platform. This section aims to onboard users quickly and efficiently. ```APIDOC Getting Started Guides: URL: https://app.gitbook.com/o/yV0lmz43uUZMgWmM3297/s/UIK868wiiK9XOVyETGZS/ Description: Step-by-step tutorials and feature overviews for new users to get started with the Batch platform. ``` -------------------------------- ### Web SDK Getting Started Source: https://context7_llms Instructions for getting started with the Batch Web SDK, including prerequisites and adding the JavaScript snippet to your page. ```markdown - [Getting Started](/developer/sdk/web/getting-started.md) - [Prerequisites](/developer/sdk/web/getting-started/prerequisites.md) - [Integrating Batch Service Worker](/developer/sdk/web/getting-started/batch-service-worker.md) - [Adding the JavaScript snippet to your page](/developer/sdk/web/getting-started/javascript-snippet.md) - [Safari APNs setup](/developer/sdk/web/getting-started/safari-setup.md) ``` -------------------------------- ### Initialize Batch SDK in AppDelegate (Objective-C) Source: https://doc.batch.com/developer/sdk/ios/sdk-integration/initial-setup Example of how to start the Batch SDK with your API key in the `application:didFinishLaunchingWithOptions:` method of your AppDelegate in Objective-C. ```objectivec @import Batch; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Start Batch SDK. [BatchSDK startWithAPIKey:@"MY_API_KEY"]; return YES; } ``` -------------------------------- ### Initialize Batch SDK in AppDelegate (Swift) Source: https://doc.batch.com/developer/sdk/ios/sdk-integration/initial-setup Example of how to start the Batch SDK with your API key in the `application:didFinishLaunchingWithOptions:` method of your AppDelegate in Swift. ```swift import Batch func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { BatchSDK.start(withAPIKey: "YOUR_API_KEY") [..] } ``` -------------------------------- ### Initialize Batch SDK in SwiftUI App Source: https://doc.batch.com/developer/sdk/ios/sdk-integration/initial-setup Example of how to start the Batch SDK with your API key in a SwiftUI application by setting up a custom AppDelegate. ```swift import SwiftUI import Batch class MyAppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { BatchSDK.start(withAPIKey: "YOUR_API_KEY") return true } } @main struct BatchApp: App { // Set an explicit delegate to integrate Batch in @UIApplicationDelegateAdaptor(MyAppDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() } } } ``` -------------------------------- ### Sending Subdomain Examples Source: https://doc.batch.com/guides-and-best-practices/email-deliverability/domain-and-ip-warm-up/step-2-technical-setup Provides examples of how to structure sending subdomains for different email activities to maintain sender reputation and organization. It emphasizes using new, dedicated subdomains for Batch emails. ```APIDOC Sending Subdomain Naming Conventions: - Purpose: Define subdomains for email sending activities. - Best Practices: - Use one subdomain per email activity. - Subdomains should be new and have a neutral reputation. - Use subdomains exclusively for emails sent from Batch. - Attach subdomains to your website's domain. - Examples: - Transactional automations: `service.domain.com` - Marketing automations: `hello.domain.com` - Email campaigns: `news.domain.com` - Regional variations: `service.domain.fr` - Language-specific: `noticias.domain.com` - Reference: [Email sending structure & domain consistency](../email-authentication-and-sending-structure/best-practices-on-email-sending-structure-and-domain-consistency) ``` -------------------------------- ### Batch Mobile Engagement Platform - Welcome Campaign Setup Source: https://doc.batch.com/guides-and-best-practices/orchestration/how-to-create-your-first-welcome-campaign This documentation outlines the steps for configuring recurring welcome campaigns within the Batch Mobile Engagement Platform. It details how to target users based on their installation date and set the campaign's timing for recurring execution. ```APIDOC Campaign Configuration: Targeting: Conditions: - "Add conditions" - "Installation date" Parameters: - "Installation occurred [number] days ago" Timing: Schedule: - "Recurring" Dates: - "Starting date" - "Ending date" Frequency: - "Sent every day" (equivalent to every 1 day) ``` -------------------------------- ### Warm-up Preparation Steps Source: https://doc.batch.com/guides-and-best-practices/email-deliverability/domain-and-ip-warm-up/getting-started-with-a-warm-up Details the key stages for preparing an email warm-up, including performance assessment, technical setup, list hygiene review, estimating warm-up targets, scheduling, template review, and final checks. ```text Warm-up Preparation step-1-performance-assessment step-2-technical-setup Warm-up Planning step-3-list-hygiene-review step-4-estimate-your-warmup-target step-5-warmup-schedule Final Checks step-6-templates-review final-check Launch & Monitoring expected-warmup-issues-and-troubleshooting monitoring-your-warmup-performance ``` -------------------------------- ### Admin Setup and Configuration Guides Source: https://context7_llms Guides for setting up and configuring Batch, including managing development and live environments, setting up Single-Sign-On (SSO) with Okta, and configuring email delivery for Apple's Private Relay. ```APIDOC Environment Management: - Best practices for managing separate development and live environments within Batch. Single-Sign-On (SSO) with Okta: - Configuration steps to integrate Okta as an Identity Provider (IdP) for Batch dashboard access. Email Delivery to Apple's Private Relay: - Configuration to ensure email delivery to users utilizing Apple's 'Sign in with Apple' feature and Private Relay. ``` -------------------------------- ### iOS Specific Guides Source: https://context7_llms Guides for integrating and managing Batch SDK features specifically for iOS applications, including unsubscription and installation ID retrieval. ```ios // How to allow users to unsubscribe from push notifications on iOS: // Implement a UI element that calls Batch.User.setPushSubscribed(false); // How to find my Installation ID on an iOS device: // Use the Batch SDK's internal methods or the Mac Console for debugging. // Example (conceptual): // NSString *installationId = [BatchUser installationID]; // How to test the integration on iOS: // Follow the debugging steps outlined in the documentation to verify SDK setup. // How to work around iOS test signing issues with Batch 2.0: // Refer to specific configuration or build settings adjustments mentioned in the guide. ``` -------------------------------- ### Start SDK with API Key (Swift) Source: https://doc.batch.com/developer/sdk/ios/advanced/migration-guides/2x-migration Replace calls to the old 'Batch' module with 'BatchSDK' when starting the SDK in Swift. ```swift BatchSDK.start(withAPIKey: "YOUR_API_KEY") ``` -------------------------------- ### Batch Extension SDK Installation (Carthage) Source: https://doc.batch.com/developer/sdk/react-native/sdk-integration/rich-notifications-setup Instructions for installing the Batch iOS SDK Extension using Carthage. ```bash github "BatchLabs/Batch-iOS-SDK-Extension-ObjC" ``` -------------------------------- ### Start SDK with API Key (Objective-C) Source: https://doc.batch.com/developer/sdk/ios/advanced/migration-guides/2x-migration Replace calls to the old 'Batch' module with 'BatchSDK' when starting the SDK in Objective-C. ```objective-c [BatchSDK startWithAPIKey:@"MY_API_KEY"]; ``` -------------------------------- ### Batch Messaging Delegate - Swift Implementation Example Source: https://doc.batch.com/developer/sdk/ios/advanced/migration-guides/3x-migration Example implementation of the BatchMessagingDelegate protocol in Swift, demonstrating how to handle message appearance, action triggers, cancellations, and disappearances with the updated methods. ```swift import UIKit import BatchSDK // Application delegate setup // var messagingDelegate = MsgDelegate() // func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // BatchMessaging.delegate = inAppMsgDelegate // } // BatchMessagingDelegate implementation class SampleBatchMessagingDelegate: NSObject, BatchMessagingDelegate { public func batchMessageDidAppear(messageIdentifier: String?) { print("SampleBatchMessagingDelegate - batchMessageDidAppear: \(messageIdentifier)") } public func batchMessageDidTriggerAction(_ action: BatchMessageAction, messageIdentifier identifier: String?, actionIndex index: Int) { print("SampleBatchMessagingDelegate - batchMessageDidTriggerAction: \(messageIdentifier)") } public func batchWebViewMessageDidTriggerAction(_ action: BatchMessageAction?, messageIdentifier: String?, analyticsIdentifier: String?) { print("SampleBatchMessagingDelegate - batchWebViewMessageDidTriggerAction \(String(describing:action)), tracking ID: \(messageIdentifier ?? \""), analyticsIdentifier: \(analyticsIdentifier ?? \"")") } public func batchMessageWasCancelledByAutoclose(_ messageIdentifier: String?) { print("SampleBatchMessagingDelegate - batchMessageWasCancelledByAutoclose: \(messageIdentifier)") } public func batchMessageWasCancelledByUserAction(_ messageIdentifier: String?) { print("SampleBatchMessagingDelegate - batchMessageWasCancelledByUserAction: \(messageIdentifier)") } public func batchMessageWasCancelledByError(_ messageIdentifier: String?) { print("SampleBatchMessagingDelegate - batchMessageWasCancelledByError: \(messageIdentifier)") } public func batchMessageDidDisappear(messageIdentifier: String?) { print("SampleBatchMessagingDelegate - batchMessageDidDisappear: \(messageIdentifier)") } } ``` -------------------------------- ### Batch Messaging Delegate - Objective-C Implementation Example Source: https://doc.batch.com/developer/sdk/ios/advanced/migration-guides/3x-migration Example implementation of the BatchMessagingDelegate protocol in Objective-C, showing how to set the delegate and implement the required methods for handling message events. ```objective-c // AppDelegate.m // @property SampleBatchMessagingDelegate *messagingDelegate // // - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions // { // self.messagingDelegate = [SampleBatchMessagingDelegate new]; // BatchMessaging.delegate = self.messagingDelegate; // } // // // Header file (.h) // @interface SampleBatchMessagingDelegate : NSObject // // @end // // // Implementation file (.m) // // @implementation SampleBatchMessagingDelegate // // - (void)batchMessageDidAppear:(NSString* _Nullable)messageIdentifier // { // NSLog(@"SampleBatchMessagingDelegate - batchMessageDidAppear: %@", messageIdentifier); // } // // - (void)batchMessageDidTriggerAction:(BatchMessageAction * _Nonnull)action messageIdentifier:(NSString *)identifier actionIndex:(NSInteger)index // { // NSLog(@"SampleBatchMessagingDelegate - batchMessageDidTriggerAction: %@", messageIdentifier); // } // // - (void)batchWebViewMessageDidTriggerAction:(BatchMessageAction * _Nonnull)action messageIdentifier:(NSString *)identifier analyticsIdentifier:(NSString *)analyticsIdentifierex // { // NSLog(@"SampleBatchMessagingDelegate - batchWebViewMessageDidTriggerAction: %@", messageIdentifier); // } // // - (void)batchMessageWasCancelledByAutoclose:(NSString * _Nullable)messageIdentifier // { // NSLog(@"SampleBatchMessagingDelegate - batchWebVbatchMessageWasCancelledByAutocloseiewMessageDidTriggerAction: %@", messageIdentifier); // } // // - (void)batchMessageWasCancelledByUserAction:(NSString * _Nullable)messageIdentifier // { // NSLog(@"SampleBatchMessagingDelegate - batchMessageWasCancelledByUserAction: %@", messageIdentifier); // } // // - (void)batchMessageWasCancelledByError:(NSString * _Nullable)messageIdentifier // { // NSLog(@"SampleBatchMessagingDelegate - batchMessageWasCancelledByError: %@", messageIdentifier); // } // // - (void)batchMessageDidDisappear:(NSString * _Nullable)messageIdentifier // { // NSLog(@"SampleBatchMessagingDelegate - batchMessageDidDisappear: %@", messageIdentifier); // } // // @end ``` -------------------------------- ### Batch iOS SDK - Initial Setup Source: https://context7_llms Guides for setting up the Batch SDK for iOS, including prerequisites and integration steps. Covers initial configuration and essential requirements for using the SDK. ```APIDOC /developer/sdk/ios.md Description: Overview of the Batch iOS SDK. ``` ```APIDOC /developer/sdk/ios/prerequisites.md Description: Lists the prerequisites for integrating the iOS SDK. ``` ```APIDOC /developer/sdk/ios/sdk-integration.md Description: General guide for integrating the iOS SDK. ``` ```APIDOC /developer/sdk/ios/sdk-integration/initial-setup.md Description: Step-by-step instructions for the initial setup of the iOS SDK. ``` -------------------------------- ### Batch Android SDK - Initial Setup Source: https://context7_llms Guides for setting up the Batch SDK for Android, including prerequisites and integration steps. Covers initial configuration and essential requirements for using the SDK. ```APIDOC /developer/sdk/android.md Description: Overview of the Batch Android SDK. ``` ```APIDOC /developer/sdk/android/prerequisites.md Description: Lists the prerequisites for integrating the Android SDK. ``` ```APIDOC /developer/sdk/android/sdk-integration.md Description: General guide for integrating the Android SDK. ``` -------------------------------- ### Get Installation ID Source: https://doc.batch.com/developer/sdk/android/profile-data/debug Retrieves the unique installation ID for a device using the Batch SDK. This ID is crucial for identifying specific devices for debugging and support purposes. The SDK automatically copies this ID to the clipboard under certain backgrounding/foregrounding conditions starting from Batch version 1.18. ```Kotlin Batch.User.getInstallationID() ``` ```Java Batch.User.getInstallationID(); ``` -------------------------------- ### Get Installation ID Source: https://doc.batch.com/developer/technical-guides/how-to-guides/mobile/in-app-webview Retrieves the unique installation ID for the current session. This ID is essential for identifying specific app installations. ```javascript batchInAppSDK.getInstallationID().then(installationID => /* ... */) ``` -------------------------------- ### SDK Integration Sample Projects Source: https://doc.batch.com/getting-started/other/implementation-guides/integration-steps Links to sample projects for SDK integration on iOS, Android, React Native, and Flutter. ```ios Sample project: https://github.com/BatchLabs/Batch-iOS-SDK-Sample ``` ```android Sample project: https://github.com/BatchLabs/Batch-Android-SDK-Sample ``` ```react-native Sample project: https://github.com/BatchLabs/Batch-ReactNative-Plugin-Sample ``` ```flutter Sample project: https://github.com/BatchLabs/Batch-Flutter-Plugin/tree/master/example ``` -------------------------------- ### Find Android Installation ID Source: https://doc.batch.com/developer/technical-guides/how-to-guides/mobile Explains how to easily find the Installation ID on an Android device using the 'Find my Installation' feature or the Terminal application. ```android You can easily find your Installation ID with the "Find my Installation" feature on Android or using the Terminal application. ``` -------------------------------- ### Implementation Guides - Migration Source: https://context7_llms Guides for migrating from existing systems to Batch, including mobile push migration and testing strategies. ```markdown - [How to migrate Mobile Push to Batch?](/getting-started/other/implementation-guides/migration.md) - [Testing](/getting-started/other/implementation-guides/migration/testing.md) - [Campaigns migration](/getting-started/other/implementation-guides/migration/campaigns-migration.md) ``` -------------------------------- ### Find iOS Installation ID Source: https://doc.batch.com/developer/technical-guides/how-to-guides/mobile Details methods for locating the Installation ID on an iOS device, utilizing the 'Find my installation' feature or Mac Console. ```ios This guide explains how to find your Installation ID on an iOS device using the "Find my installation" feature or the Mac Console. ``` -------------------------------- ### How-to Guides Source: https://context7_llms Practical guides for implementing specific features and solving common challenges, such as choosing a custom user ID and thematic push opt-ins. ```APIDOC How to choose the right Custom User ID to use in Batch? - Description: Guidance on selecting an appropriate identifier for users to ensure accurate tracking and personalization. - Best Practices: - Use a stable, unique identifier. - Avoid PII where possible. How to implement thematic push opt-ins? - Description: Enables users to subscribe to specific push notification themes within the app. - Implementation: - Define themes in your app. - Use Batch's segmentation and targeting features based on user subscriptions. - Example: `Batch.User.setSubscription('news', true);` ``` -------------------------------- ### Install batch_flutter Source: https://doc.batch.com/developer/sdk/flutter/sdk-integration Installs the batch_flutter package using the Flutter package manager. ```shell flutter pub add batch_flutter ``` -------------------------------- ### Get Installation ID Source: https://doc.batch.com/developer/sdk/android/huawei Retrieves the Installation ID for the current app installation on a device. This ID is useful for debugging and sending test notifications. ```kotlin Batch.User.getInstallationID() ``` ```java Batch.User.getInstallationID(); ``` -------------------------------- ### Web SDK Migration Guides Source: https://context7_llms Guides for migrating the Web SDK from previous versions, covering v2 to v3 and v3 to v4. ```markdown - [Migrating from v2](/developer/sdk/web/advanced/2x-migration.md) - [Migrating from v3](/developer/sdk/web/advanced/3x-migration.md) ``` -------------------------------- ### Retrieve Installation ID Source: https://doc.batch.com/developer/sdk/android/sdk-integration Retrieves the unique Installation ID for the app's installation on a device. This ID is useful for debugging and sending test notifications. ```java Batch.User.getInstallationID(); ``` -------------------------------- ### Onboarding Campaigns Example Source: https://doc.batch.com/getting-started/features/mobile-engagement-platform/push/timing-delivery Illustrates the use of trigger campaigns for onboarding new users. Suggestions include sending welcome offers or directing users to popular content shortly after their first session. ```APIDOC Use Case: Onboarding Campaigns - Triggered shortly after the user's first session (minutes, hours, or up to 7 days later). - E-commerce App Example: - Send a welcome promocode. - Direct users to popular items. - Media App Example: - Direct users to trending articles. - Invite users to a free premium subscription trial. - Focus on important initial actions: - Account creation. - Feed personalization. ``` -------------------------------- ### cURL Example for Get All Requests Source: https://doc.batch.com/developer/api/mep/gdpr/get-all-requests Demonstrates how to call the GDPR API to retrieve all requests using cURL. ```bash 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" ``` -------------------------------- ### Install Batch React-Native Plugin Source: https://doc.batch.com/developer/sdk/react-native/sdk-integration/vanilla-integration Installs the Batch React-Native plugin using Yarn or NPM. ```sh yarn add @batch.com/react-native-plugin ``` ```sh npm install @batch.com/react-native-plugin ``` -------------------------------- ### Standard Batch Service Worker Setup Source: https://doc.batch.com/developer/sdk/web/getting-started/batch-service-worker This snippet details the standard procedure for setting up the Batch Service Worker. It involves downloading the SDK, placing the `batchsdk-worker-loader.js` file in the website's root directory, and adhering to specific serving requirements like HTTPS and Content-Type. ```html ``` ```javascript // Download the SDK ZIP from https://download.batch.com/sdk/web/BatchSDK-web-4.1.2.zip // Extract the zip file and upload 'batchsdk-worker-loader.js' to your website's root. ``` -------------------------------- ### Success Response Example Source: https://doc.batch.com/developer/api/mep/gdpr/get-all-requests An example of a successful response from the GDPR API, containing an array of GDPR request objects. ```json [ { "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" } } ] ``` -------------------------------- ### Add SDK via Carthage Source: https://doc.batch.com/developer/sdk/ios/sdk-integration/initial-setup Instructions for adding the Batch iOS SDK to your project using Carthage. Requires Carthage 0.30 or higher. Includes adding the repository to the Cartfile. ```bash github "BatchLabs/Batch-iOS-SDK" ``` -------------------------------- ### Batch SDK Integration Documentation Source: https://doc.batch.com/getting-started/other/implementation-guides/migration Links to the specific SDK integration guides for various platforms, including iOS, Android, Cordova, Flutter, and React Native. These guides are essential for setting up the Batch SDK within your mobile application. ```ios https://app.gitbook.com/s/CL8wF0y1T2vLnm3yR2MW/sdk/ios ``` ```android https://app.gitbook.com/s/CL8wF0y1T2vLnm3yR2MW/sdk/android ``` ```cordova https://app.gitbook.com/s/CL8wF0y1T2vLnm3yR2MW/sdk/cordova ``` ```flutter https://app.gitbook.com/s/CL8wF0y1T2vLnm3yR2MW/sdk/flutter ``` ```react-native https://app.gitbook.com/s/CL8wF0y1T2vLnm3yR2MW/sdk/react-native ``` -------------------------------- ### Batch In-App Automation Campaign Setup Source: https://doc.batch.com/getting-started/channels/in-app This guide explains how to set up an In-App automation campaign. It covers naming the campaign, defining audience targeting conditions, setting trigger actions based on tagged events, and configuring campaign parameters like priority, capping, grace period, and start/end dates. ```APIDOC Campaign Creation: Navigate to Automations > iOS or Android > Create a New Campaign. Audience Targeting: Define conditions for user segmentation. Enable 'Re-evaluation just before display' for dynamic targeting. Trigger Action Setup: Select a tagged and tracked event from the Batch SDK as the trigger. Campaign Parameters: - Priority: Set precedence if multiple campaigns share a trigger. - Capping (optional): Limit message display frequency per user. - Grace Period (optional): Define minimum delay between message displays. - Start/End Date: Schedule the campaign's active window. ``` -------------------------------- ### Get Installation ID Source: https://doc.batch.com/developer/sdk/react-native/profile-data/debug Retrieves the unique Installation ID for a device using the Batch SDK. This ID is crucial for identifying a specific installation in the Batch debug tool and for troubleshooting push notification issues. ```javascript const iid = await BatchUser.getInstallationID(); ``` -------------------------------- ### Batch 2FA Setup Guide Source: https://doc.batch.com/getting-started/using-two-factor-authentication-2fa-to-secure-your-account This documentation outlines the steps to enable and use Two-Factor Authentication (2FA) on the Batch platform. It includes instructions on navigating security settings, scanning QR codes with authenticator apps, and verifying codes. It also provides links to recommended 2FA applications for iOS and Android. ```APIDOC Batch Account Security - Two-Factor Authentication (2FA) Purpose: To enhance account security by adding an extra layer of verification. Process: 1. Navigate to Account Settings -> Security. 2. Enable Two-Factor Authentication. 3. Scan the provided QR code with your preferred 2FA mobile app (e.g., Authy, Duo Mobile, Google Authenticator, Microsoft Authenticator). 4. Enter the code generated by your 2FA app into the Batch dashboard to complete setup. Recommended 2FA Apps: - Authy: - iOS: https://apps.apple.com/us/app/authy/id494168017 - Android: https://play.google.com/store/apps/details?id=com.authy.authy&hl=en - Duo Mobile: - iOS: https://apps.apple.com/us/app/duo-mobile/id422663827 - Android: https://play.google.com/store/apps/details?id=com.duosecurity.duomobile - Google Authenticator: - iOS: https://apps.apple.com/us/app/google-authenticator/id388497605 - Android: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 - Microsoft Authenticator: - iOS: https://apps.apple.com/us/app/microsoft-authenticator/id983156458 - Android: https://play.google.com/store/apps/details?id=com.azure.authenticator Note: The 'Team' section in the Account Manager provides insights into team members who have enabled 2FA. ``` -------------------------------- ### Get Campaign Stats API Endpoint Source: https://doc.batch.com/developer/api/mep/campaigns/get This section documents the GET endpoint for retrieving campaign statistics. It specifies the route, required headers for authentication, and provides examples in cURL, PHP, and Python. ```APIDOC GET /1.1/BATCH_API_KEY/campaigns/stats/CAMPAIGN_TOKEN Description: Retrieves statistics for a specific campaign using its token. Parameters: BATCH_API_KEY: Your Live Batch API key. CAMPAIGN_TOKEN: The token of the campaign to retrieve stats for. Headers: Content-Type: application/json X-Authorization: BATCH_REST_API_KEY (Your company REST API Key) Responses: Success (200 OK): Campaign statistics including sent, opens, re-engagements, and errors. For A/B tests, includes detailed stats per version. Failure: AUTHENTICATION_INVALID (401, 10) API_MISUSE (403, 12) ROUTE_NOT_FOUND (404, 20) SERVER_ERROR (500, 0) TOO_MANY_REQUESTS (429, 60) Open Rate Calculation: open-rate = (direct_open + influenced_open) / sent ``` ```bash curl -X GET "https://api.batch.com/1.1/BATCH_API_KEY/campaigns/stats/CAMPAIGN_TOKEN" \ -H "Content-Type: application/json" \ -H "X-Authorization: BATCH_REST_API_KEY" ``` ```php use GuzzleHttp\Client; $client = new Client(); $response = $client->request("GET", "https://api.batch.com/1.1/BATCH_API_KEY/campaigns/stats/CAMPAIGN_TOKEN", [ "headers" => [ "Content-Type" => "application/json", "X-Authorization" => "BATCH_REST_API_KEY" ] ]); ``` ```python import requests, json response = requests.request("GET", "https://api.batch.com/1.1/BATCH_API_KEY/campaigns/stats/CAMPAIGN_TOKEN", headers={ 'Content-Type': 'application/json' 'X-Authorization': 'BATCH_REST_API_KEY' } ) ``` -------------------------------- ### Retrieve Installation ID Source: https://doc.batch.com/developer/sdk/android/troubleshooting Demonstrates how to get the unique installation ID generated by Batch for debugging purposes. This ID can be used in the Batch debug tool to identify specific app installs and send test notifications. ```Kotlin Batch.User.getInstallationID() ``` -------------------------------- ### Automations Migration Schedule Example Source: https://doc.batch.com/guides-and-best-practices/email-deliverability/domain-and-ip-warm-up/step-5-warmup-schedule An example table illustrating a migration schedule for email automations, detailing stages, emails sent per day, and performance metrics like bounce rate, open rate, click rate, and unsubscribe rate. It highlights transactional subdomain details and warmup goals. ```text Transactional subdomain: service.domain.com Warm-up goal: 1400 emails/day Estimated migration time: 3 days | Stage # | Emails sent/day | Bounce rate | Open rate | Click rate | Unsubscribe rate | |---|---|---|---|---|---| | Stage 1 | 200 | -% | -% | -% | -% | | Password reset | 100 | -% | -% | -% | -% | | New login | 50 | -% | -% | -% | -% | | Invite sent | 50 | -% | -% | -% | -% | | Stage 2 | 400 | -% | -% | -% | -% | | Validated order | 400 | -% | -% | -% | -% | | Stage 3 | 800 | -% | -% | -% | -% | | Delivery in progress | 600 | -% | -% | -% | -% | | Registration confirmation | 200 | -% | -% | -% | -% | | Cumulated total | 1400 | | | | | ``` -------------------------------- ### Retrieve Installation ID Source: https://doc.batch.com/developer/sdk/android/troubleshooting Demonstrates how to get the unique installation ID generated by Batch for debugging purposes. This ID can be used in the Batch debug tool to identify specific app installs and send test notifications. ```Java Batch.User.getInstallationID(); ``` -------------------------------- ### Implementation Guides - Web Push & SMS Source: https://context7_llms Instructions for implementing web push notifications and sending SMS messages using Batch. ```markdown - [How to implement Web Push with Batch?](/getting-started/other/implementation-guides/integration-steps-web.md) - [How to implement and send SMS with Batch?](/getting-started/other/implementation-guides/how-can-i-implement-and-send-sms-with-batch.md): A step-by-step guide on how to set up and start sending SMS with Batch from defining your campaign goals to sending them to your users. ``` -------------------------------- ### API Migration Guide Source: https://context7_llms Guidance on switching from the Transactional API to the Profile API within Batch. ```markdown - [How to switch from the Transactional API to the Profile API?](/getting-started/other/implementation-guides/how-to-switch-from-the-transactional-api-to-the-profile-api.md) ``` -------------------------------- ### Batch Extension SDK Installation (SPM) Source: https://doc.batch.com/developer/sdk/react-native/sdk-integration/rich-notifications-setup Instructions for installing the Batch iOS SDK Extension using Swift Package Manager. ```bash https://github.com/BatchLabs/Batch-iOS-SDK-Extension-ObjC.git ``` -------------------------------- ### Rich Push Notifications Setup Source: https://doc.batch.com/getting-started/other/implementation-guides/integration-steps Instructions for implementing rich push notifications on iOS, Flutter, React Native, and Cordova platforms. ```ios Setup guide: https://doc.batch.com/developer/sdk/ios/sdk-integration/rich-notifications-setup ``` ```flutter Setup guide: https://doc.batch.com/developer/sdk/flutter/sdk-integration/#rich-notifications ``` ```react-native Setup guide: https://doc.batch.com/developer/sdk/react-native/sdk-integration/rich-notifications-setup ``` ```cordova Setup guide: https://doc.batch.com/developer/sdk/cordova/sdk-integration/#ios-setup ``` -------------------------------- ### Get Inbox Fetcher for Installation Source: https://doc.batch.com/developer/sdk/flutter/inbox Retrieves an Inbox Fetcher instance for the current app installation. This mode is suitable for applications without a user login system. It fetches notifications specific to the app's installation data. ```dart var inboxFetcher = await BatchInbox.instance.getFetcherForInstallation(); // inboxFetcher.dispose() - Call this once you're done with it, to free native memory. ``` -------------------------------- ### Get Installation ID Source: https://doc.batch.com/developer/sdk/web/testing-integration Retrieves the installation ID of the device and logs it to the browser's debug console. This method is part of the Batch SDK API. ```javascript batchSDK((api) => { api.getInstallationID().then((id) => { console.log(id) }) }) ``` -------------------------------- ### Web Push Integration Guides Source: https://context7_llms Guides on integrating Batch web push notifications into your website, including checking tag availability, managing push preferences, and integrating with platforms like Salesforce Commerce Cloud. ```JavaScript // Example: Checking Batch JavaScript tag availability if (window.Batch && window.Batch.isInitialized()) { console.log('Batch JavaScript tag is available and initialized.'); } else { console.error('Batch JavaScript tag is not available or not initialized.'); } ``` -------------------------------- ### cURL Request Example Source: https://doc.batch.com/developer/api/mep/transactional/stats Example of how to call the Batch Transactional Stats API using cURL, including the GET method, endpoint, parameters, and headers. ```bash curl -X GET "https://api.batch.com/1.1/BATCH_API_KEY/transactional/stats/GROUP_ID?since=2018-03-01&until=2018-03-10" \ -H "Content-Type: application/json" \ -H "X-Authorization: BATCH_REST_API_KEY" ``` -------------------------------- ### Batch Export API - cURL Example for Request Status Source: https://doc.batch.com/developer/api/mep/export/get-status Example of how to use cURL to get the status of an export request from the Batch API. ```curl curl -H "Content-Type: application/json" \ -H "X-Authorization: BATCH_REST_API_KEY" \ -X GET "https://api.batch.com/1.0/BATCH_API_KEY/export/request/REQUEST_ID" ``` -------------------------------- ### Mobile Engagement Platform - Settings Source: https://context7_llms Guides for configuring app settings, account settings, and company settings within the Mobile Engagement Platform. ```markdown - [Settings](/getting-started/features/mobile-engagement-platform/settings.md) - [App Settings](/getting-started/features/mobile-engagement-platform/settings/app-settings.md) - [Account Settings](/getting-started/features/mobile-engagement-platform/settings/account-settings.md) - [Company Settings](/getting-started/features/mobile-engagement-platform/settings/company-settings.md) ```