### Start an anonymous session Source: https://docs.pulsatehq.com/v2.7.2/reference/managing-pulsate-sessions Initiates a session using the device's unique GUID. This method is suitable for users who are not identified by a persistent alias. ```swift pulsateManager.startPulsateSession { success, error in if let error = error { print("Session failed: \(error)") } } ``` -------------------------------- ### Initialize and Start Pulsate Session Source: https://docs.pulsatehq.com/v2.8.3/docs/quick-start-guide-1 Initializes the Pulsate SDK in the Application class and starts a user session from an Activity or Fragment. ```kotlin // 1. Application class — initialize with your credentials class MyApp : Application() { override fun onCreate() { super.onCreate() PulsateFactory.getInstance(PulsateAuthData(APP_ID, APP_KEY)) } } // 2. First screen after login — start the session for your user val pulsateManager = PulsateFactory.getInstance() pulsateManager.startPulsateSessionForAlias( "unique-user-id-in-your-system", object : IPulsateRequestListener { override fun onSuccess() { /* session started */ } override fun onError(e: Throwable?) { /* handle error */ }, }, ) ``` -------------------------------- ### Geofences Index Response Example Source: https://docs.pulsatehq.com/v2.2/reference/geofences-index Example JSON response returned by the geofences index endpoint. ```json { "data": [ { "id": "67f660b5a46a6f7d4ade58a9", "name": "test 2", "created_at": "2025-04-09T11:57:41Z", "updated_at": "2025-04-09T11:57:41Z", "guid": "8dt-UF9i", "groups": [], "location": [ 33.69352607, 73.04613069 ], "type": "enter", "shape": "circle", "radius": 1517, "radius_unit": "feet" }, { "id": "67f65feca46a6f7d4ade58a3", "name": "test", "created_at": "2025-04-09T11:54:20Z", "updated_at": "2025-04-09T11:54:23Z", "guid": "aAhY8ycl", "groups": [], "location": [ 33.71390302, 73.03544477 ], "type": "enter", "shape": "circle", "radius": 4099, "radius_unit": "feet" } ], "bulk_actions": { "delete": "/api/v2/apps/67e2b7f5a46a6fb2be317885/geofences/batch_destroy", "add_to_group": "/api/v2/apps/67e2b7f5a46a6fb2be317885/groups/add_resources", "remove_from_group": "/api/v2/apps/67e2b7f5a46a6fb2be317885/groups/remove_resources" }, "metadata": { "page": 1, "per_page": 1000, "total_pages": 1, "data_count": 2, "groups": [], "location": [ 33.69, 73.0551 ], "min_radius": 50, "max_radius": 2000, "export_link": "/api/v2/apps/67e2b7f5a46a6fb2be317885/geofences/export" } } ``` -------------------------------- ### startPulsateSession() Source: https://docs.pulsatehq.com/v2.7.2/reference/managing-pulsate-sessions Starts an anonymous session using a Device GUID. This method should be used when you do not need to track a specific user identity across multiple devices. ```APIDOC ## startPulsateSession() ### Description Starts an anonymous session for the current device. The SDK uses a Device GUID to identify the user. ### Signature `pulsateManager.startPulsateSession(completion: (Bool, Error?) -> Void)` ### Parameters - **completion** (closure) - Required - A completion handler that returns a success boolean and an optional error object. ``` -------------------------------- ### Application Configuration JSON Example Source: https://docs.pulsatehq.com/v2.2/reference/apps-create A sample JSON object representing the full application configuration state. ```json { "banno_configuration": { "client_id": null, "client_secret": null, "institution_id": null, "public_key": null }, "custom_attributes_enabled": false, "hubspot": { "connected": false, "selected_fields": null, "contacts_sync_status": null }, "diid": null, "download_opportunity_files": { "app_file": true, "performance_files": true }, "ff_banno_push_send_to_url": false, "ff_beacons_enabled": true, "ff_campaigns_goals_enabled": false, "ff_card_disabled": false, "ff_change_notification_button_colors": false, "ff_concat_custom_attributes": false, "ff_core_member_id_upload": false, "ff_csv_users_upload": false, "ff_cunexus_enabled": false, "ff_dashboard_beta": true, "ff_demo_mode": false, "ff_email_enabled": false, "ff_emojis_enabled": true, "ff_excluded_from_cron_jobs_enabled": false, "ff_external_goal_file_upload_section": false, "ff_feed_post_plus_notification": true, "ff_geofences_enabled": true, "ff_infra_report_service_read": false, "ff_infra_report_service_send": false, "ff_infra_user_service_send": false, "ff_journeys_enabled": false, "ff_messages": false, "ff_notifications_extra_buttons_enabled": true, "ff_old_app_and_device_stats": false, "ff_opportunities_dashboard": false, "ff_opportunities_stats": false, "ff_pulsate_beta": true, "ff_push": true, "ff_push_ab_testing_enabled": true, "ff_push_notifications_full_access_enabled": true, "ff_push_rich_media": true, "ff_q2_in_app_enabled": false, "ff_small_in_app": true, "ff_sms_delivery": false, "ff_sms_enabled": false, "ff_web_sdk": false, "geofence_setting": { "geofence_feet_unit": true, "max_radius": 6561, "min_radius": 165 }, "http_webhooks_enabled": false, "icon": "https://pulsate-media-bucket-production.s3.eu-west-1.amazonaws.com/default-app-image.png", "id": "67e2a0d88785f8d9d8a8f6d1", "image": "https://pulsate-media-bucket-production.s3.eu-west-1.amazonaws.com/default-app-image.png", "installed": false, "name": "muzzz app 17", "oe_range_in_days": [ 7, 30, 90 ], "parent_company": null, "range_days": null, "verified_email_addresses": [] } ``` -------------------------------- ### Export Geofences via cURL Source: https://docs.pulsatehq.com/v2.2/reference/geofences-export-all Example request to export geofences using the cURL command-line tool. ```curl curl --request GET \ --url 'https://control.pulsatehq.com/api/v2/apps/{app_id}/geofences/export?from=2020-01-01&to=2021-06-16' \ --header 'authorization: Token token={my_admin_api_token}' \ --header 'content-type: application/json' ``` -------------------------------- ### cURL Request for Batch Resume Source: https://docs.pulsatehq.com/v2.2/reference/campaigns-batch-resume Example cURL command to perform a PUT request to resume campaigns. ```curl curl --request PUT \ --url https://control.pulsatehq.com/api/v2/apps/{app_id}/campaigns/batch_resume \ --header 'authorization: Token token={my_admin_api_token}' \ --header 'content-type: application/json' \ --data '{ "resource_ids": ["{CAMPAIGN_ID}"] }' ``` -------------------------------- ### Campaign JSON Response Example Source: https://docs.pulsatehq.com/v2.2/reference/campaigns-show-1 A sample JSON object representing a delivered push notification campaign. ```json { "id": "67da9d92a46a6f8e1137b7be", "name": "test push", "author_name": "John Smith Jr.fff", "allow_reply": false, "broadcast_type": "segment", "beacon_events": null, "beacon_ids": [], "beacon_dwelling_times": null, "campaign_expiry": false, "campaign_limits": false, "card_notification": null, "control_group": null, "created_at": "2025-03-19T10:33:54Z", "delivered_at": "2025-03-19T10:34:27+00:00", "delivery": "current", "display_type": "Push", "dispatch_rate": 100, "duplication_source_id": "", "email_notification": null, "end_at": null, "expiry_date": null, "expiry_time_frame": "hours", "expiry_time_value": null, "geofence_events": null, "geofence_ids": [], "geofence_dwelling_times": null, "goals_attributes": [ { "primary": true, "event_kind": "open_app", "expiry_time_unit": "hours", "expiry_time_value": 1, "event_identifier": null } ], "group_ids": [], "guid": "yD7iwQyP", "hidable": false, "hidden": false, "hidden_at": null, "hidden_from_feed": false, "in_app_event_names": [], "in_app_notification": {}, "last_builder_page": "1", "push_variants": [ { "active_fields": { "buttons": false, "title_template": true, "subtitle_template": false }, "attachment": { "url": null, "provider": null, "data": {}, "active": false }, "body_template": "Test Push Body", "button_category_id": null, "buttons": [], "category": "PULDefaultCategory", "destination": null, "destination_type": "openapp", "subtitle_template": null, "title_template": "Test Push" } ], "segment_ids": [ "67da9d76a46a6f8e1137b7b5" ], "sms_notification": null, "start_at": "2025-03-19T10:34:20+00:00", "start_now": true, "status": "Delivered", "target": { "events": { "details": [], "count": 0 }, "geofences": { "details": [], "count": 0 }, "segments": { "details": [ { "id": "67da9d76a46a6f8e1137b7b5", "name": "muz" } ], "count": 1 }, "beacons": { "details": [], "count": 0 } }, "time_frame": null, "time_value": null, "time_zone_name": "Asia/Karachi", "time_zone_offset": "+05:00", "time_windows": [], "type": "PushNotificationCampaign", "type_list": [ "push" ], "updated_at": "2025-03-19T10:34:27Z" } ``` -------------------------------- ### cURL Request for Beacons Export Source: https://docs.pulsatehq.com/v2.2/reference/beacons-export Example cURL command to perform a GET request to the beacons export endpoint. ```curl curl --request GET \ --url 'https://control.pulsatehq.com/api/v2/apps/{app_id}/beacons/export?from=2020-01-01&to=2021-06-16' \ --header 'authorization: Token token={my_admin_api_token}' \ --header 'cache-control: no-cache' \ --header 'content-type: application/json' ``` -------------------------------- ### Initialize SDK using Info.plist Source: https://docs.pulsatehq.com/v2.7.2/docs/running-the-pulsate-sdk Use this initializer when App ID and App Key are stored in the Info.plist under a Pulsate dictionary. ```Swift let pulsateManager = try PULPulsateFactory.getInstance( withLaunchOptions: launchOptions) ``` -------------------------------- ### startLocation() Source: https://docs.pulsatehq.com/v2.7.2/docs/pulsatemanager-methods Enables location services if they were deferred during initialization, triggering the location prompt. ```APIDOC ### Method `func startLocation()` ### Description If you deferred location at init, enable it later (defers the location prompt until now). ``` -------------------------------- ### cURL Request for Create Web SDK Key Source: https://docs.pulsatehq.com/v2.2/reference/apps-create-web-sdk-key Example command to invoke the endpoint using cURL. ```curl curl --request POST \ --url https://control.pulsatehq.com/api/v2/apps/{app_id}/create_web_sdk_key \ --header 'Authorization: Token token={my_admin_api_token}' ``` -------------------------------- ### Segment Update Response Example Source: https://docs.pulsatehq.com/v2.2/reference/segments-update Example JSON response for a successful segment update operation. ```json { "segment": { "name": "Alias Not John", "groups": [ { "join_type": "+", "rules": [ { "type": "alias", "match_value": "john", "match_type": "not_equal" } ] } ], "id": "segment_id" } } ``` -------------------------------- ### Manage login state with convenience methods Source: https://docs.pulsatehq.com/v2.8.3/docs/inbox-authorization Use these methods to bundle authorization, in-app message toggling, and action replaying during login and logout events. ```kotlin val pulsateManager = PulsateFactory.getInstance() // After a successful login: pulsateManager.userHasLoggedIn() // → enables in-app messages, shows the last bounced in-app, // marks the user authorized, replays the last blocked inbox action // When the user logs out (or your app locks itself): pulsateManager.userHasLoggedOut() // → disables in-app messages, marks the user unauthorized ``` -------------------------------- ### Troubleshoot CocoaPods installation Source: https://docs.pulsatehq.com/v2.7.2/reference/ios-sdk-release-notes Run these commands in sequence if you encounter issues finding compatible versions for the PULPulsate pod. ```bash pod repo update pod deintegrate pod install --repo-update pod update --repo-update ``` -------------------------------- ### POST /apps/{app_id}/beacons/batch_create Source: https://docs.pulsatehq.com/v2.2/reference/beacons-batch-create Create beacons in batch by uploading a CSV file. ```APIDOC ## POST /apps/{app_id}/beacons/batch_create ### Description Create beacons in batch. ### Method POST ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/beacons/batch_create ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app #### Request Body - **csv_file** (string) - Required - CSV file with list af beacons ### Response #### Success Response (200) - **{}** (object) - Success response #### Error Response (400) - **{}** (object) - Error response ``` -------------------------------- ### Start Pulsate Session for Alias Source: https://docs.pulsatehq.com/v2.8.3/docs/pulsate-sessions-1 Start a session using a unique user identifier. This must be called from an Activity or Fragment, not the Application class. ```Kotlin val pulsateManager = PulsateFactory.getInstance() pulsateManager.startPulsateSessionForAlias( "unique-user-id-in-your-system", object : IPulsateRequestListener { override fun onSuccess() { // Session is active — safe to send user data now } override fun onError(e: Throwable?) { // Handle failure (no network, invalid credentials, ...) } }, ) ``` -------------------------------- ### Delay session start Source: https://docs.pulsatehq.com/v2.7.2/reference/managing-pulsate-sessions Initializes the Pulsate manager on app launch but defers starting the session until a specific condition, such as user authentication, is met. ```swift import PULPulsate @main class AppDelegate: UIResponder, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { do { let authData = try PULAuthorizationData( withAppId: "YOUR_SDK_APP_ID", andAppKey: "YOUR_SDK_APP_KEY") let pulsateManager = try PULPulsateFactory.getInstance( withAuthorizationData: authData, withLaunchOptions: launchOptions) if userLoggedIn { pulsateManager.startPulsateSession { _, _ in } } } catch { print(error) } return true } } ``` -------------------------------- ### POST /apps/{app_id}/geofences/batch_create Source: https://docs.pulsatehq.com/v2.2/reference/geofence-batch-create Create multiple geofences at once for a specified application. ```APIDOC ## POST /apps/{app_id}/geofences/batch_create ### Description Create multiple geofences at once for a specified application. ### Method POST ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/geofences/batch_create ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app #### Request Body - **submission_type** (string) - Required - it can be either file or manual - **csv_file** (string) - Optional - CSV file with list of geofences - **geofences** (object) - Optional - Object containing geofence details (name, location, shape, radius, path) ### Response #### Success Response (200) - **(object)** - Empty object indicating success ``` -------------------------------- ### startLocation() Source: https://docs.pulsatehq.com/v2.7.2/reference/location-settings Triggers the system location permission prompt. This should be called at an appropriate point in the user flow, ideally after a priming screen, to request 'Always' authorization. ```APIDOC ## startLocation() ### Description Requests location permissions from the user. This method triggers the system prompt for 'Always' location authorization. ### Signature `pulsateManager.startLocation()` ``` -------------------------------- ### Send User Data After Session Start Source: https://docs.pulsatehq.com/v2.7.2/docs/custom-user-data Ensure user data is sent only after a successful session start by using the completion handlers for anonymous or identified sessions. ```Swift // Anonymous session manager.startPulsateSession { success, error in guard success else { return } manager.updateFirstName("John") manager.updateLastName("Smith") manager.updateEmail("p@pulsatehq.com") manager.updatePhoneNumber("+14085551234") } ``` ```Swift // Identified session (alias) manager.startPulsateSession(forAlias: "user-alias") { success, error in guard success else { return } manager.updateFirstName("John") manager.updateLastName("Smith") manager.updateEmail("p@pulsatehq.com") manager.updatePhoneNumber("+14085551234") } ``` -------------------------------- ### getDeviceGuid() Source: https://docs.pulsatehq.com/v2.7.2/reference/pulsatemanager-methods Retrieves the Pulsate device GUID. ```APIDOC ## func getDeviceGuid() -> String? ### Description Returns the Pulsate device GUID used to identify the user. ``` -------------------------------- ### Apply a theme configuration in Swift Source: https://docs.pulsatehq.com/v2.7.2/docs/custom-theming Build a PULThemeConfiguration object, set the desired color fields, and apply the configuration to the Pulsate manager. ```Swift import PULPulsate import UIKit guard let manager = PULPulsateFactory.getDefaultInstance() else { return } let config = PULThemeConfiguration() config.bigInAppOneButtonColor = .red config.bigInAppOneButtonTextColor = .white manager.applyThemeConfiguration(config) ``` -------------------------------- ### GET /apps/{app_id}/geofences Source: https://docs.pulsatehq.com/v2.2/reference/geofences-index Fetch all geofences against a pulsate app. ```APIDOC ## GET /apps/{app_id}/geofences ### Description Fetch all geofences against a pulsate app. ### Method GET ### Endpoint /apps/{app_id}/geofences ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app #### Query Parameters - **page** (string) - Optional - page number - **per_page** (string) - Optional - records per page - **shape** (string) - Optional - Geofences shape (circle, polygon) - **group_ids** (string) - Optional - Group ids - **search_query** (string) - Optional - search geofences by name - **sort** (string) - Optional - Sort by name etc - **order** (string) - Optional - sort records in ascending or descending order i.e. asc, desc ### Response #### Success Response (200) - **200** - Successful retrieval of geofences ``` -------------------------------- ### Login and Logout Convenience Methods Source: https://docs.pulsatehq.com/v2.7.2/docs/user-inbox-authorization Use these methods to bundle authorization state changes and manage in-app content visibility or notifications. ```Swift let manager = PULPulsateFactory.getDefaultInstance() // Call after your app confirms a successful sign-in manager?.userHasLoggedIn() // Call when the user signs out manager?.userHasLoggedOut() ``` -------------------------------- ### GET /apps/{app_id}/geofences/export Source: https://docs.pulsatehq.com/v2.2/reference/geofences-export-all Exports geofences of a pulsate app. ```APIDOC ## GET /apps/{app_id}/geofences/export ### Description Export geofences of pulsate app. ### Method GET ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/geofences/export ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app #### Query Parameters - **from** (string) - Optional - from date for geofence report e.g. 2025-04-09 - **to** (string) - Optional - to date for geofence report e.g. 2025-04-09 ### Response #### Success Response (200) - **object** - Returns an object containing the exported geofence data. #### Response Example { "example": "{}" } ``` -------------------------------- ### POST /apps/{app_id}/create_web_sdk_key Source: https://docs.pulsatehq.com/v2.2/reference/apps-create-web-sdk-key Create a new web SDK key for a specified Pulsate app. ```APIDOC ## POST /apps/{app_id}/create_web_sdk_key ### Description Create new web sdk key for pulsate app ### Method POST ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/create_web_sdk_key ### Parameters #### Path Parameters - **app_id** (string) - Required - id of pulsate app #### Request Headers - **Authorization** (string) - Required - {my_admin_api_token} ### Response #### Success Response (200) - **web_sdk_access_key** (string) - The generated web SDK access key - **web_sdk_domains** (array) - List of associated web domains #### Response Example { "web_sdk_access_key": "web_sdk_access_key", "web_sdk_domains": [ { "id": "web_domain_id", "url": "web_domain_url", "created_at": "web_domain_created_at" } ] } ``` -------------------------------- ### GET /apps/{app_id}/beacons/{id} Source: https://docs.pulsatehq.com/v2.2/reference/beacons-show Fetch beacon by id ```APIDOC ## GET /apps/{app_id}/beacons/{id} ### Description Fetch beacon by id. ### Method GET ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/beacons/{id} ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app - **id** (string) - Required - id of the beacon ### Response #### Success Response (200) - **id** (string) - Beacon ID - **nickname** (string) - Beacon nickname - **cached_beacon_events_count** (integer) - Count of cached beacon events - **created_at** (string) - Creation date - **uuid** (string) - Beacon UUID - **major** (integer) - Major value - **minor** (integer) - Minor value - **battery** (string) - Battery status - **beacon_id** (string) - Beacon identifier - **groups** (array) - List of associated groups - **actions** (object) - Available actions (edit, delete) #### Response Example { "id": "beacon_id", "nickname": "beacon_nickname", "cached_beacon_events_count": 0, "created_at": "2024-01-01", "uuid": "beacon_uuid", "major": 123, "minor": 345, "battery": "Check", "beacon_id": "123", "groups": [{ "id": "group_id", "name": "group_name" }], "actions": { "edit": "edit_path", "delete": "delete_path" } } ``` -------------------------------- ### POST /api/v2/apps/{app_id}/geofences/batch_create Source: https://docs.pulsatehq.com/v2.2/reference/geofence-batch-create Creates multiple geofences for the specified application. ```APIDOC ## POST /api/v2/apps/{app_id}/geofences/batch_create ### Description Creates multiple geofences for a specific application in a single batch request. ### Method POST ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/geofences/batch_create ### Parameters #### Path Parameters - **app_id** (string) - Required - The unique identifier of the application. #### Request Body - **submission_type** (string) - Required - The method of submission (e.g., "manual"). - **geofences** (array) - Required - A list of geofence objects to create. ### Request Example { "submission_type": "manual", "geofences": [ { "name": "geo513868681", "location": [50.042754135466986, 20.207290649414062], "shape": "circle", "radius": "5000" }, { "name": "geo25536868871", "location": [50.042754135466986, 20.207290649414062], "shape": "circle", "radius": "518" } ] } ``` -------------------------------- ### Retrieve Web SDK Credentials via cURL Source: https://docs.pulsatehq.com/v2.2/reference/apps-web-sdk-credentials Example request to fetch Web SDK credentials using the cURL command-line tool. ```curl curl --request GET \ --url https://control.pulsatehq.com/api/v2/apps/{app_id}/web_sdk_credentials \ --header 'Authorization: Token token={my_admin_api_token}' \ --header 'Content-Type: application/json' ``` -------------------------------- ### GET /apps/{app_id}/admins/{id} Source: https://docs.pulsatehq.com/v2.2/reference/admins-show Fetch admin by id ```APIDOC ## GET /apps/{app_id}/admins/{id} ### Description Fetch admin by id ### Method GET ### Endpoint /apps/{app_id}/admins/{id} ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app - **id** (string) - Required - id of the pulsate admin ### Response #### Success Response (200) - **id** (string) - Admin ID - **access** (string) - Access level - **actions** (object) - Available actions for the admin - **avatar_url** (string) - URL to the admin's avatar - **email** (string) - Admin email address - **job_title** (string) - Admin job title - **managed_app** (object) - Information about the managed app - **name** (string) - Admin name - **role** (string) - Admin role - **username** (string) - Admin username - **updated_at** (string) - Last update timestamp - **created_at** (string) - Creation timestamp #### Response Example { "id": "5ae07b2a4753364695030000", "access": "", "actions": { "edit": false, "delete": false }, "avatar_url": "https://pulsate-media-bucket-production.s3.eu-west-1.amazonaws.com/default-user-avatar.png", "email": "muzzamil+11@pulsatehq.com", "job_title": "", "managed_app": { "name": null, "id": "" }, "name": "John Smithhh", "role": "master_admin", "username": "admin", "updated_at": "2025-03-20T15:38:54Z", "created_at": "2018-04-25T13:03:43Z" } ``` -------------------------------- ### Initialize Pulsate SDK in AppDelegate Source: https://docs.pulsatehq.com/v2.7.2/docs/running-the-pulsate-sdk Initialize the SDK within the application(_:didFinishLaunchingWithOptions:) method using your App ID and App Key. ```Swift import PULPulsate @main class AppDelegate: UIResponder, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { do { let authData = try PULAuthorizationData( withAppId: "YOUR_SDK_APP_ID", andAppKey: "YOUR_SDK_APP_KEY") let pulsateManager = try PULPulsateFactory.getInstance( withAuthorizationData: authData, withLaunchOptions: launchOptions) pulsateManager.startPulsateSession { success, error in if let error = error { print("Pulsate session failed: \(error)") } } } catch { print("Pulsate initialization failed: \(error)") } return true } } ``` -------------------------------- ### GET /api/v2/apps/{app_id}/segments Source: https://docs.pulsatehq.com/v2.2/reference/segments-index Retrieves a list of segments for a specific application. ```APIDOC ## GET /api/v2/apps/{app_id}/segments ### Description Retrieves a paginated list of segments associated with the specified application. ### Method GET ### Endpoint /api/v2/apps/{app_id}/segments ### Parameters #### Path Parameters - **app_id** (string) - Required - The unique identifier of the application. ### Response #### Success Response (200) - **data** (array) - List of segment objects. - **metadata** (object) - Pagination and group metadata. ``` -------------------------------- ### GET /api/v2/apps/{app_id}/campaigns Source: https://docs.pulsatehq.com/v2.2/reference/campaigns-index Retrieves a list of campaigns for a specific application. ```APIDOC ## GET /api/v2/apps/{app_id}/campaigns ### Description Retrieves a list of campaigns associated with the specified application ID. ### Method GET ### Endpoint /api/v2/apps/{app_id}/campaigns ### Parameters #### Path Parameters - **app_id** (string) - Required - The unique identifier of the application. ``` -------------------------------- ### cURL Request for Batch Create Beacons Source: https://docs.pulsatehq.com/v2.2/reference/beacons-batch-create Example cURL command to perform a batch creation of beacons by uploading a CSV file. ```curl curl --request POST \ --url https://control.pulsatehq.com/api/v2/apps/{app_id}/beacons/batch_create \ --header 'authorization: Token token={my_admin_api_token}' \ --header 'content-type: multipart/form-data' \ --form csv_file=@beacons.csv ``` -------------------------------- ### Session Management Methods Source: https://docs.pulsatehq.com/v2.7.2/docs/pulsatemanager-methods Methods for starting, identifying, and logging out users, as well as triggering synchronization and retrieving device identifiers. ```Swift /// Starts the Pulsate session lifecycle for an anonymous user. /// The first session must be started by you; subsequent sessions are handled automatically. /// Start a session from an active view controller, not from the AppDelegate. func startPulsateSession(debugMode: Bool = false, _ listener: @escaping RequestListener) /// Starts / switches the session for an identified user. /// - Parameter alias: a unique identifier for this user in your system. An empty alias fails the listener. func startPulsateSession(forAlias alias: String, debugMode: Bool = false, withListener listener: @escaping RequestListener) /// Logs out the current user and detaches this device from the alias, clearing notifications. /// After logout, Pulsate can no longer reach this user with campaigns. This is close to a "soft delete"; /// it is NOT a way to end a session (sessions end automatically on background). func logout(_ listener: @escaping RequestListener) /// Forces the user/attribute sync that normally runs when the app enters the background. Debounced. func forceAttributeSync() /// Triggers a user-data update pass. func startBackgroundUpdates(_ listener: @escaping RequestListener) /// Returns the Pulsate device GUID used to identify the user. func getDeviceGuid() -> String? ``` -------------------------------- ### GET /apps/{app_id}/campaigns Source: https://docs.pulsatehq.com/v2.2/reference/campaigns-index Fetch a list of campaigns for a specific application. ```APIDOC ## GET /apps/{app_id}/campaigns ### Description Fetch campaigns list for a specific Pulsate application. ### Method GET ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/campaigns ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app #### Query Parameters - **group_ids** (string) - Optional - Groups ids (string with comma(s)) - **filter_types** (string) - Optional - Type of campaign i.e sms_notification (string with comma(s)) - **filter_statuses** (string) - Optional - Status of campaign i.e. active,paused (string with comma(s)) - **filter_targets** (string) - Optional - Targets campaign i.e. geofences, beacons, segment - **search_query** (string) - Optional - Search query - **sort** (string) - Optional - Sort param - **order** (string) - Optional - Order for sorting desc or asc - **page** (string) - Optional - Current page, defaults to 1 - **per_page** (string) - Optional - records per page ### Response #### Success Response (200) - **200** - Successful response ``` -------------------------------- ### GET /campaigns/{id} Source: https://docs.pulsatehq.com/v2.2/reference/campaigns-show-1 Retrieves the details of a specific campaign by its unique identifier. ```APIDOC ## GET /campaigns/{id} ### Description Retrieves the full details of a specific campaign, including its configuration, targeting, and status. ### Method GET ### Endpoint /campaigns/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the campaign. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the campaign. - **name** (string) - The name of the campaign. - **author_name** (string) - The name of the author. - **status** (string) - The current status of the campaign (e.g., Delivered). - **type** (string) - The type of campaign (e.g., PushNotificationCampaign). #### Response Example { "id": "67da9d92a46a6f8e1137b7be", "name": "test push", "status": "Delivered", "type": "PushNotificationCampaign" } ``` -------------------------------- ### List of localizable strings for legacy bundles Source: https://docs.pulsatehq.com/v2.7.2/docs/language-localization A comprehensive list of keys and default English values available for translation in legacy SDK versions. ```text "%d days ago" = "%d days ago"; "%d hours ago" = "%d hours ago"; "%d minutes ago" = "%d minutes ago"; "%d months ago" = "%d months ago"; "%d seconds ago" = "%d seconds ago"; "%d weeks ago" = "%d weeks ago"; "%d years ago" = "%d years ago"; "A minute ago" = "A minute ago"; "An hour ago" = "An hour ago"; "Just now" = "Just now"; "Last month" = "Last month"; "Last week" = "Last week"; "Last year" = "Last year"; "Yesterday" = "Yesterday"; "1 year ago" = "1 year ago"; "1 month ago" = "1 month ago"; "1 week ago" = "1 week ago"; "1 day ago" = "1 day ago"; "This morning" = "This morning"; "This afternoon" = "This afternoon"; "Today" = "Today"; "This week" = "This week"; "This month" = "This month"; "This year" = "This year"; "reply_button_label" = "Reply"; "new_message_button_label" = "New Message"; "new_messages_button_label" = "New Messages"; "new_updates" = "New Updates"; "no_internet_user_deleted_error" = "User deleted."; "no_internet_server_error" = "Unable to Connect. Swipe down to Retry."; "no_internet_send_message_error" = "Unable to Connect. Try again later."; "view_conversation_button_label" = "View Conversation"; "select_subject_label" = "Please select a subject"; "write_a_message_hint" = "Write a message..."; "give_your_message_a_subject" = "Give your message a subject so it's easier to organize."; "sent_a_message" = "sent a message"; "replied_to_your" = "replied to your message"; "send_button" = "SEND"; "new_card_label" = "New Card"; "feed_title_label" = "Feed"; "new_message_title_label" = "New Message"; "subject_feedback_label" = "Feedback"; "subject_feature_suggestion_label" = "Feature Suggestion"; "subject_complaint_label" = "Complaint"; "subject_other_label" = "Other..."; "feed_is_empty_title" = "Your Feed is Empty"; "icon_left_text" = "Tap the"; "icon_right_text" = "icon to start a"; "icon_bottom_text" = "new conversation with us."; "second_paragraph_text" = "You can use this section to ask questions or send feedback"; "message_sending" = "Message Sending..."; "message_sent" = "Message Sent"; "message_failed" = "No Internet Connection"; "try_again" = "Try Again?"; "other_subject_hint" = "Please describe your message"; "reached_bottom_of_feed" = "You have reached the bottom of your feed."; "pulsate_YOU_in_message_card" = "You"; ``` -------------------------------- ### POST /api/v2/apps/{app_id}/geofences/ Source: https://docs.pulsatehq.com/v2.2/reference/geofences-create Creates a new geofence for the specified application. ```APIDOC ## POST /api/v2/apps/{app_id}/geofences/ ### Description Creates a new geofence for the specified application. ### Method POST ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/geofences/ ### Parameters #### Path Parameters - **app_id** (string) - Required - The unique identifier of the application. #### Request Body - **geofence** (object) - Required - The geofence configuration object. - **name** (string) - Required - The name of the geofence. - **shape** (string) - Required - The shape of the geofence (e.g., "circle", "polygon"). - **path** (array) - Optional - The coordinates defining the polygon path. - **radius** (integer) - Optional - The radius of the circle. - **radius_unit** (string) - Optional - The unit of the radius (e.g., "feet"). - **type** (string) - Optional - The type of geofence (e.g., "enter"). ### Request Example { "geofence": { "name": "geofence_polysssssgon_from_api23", "shape": "polygon", "path": [ [52.85951892166289, 18.52352854511544], [51.10042408720422, 16.69979807636544], [50.68463237271521, 21.95126292011544] ] } } ### Response #### Success Response (200) - **geofence** (object) - The created geofence object. ``` -------------------------------- ### GET /apps/{app_id}/campaigns/{id} Source: https://docs.pulsatehq.com/v2.2/reference/campaigns-show-1 Fetch a single campaign by id. ```APIDOC ## GET /apps/{app_id}/campaigns/{id} ### Description Fetch a single campaign by id. ### Method GET ### Endpoint /apps/{app_id}/campaigns/{id} ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app - **id** (string) - Required - id of the campaign #### Request Headers - **Authorization** (string) - Required - {my_admin_api_token} - **Content-Type** (string) - Optional - application/json ### Response #### Success Response (200) - **200** - Successful retrieval of the campaign. ``` -------------------------------- ### GET /api/v2/apps/{app_id}/geofences Source: https://docs.pulsatehq.com/v2.2/reference/geofences-index Retrieves a list of geofences for a specific application. ```APIDOC ## GET /api/v2/apps/{app_id}/geofences ### Description Retrieves a paginated list of geofences associated with the specified application ID. ### Method GET ### Endpoint /api/v2/apps/{app_id}/geofences ### Parameters #### Path Parameters - **app_id** (string) - Required - The unique identifier of the application. ### Response #### Success Response (200) - **data** (array) - List of geofence objects. - **bulk_actions** (object) - Contains paths for batch operations like delete, add_to_group, and remove_from_group. - **metadata** (object) - Pagination and configuration metadata. #### Response Example { "data": [ { "id": "67f660b5a46a6f7d4ade58a9", "name": "test 2", "created_at": "2025-04-09T11:57:41Z", "updated_at": "2025-04-09T11:57:41Z", "guid": "8dt-UF9i", "groups": [], "location": [33.69352607, 73.04613069], "type": "enter", "shape": "circle", "radius": 1517, "radius_unit": "feet" } ], "bulk_actions": { "delete": "/api/v2/apps/67e2b7f5a46a6fb2be317885/geofences/batch_destroy", "add_to_group": "/api/v2/apps/67e2b7f5a46a6fb2be317885/groups/add_resources", "remove_from_group": "/api/v2/apps/67e2b7f5a46a6fb2be317885/groups/remove_resources" }, "metadata": { "page": 1, "per_page": 1000, "total_pages": 1, "data_count": 2 } } ``` -------------------------------- ### Start Pulsate Session on Main Screen Source: https://docs.pulsatehq.com/v2.8.3/docs/example-integration-1 Initiate the Pulsate session using the user's unique identifier and enable authenticated features upon success. ```kotlin class MainFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) val pulsateManager = PulsateFactory.getInstance() val alias = userRepository.currentUserId // your unique user identifier pulsateManager.startPulsateSessionForAlias( alias, object : IPulsateRequestListener { override fun onSuccess() { // Allow in-apps + inbox for this authenticated user pulsateManager.userHasLoggedIn() } override fun onError(e: Throwable?) { e?.printStackTrace() } }, ) } } ``` -------------------------------- ### Handle Login Screen Navigation Source: https://docs.pulsatehq.com/v2.8.3/docs/example-integration-1 Check for existing user sessions on the login screen before navigating to the main screen to avoid premature session initialization. ```kotlin class LoginFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) showSpinner() if (loginViewModel.isUserLoggedIn()) { navigateToMainScreen() } else { hideSpinner() setupLoginScreen() } } } ``` -------------------------------- ### GET /apps/{app_id}/deeplinks Source: https://docs.pulsatehq.com/v2.2/reference/deeplinks-index Fetch all deeplinks for a specific pulsate app. ```APIDOC ## GET /apps/{app_id}/deeplinks ### Description Fetch all deeplinks for a specific pulsate app. ### Method GET ### Endpoint https://control.pulsatehq.com/api/v2/apps/{app_id}/deeplinks ### Parameters #### Path Parameters - **app_id** (string) - Required - id of the pulsate app #### Query Parameters - **page** (string) - Optional - page number - **per_page** (string) - Optional - records per page ### Response #### Success Response (200) - **data** (array) - List of deeplink objects - **metadata** (object) - Pagination metadata #### Response Example { "data": [ { "id": "67a0f4a9a46a6f2201f320d9", "nickname": "P2P", "target": "cma01560://p2p", "created_at": "2025-02-03T16:54:01Z", "updated_at": "2025-02-03T16:54:01Z" } ], "metadata": { "page": 1, "per_page": 1000, "total_pages": 1, "data_count": 9 } } ``` -------------------------------- ### Initialize Pulsate SDK in Code Source: https://docs.pulsatehq.com/v2.8.3/docs/installing-the-pulsate-sdk-1 Programmatically initialize the SDK using PulsateAuthData, useful for dynamic environment switching. ```Kotlin val authData = PulsateAuthData("YOUR_64_CHAR_APP_ID", "YOUR_64_CHAR_APP_KEY") val pulsateManager = PulsateFactory.getInstance(authData) ```