{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/apps/:app_id/events/batch_multiple","auth":"required","results":{"codes":[{"name":"","status":200,"language":"json","code":""},{"language":"json","code":"{\n    \"errors\": {\n        \"params\": [\n            \"amount is required for the Revenue Event\"\n        ]\n    }\n}","name":"","status":400}]},"settings":"564bbbf80cbcc91700b8171c","examples":{"codes":[{"name":"","language":"shell","code":"curl -X POST \"https://control.pulsatehq.com/api/v1/apps/$APP_ID/events/batch\" \\\n-H \"Authorization: Token token=$MY_ADMIN_API_TOKEN\" \\\n-d '{\n\t\"users\": [\n    {\n      \"alias\": \"sample_alias\",\n      \"guid\": \"sample_guid\",\n      \"in_app_events\": [\n        {\n          \"name\": \"sample_event_name\",\n          \"type\": \"Revenue\",\n          \"occurred_at\": \"1574333362\",\n          \"params\":\n            {\n              \"currency\": \"GBP\",\n              \"amount\": 20.50\n            }\n        }  \n      ]\n    },\n    {\n    \t\"alias\": \"sample_alias_2\",\n\t\t\t\"guid\": \"sample_guid_2\",\n\t\t\t\"in_app_events\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"sample_event_name_2\",\n\t\t\t\t\t\"type\": \"Simple\",\n\t\t\t\t\t\"occurred_at\": \"1578925938\"\n\t\t\t\t}  \n\t\t\t]\n    }\n  ]\n}'"}]},"method":"post","params":[{"name":"app_id","type":"string","default":"","desc":"App ID. It can be fetched by using \"Apps: Get All (Index)\" or \"Apps: Get One (Show)\" endpoints.","required":true,"in":"path","ref":"","_id":"57ff824e8e087d0e000303f7"},{"name":"users","type":"array_object","default":"","desc":"array of Users with events. Maximum 100 objects at once. If request is sent with more then 100 objects request returns error and no data is saved.","required":true,"in":"body","ref":"","_id":"5e1c8fe0f6f029004423bb10"},{"name":"users[].alias","type":"string","default":"","desc":"User unique alias within the App. Should only contain the following characters 1-9, A-Z and !:::at:::$^&*()_+=-{}[]:\"'<>,|","required":true,"in":"body","ref":"","_id":"564c387b9baa330d00faa623"},{"name":"users[].guid","type":"string","default":"","desc":"Guid of the user device","required":true,"in":"body","ref":"","_id":"5b5b16b1faf2c40003dbcad0"},{"name":"users[].in_app_events","type":"array_object","default":"","desc":"Array of In App Events to create","required":true,"in":"body","ref":"","_id":"5b5b16b1faf2c40003dbcacf"},{"name":"users[].in_app_events.occurred_at","type":"string","default":"","desc":"Time when the event occurred. Accepted formats: ISO 8601 [YYYY-MM-DD'T'hh:mm:ss'Z] and integer (UNIX timestamp)","required":true,"in":"body","ref":"","_id":"5b5b16b1faf2c40003dbcace"},{"name":"users[].in_app_events.name","type":"string","default":"","desc":"Name of In App Event","required":true,"in":"body","ref":"","_id":"5b5b16b1faf2c40003dbcacd"},{"name":"users[].in_app_events.type","type":"string","default":"Simple","desc":"In App Event type, it can be: \"Simple\" or \"Revenue\"","required":false,"in":"body","ref":"","_id":"5b5b16b1faf2c40003dbcacc"},{"name":"users[].in_app_events.params","type":"array_object","default":"","desc":"Array of event parameters","required":false,"in":"body","ref":"","_id":"5b5b16b1faf2c40003dbcacb"},{"name":"users[].in_app_events.params.amount","type":"float","default":"","desc":"Revenue Amount, e.g. 12.50. Required for \"Revenue\" type","required":false,"in":"body","ref":"","_id":"5dc04fb7be7fdb002baa9e1a"},{"name":"users[].in_app_events.params.currency","type":"string","default":"","desc":"Revenue Currency Code (ISO 4217) e.g. \"USD\". Required for \"Revenue\" type","required":false,"in":"body","ref":"","_id":"5dc04fb7be7fdb002baa9e19"}]},"next":{"description":"","pages":[]},"title":"Events: Create Batch Multiple","type":"endpoint","slug":"events-create-batch-1","excerpt":"","body":"Documentation\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Please note that if you set the customer's alias, this API endpoint requires either the Puslate device GUID or the user's alias, not both. For more information on deduping and setting an alias for a user, please see our guides on [Android](https://pulsate.readme.io/docs/android-deduping-setting-the-customers-alias) and [iOS](https://pulsate.readme.io/docs/deduping-setting-the-customers-alias).\",\n  \"title\": \"Alias or Device GUID\"\n}\n[/block]","updates":[],"order":36,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5e4fced159815700262d292f","project":"54aa7f773b56130b0056c86e","version":{"version":"2.2","version_clean":"2.2.0","codename":"CMS API","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e4fced159815700262d2899","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","5e4fced159815700262d289a","5e4fced159815700262d289b","5e4fced159815700262d289c","5e4fced159815700262d289d","5e4fced159815700262d289e","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","5e4fced159815700262d289f","5e4fced159815700262d28a0","5c73dd27e8fdc000572a206a","5e4fced159815700262d28a1","5e53c04c1d11110018b56e12"],"_id":"5e4fced159815700262d2930","project":"54aa7f773b56130b0056c86e","forked_from":"55781fe25129590d003ff4f7","__v":1,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["5e4fced159815700262d28c6","5e4fced159815700262d28c7","5e4fced159815700262d28c8","5e4fced159815700262d28c9","5e4fced159815700262d28ca","5e4fced159815700262d28cb","5e4fced159815700262d28cc","5e4fced159815700262d28cd","5e4fced159815700262d28ce","564c68a93eb8f81700838a25"],"title":"Pulsate CMS API","slug":"pulsate-cms-api","order":1,"from_sync":false,"reference":true,"_id":"5e4fced159815700262d289e","__v":10,"createdAt":"2015-11-17T23:47:10.058Z","project":"54aa7f773b56130b0056c86e","version":"5e4fced159815700262d2930"},"user":"5874dcd9edcf9f2f00f9e0af","createdAt":"2020-01-13T15:42:24.668Z","__v":4,"parentDoc":null}

postEvents: Create Batch Multiple


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

app_id:
required
string
App ID. It can be fetched by using "Apps: Get All (Index)" or "Apps: Get One (Show)" endpoints.

Body Params

users:
required
array of objects
array of Users with events. Maximum 100 objects at once. If request is sent with more then 100 objects request returns error and no data is saved.
users[].alias:
required
string
User unique alias within the App. Should only contain the following characters 1-9, A-Z and [email protected]$^&*()_+=-{}[]:"'<>,|
users[].guid:
required
string
Guid of the user device
users[].in_app_events:
required
array of objects
Array of In App Events to create
users[].in_app_events.occurred_at:
required
string
Time when the event occurred. Accepted formats: ISO 8601 [YYYY-MM-DD'T'hh:mm:ss'Z] and integer (UNIX timestamp)
users[].in_app_events.name:
required
string
Name of In App Event
users[].in_app_events.type:
stringSimple
In App Event type, it can be: "Simple" or "Revenue"
users[].in_app_events.params:
array of objects
Array of event parameters
users[].in_app_events.params.amount:
float
Revenue Amount, e.g. 12.50. Required for "Revenue" type
users[].in_app_events.params.currency:
string
Revenue Currency Code (ISO 4217) e.g. "USD". Required for "Revenue" type

Examples


Documentation

Documentation [block:callout] { "type": "info", "body": "Please note that if you set the customer's alias, this API endpoint requires either the Puslate device GUID or the user's alias, not both. For more information on deduping and setting an alias for a user, please see our guides on [Android](https://pulsate.readme.io/docs/android-deduping-setting-the-customers-alias) and [iOS](https://pulsate.readme.io/docs/deduping-setting-the-customers-alias).", "title": "Alias or Device GUID" } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}