PlatformAPIOld
To Create the new user in the system. If Channel Id is already given it will automatically create the new Channel user in firebase with the same ID. If no channel user id is given it will automatically create a new channel user id
Request body
These are the fields that are accessible like name, email, …
["web"]
The Fields will change as per as the data that is available for the user
The Id that is used to map some logged in users. If logged in user functionality is not required then no field required
Channel Id if using some integration is enabled and we have channel id pre-existing
Group Id to map the current user
Responses
Body
["web"]
Request body
Responses
Body
Request body
Application ID
Interaction Engine Key (either of key or sessionId should only be given)
ArrowAI UI Session ID (either of key or sessionId should only be given)
This is the list of filters that can be given. Each object is a pipeline for aggregate operation but $match changes to match, ie remove $ for the type of stage
[]
{
"match": {
"data.integration.android": true
}
}
{
"project": {
"_id": 1
}
}
{
"group": {
_id: "$groupId", events: { $push: "$$ROOT" }
}
}
The list of data that is required to be shown, all the properties set to 1 will be sent back from the api call
Page Number
Limit of the number of results. To get all the list of users, type limit as 0
Field to sort the data
if set to true, then it overwrites all the column of fields and gives you the total list of all attributes
Examples
With Interaction Key
{
"app_id": "5a7bfc8ebde31989008b456a",
"key": "68aba74c-f126-4c57-b9a0-d20b9bed4d7d",
"filters": [
{
"match": {
"data.integration.android": true
}
}
],
"fields": {
"events": 1,
"data": 1,
"_id": 1,
"variable": 1,
"lastMessageChannel": 1,
"lastMessage": 1,
"unread": -1
},
"page": 1,
"limit": 2
}
With Session Id
{
"app_id": "5a7bfc8ebde31989008b456a",
"sessionid": "NTc4NjY2YjYzYTQ4OGI0ZDAwOGI0NTY3KzE1MTk3MTI1MTE=",
"filters": [
{
"match": {
"data.integration.android": true
}
}
],
"fields": {
"events": 1,
"data": 1,
"_id": 1,
"variable": 1,
"lastMessageChannel": 1,
"lastMessage": 1,
"unread": -1
},
"page": 1,
"limit": 2
}
Get Event number with data
{
"app_id": "5a7bfc8ebde31989008b456a",
"key": "68aba74c-f126-4c57-b9a0-d20b9bed4d7d",
"filters": [
{
"project": {
"data": 1,
"_id": 1,
"numberOfEvents": { "$size": "$events" }
}
}
],
"fields": {
"data": 1,
"numberOfEvents": 1,
"_id": 1
},
"page": 1,
"limit": 100,
"sortBy": "numberOfEvents"
}
All web but not android
{
"app_id": "5a7bfc8ebde31989008b456a",
"key": "68aba74c-f126-4c57-b9a0-d20b9bed4d7d",
"filters": [
{
"match": {
"data.integration.web": true
}
},
{
"match": {
"data.integration.android": {"$exists": false}
}
},
{
"project": {
"data": 1,
"_id": 1,
"variable": 1,
"lastMessageChannel": 1,
"lastMessage": 1,
"unread": 1,
"numberOfEvents": { "$size": "$events" }
}
}
],
"fields": {
"numberOfEvents": 1,
"data": 1,
"_id": 1,
"unread": 1
},
"page": 1,
"limit": 20
}
Responses
Correct Response
Body
No Error
Has Error
Contains data for users
Array of users data
["android"]
Total Pages
Total Count
Current Page number
Current limit set
Examples
{
"code": 0,
"users": {
"data": [
{
"_id": "-L4yS0fS7YqpFbZSkhFR",
"data": {
"phone": "",
"name": "Richa Mishra",
"integration": {
"webIds": {
"-L5CUzbAYpibBNpStv2Z": true
},
"web": true,
"androidUniqId": "wSk3pYZwV1Ym1VEdZKhMe1KYaH73",
"androidIds": {
"-L5o-mHMFR_i-RmnJJYz": true,
"-L5DW9p6asn0xFsKSu64": true,
"-L5DW9AMyFhquRBGlmzC": true,
"-L5Cou0bocOekkHzb3pN": true,
"-L5CotLQKTuvhcBnIi4-": true,
"-L4yS0bGG7WdI69C3rDu": true
},
"android": true
},
"email": "puneet.puneetmishra7@gmail.com",
"authKey": "wSk3pYZwV1Ym1VEdZKhMe1KYaH73"
},
"events": [
{
"_id": "5a8c4a88ecefe7003806a232",
"data": {
"source": [
"android"
],
"appId": "5a7bfc8ebde31989008b456a",
"name": "richa mishra",
"email": "puneet.puneetmishra7@gmail.com",
"phone": "+919044385689"
},
"deviceInfo": {
"IP": "0.0.0.0",
"ANDROID_ID": "312c9f3925c9cade",
"BOARD": "msm8953",
"BOOTLOADER": "MSM8953_TISSOT1.0_20171219100348",
"BRAND": "xiaomi",
"CPU_ABI": "arm64-v8a",
"CPU_ABI2": "",
"DISPLAY": "N2G47H.7.12.19",
"FINGERPRINT": "xiaomi/tissot/tissot_sprout:7.1.2/N2G47H/7.12.19:user/release-keys",
"HARDWARE": "qcom",
"HOST": "mi-server",
"ID": "N2G47H",
"MANUFACTURER": "Xiaomi",
"MODEL": "Mi A1",
"PRODUCT": "tissot",
"SERIAL": "fdd6d38f0504",
"TAGS": "release-keys",
"TIME": 1513652529000,
"TYPE": "user",
"UNKNOWN": "unknown",
"USER": "builder",
"channel": "android",
"FCM_Token": "dsdPrF-xiao:APA91bH-2sWTzHMGbNGXyx-qGfs4Q1gjoLft2486VQLz-J8d31qH8EDjyXKUI9mkmui3NZ2Ez0rVa5BoncQAIQqN6ESKm8EtSJpciYuMXmQ2Sn4lHbdnMZZdTB6ryL_LI-UJ3evsr8dY"
},
"groupId": "-L4yS0fS7YqpFbZSkhFR",
"applicationId": "5a7bfc8ebde31989008b456a",
"eventType": "newUser",
"eventId": "5a7bfc8ebde31989008b456a5a7b",
"__v": 0
}
]
},
{
"_id": "-L4zB7hFeyZ_B7feFuSX",
"data": {
"integration": {
"androidIds": {
"-L4zB7d9fjR9SSXUXAiN": true
},
"androidUniqId": "LoAJCEP3LvfVqgDTBAaSR87x5oK2",
"android": true
},
"phone": "",
"email": "contact@arrowai.com",
"name": "Contact ArrowAI"
},
"events": []
}
],
"pageCount": 8,
"totalCount": 16,
"currentPage": 1,
"currentLimit": 2
}
}
If either key or sessionid is not sent
Body
Examples
{
"message": "No Authentication",
"error": {
"status": 401
}
}
If application id not present
Body
Examples
{
"message": "Please Provide App Id",
"error": {
"status": 401
}
}
Javascript Timestamp
{
"userWhoDidConditionList": {
"conditionType": "or",
"conditions": [
{
"mainFilterKey": {
"eventId": "interaction_engine",
"eventType": "new_user_created"
},
"timeFilter": {
"name": "inPast",
"duration": 5,
"durationType": "days"
},
"filters": [
{
"key": "integration",
"conditions": {
"operator": "="
},
"value": "web"
}
],
"where": {
"key": "count",
"conditions": {
"operator": "="
},
"value": 1
}
}
]
},
"userWhoDidNotConditionList": {
"conditionType": "or",
"conditions": [
{
"mainFilterKey": {
"eventId": "interaction_engine",
"eventType": "new_user_created"
},
"timeFilter": {
"name": "inPast",
"duration": 5,
"durationType": "days"
},
"filters": [
{
"key": "integration",
"conditions": {
"operator": "="
},
"value": "web"
}
],
"where": {
"key": "count",
"conditions": {
"operator": "="
},
"value": 1
}
}
]
},
"userPropertiesConditionList": {
"conditionType": "or",
"conditions": [
{
"conditions": {
"operator": "="
},
"key": "data.integration",
"value": "web"
}
]
}
}