{"_id":"5dc04d1d46783a0052186fed","project":"54aa7f773b56130b0056c86e","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":8,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959","5c73dd27e8fdc000572a206a","5c77ac5af94a920045cb80ca"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"564bbc7e8841060d00abb2ee","__v":10,"pages":["564bbf454bf5c80d0020901e","564bc1b08b1c5521002bb914","564c387b9baa330d00faa622","564c3a7b61008d17006ffa3a","564c3e4083b72c2b00b36fb6","564c431b61008d17006ffa46","564c4bc9b9cdb41700a0eae7","564c4e955f9d102b00fc3b4a","564c5f32c241881700d85981","564c68a93eb8f81700838a25"],"project":"54aa7f773b56130b0056c86e","version":"55781fe25129590d003ff4f7","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-17T23:47:10.058Z","from_sync":false,"order":1,"slug":"pulsate-cms-api","title":"Pulsate CMS API"},"user":"5dc049ca9d92fb00443a3f94","__v":8,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-11-04T16:09:01.850Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"post","examples":{"codes":[{"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  \"alias\": \"sample_alias\",\n\t\"guid\": sample_guid\",\n\t\"in_app_events\": [\n\t\t{\n\t\t\t\"name\": \"top_up\",\n\t\t\t\"occurred_at\": \"2019-10-15T10:28:53.917Z\",\n\t\t\t\"type\": \"Revenue\",\n\t\t\t\"params\": {\n\t\t\t\t\"currency\": \"GBP\",\n\t\t\t\t\"amount\": 20.50\n\t\t\t}\n\t\t}\n\t]\n}'","language":"shell","name":""}]},"settings":"564bbbf80cbcc91700b8171c","results":{"codes":[{"code":"","language":"json","status":200,"name":""},{"status":400,"name":"","code":"{\n    \"errors\": {\n        \"params\": [\n            \"amount is required for the Revenue Event\"\n        ]\n    }\n}","language":"json"}]},"auth":"required","params":[{"_id":"564c387b9baa330d00faa623","ref":"","in":"body","required":true,"desc":"User unique alias within the App. Should only contain the following characters 1-9, A-Z and !:::at:::$^&*()_+=-{}[]:\"'<>,|","default":"","type":"string","name":"alias"},{"_id":"57ff824e8e087d0e000303f7","ref":"","in":"path","required":true,"desc":"App ID. It can be fetched by using \"Apps: Get All (Index)\" or \"Apps: Get One (Show)\" endpoints.","default":"","type":"string","name":"app_id"},{"_id":"5b5b16b1faf2c40003dbcad0","ref":"","in":"body","required":true,"desc":"Guid of the user device","default":"","type":"string","name":"guid"},{"_id":"5b5b16b1faf2c40003dbcacf","ref":"","in":"body","required":true,"desc":"Array of In App Events to create","default":"","type":"array_object","name":"in_app_events"},{"_id":"5b5b16b1faf2c40003dbcace","ref":"","in":"body","required":true,"desc":"Time when the event occurred. Accepted formats: ISO 8601 [YYYY-MM-DD'T'hh:mm:ss'Z] and integer (UNIX timestamp)","default":"","type":"string","name":"in_app_events.occurred_at"},{"_id":"5b5b16b1faf2c40003dbcacd","ref":"","in":"body","required":true,"desc":"Name of In App Event","default":"","type":"string","name":"in_app_events.name"},{"_id":"5b5b16b1faf2c40003dbcacc","ref":"","in":"body","required":false,"desc":"In App Event type, it can be: \"Simple\" or \"Revenue\"","default":"Simple","type":"string","name":"in_app_events.type"},{"_id":"5b5b16b1faf2c40003dbcacb","ref":"","in":"body","required":false,"desc":"Array of event parameters","default":"","type":"array_object","name":"in_app_events.params"},{"_id":"5dc04fb7be7fdb002baa9e1a","ref":"","in":"body","required":false,"desc":"Revenue Amount, e.g. 12.50. Required for \"Revenue\" type","default":"","type":"float","name":"in_app_events.params.amount"},{"_id":"5dc04fb7be7fdb002baa9e19","ref":"","in":"body","required":false,"desc":"Revenue Currency Code (ISO 4217) e.g. \"USD\". Required for \"Revenue\" type","default":"","type":"string","name":"in_app_events.params.currency"}],"url":"/apps/:app_id/events/batch"},"isReference":true,"order":34,"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]","excerpt":"","slug":"events-create-batch","type":"endpoint","title":"Events: Create Batch"}

postEvents: Create Batch


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

alias:
required
string
User unique alias within the App. Should only contain the following characters 1-9, A-Z and !@$^&*()_+=-{}[]:"'<>,|
guid:
required
string
Guid of the user device
in_app_events:
required
array of objects
Array of In App Events to create
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)
in_app_events.name:
required
string
Name of In App Event
in_app_events.type:
stringSimple
In App Event type, it can be: "Simple" or "Revenue"
in_app_events.params:
array of objects
Array of event parameters
in_app_events.params.amount:
float
Revenue Amount, e.g. 12.50. Required for "Revenue" type
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 }}