PlatformAPIOld

Create New User
POST /users/new

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

Object
data
Object required

These are the fields that are accessible like name, email, …

appId
string
Example:
5a0fdd56c3a53a6e008b456a
name
string
Example:
Guest499
source
Array
Example:
["web"]
string
Example:
web
email
string nullable
phone
string nullable
deviceInfo
Object required

The Fields will change as per as the data that is available for the user

color
integer
Example:
16777216
fonts
string
Example:
No
navigator
string
Example:
Netscape
channel
string
Example:
web
webUserGuest
boolean
version
string
Example:
5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
colordepth
integer
Example:
24
width
integer
Example:
1920
height
integer
Example:
1080
maxwidth
integer
Example:
1865
maxheight
integer
Example:
1056
codename
string
Example:
Mozilla
platform
string
Example:
Linux x86_64
java
string
Example:
No
applicationId
string required
Example:
5a0fdd56c3a53a6e008b456a
channel
string required
Example:
web
loggedInId
string nullable

The Id that is used to map some logged in users. If logged in user functionality is not required then no field required

channelId
string nullable

Channel Id if using some integration is enabled and we have channel id pre-existing

groupId
string nullable

Group Id to map the current user

Responses

200 OK
Body
Object
data
Object
appId
string
Example:
5a0fdd56c3a53a6e008b456a
name
string
Example:
Guest499
source
Array
Example:
["web"]
string
Example:
web
deviceInfo
Object
color
integer
Example:
16777216
fonts
string
Example:
No
navigator
string
Example:
Netscape
channel
string
Example:
web
webUserGuest
boolean
version
string
Example:
5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
colordepth
integer
Example:
24
width
integer
Example:
1920
height
integer
Example:
1080
maxwidth
integer
Example:
1865
maxheight
integer
Example:
1056
codename
string
Example:
Mozilla
platform
string
Example:
Linux x86_64
java
string
Example:
No
groupId
string
Example:
-KzxMmbp5bcdfN2qlqUv
id
string
Example:
-KzxMmbo8IDSkF4i45Ld
Add Message
GET /messages/incoming

Responses

200 OK
Body
Object
success
boolean
Example:
true
Get Users list
POST /users/getUsers

Request body

Object
app_id
string required

Application ID

Example:
5a7bfc8ebde31989008b456a
key
string

Interaction Engine Key (either of key or sessionId should only be given)

Example:
68aba74c-f126-4c57-b9a0-d20b9bed4d7d
sessionid
string

ArrowAI UI Session ID (either of key or sessionId should only be given)

Example:
NTc4NjY2YjYzYTQ4OGI0ZDAwOGI0NTY3KzE1MTk3MTI1MTE=
filters
Array nullable

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

Default:
[]
Object
Examples:
{
    "match": {
        "data.integration.android": true
    }
}
{
    "project": {
        "_id": 1 
    }
}
{
    "group": {
        _id: "$groupId", events: { $push: "$$ROOT" }
    }
}
match
Object
data.integration.android
boolean
Example:
true
fields
Object

The list of data that is required to be shown, all the properties set to 1 will be sent back from the api call

events
integer nullable
Example:
1
data
integer nullable
Example:
1
_id
integer nullable
Example:
1
variable
integer
Example:
1
lastMessageChannel
number
Example:
1
lastMessage
integer
Example:
1
unread
integer
Example:
-1
page
integer

Page Number

Default:
1
Example:
1
limit
integer

Limit of the number of results. To get all the list of users, type limit as 0

Default:
20
Example:
2
sortBy
string

Field to sort the data

allFields
boolean

if set to true, then it overwrites all the column of fields and gives you the total list of all attributes

Default:
false
Examples:
truefalse
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

200 OK

Correct Response

Body
Object
code
integer
Enumeration:
0

No Error

1

Has Error

users
Object

Contains data for users

data
Array

Array of users data

Object
_id
string
Example:
-L4yS0fS7YqpFbZSkhFR
data
Object
phone
string
name
string
Example:
Richa Mishra
integration
Object
webIds
Object
-L5CUzbAYpibBNpStv2Z
boolean
Example:
true
web
boolean
Example:
true
androidUniqId
string
Example:
wSk3pYZwV1Ym1VEdZKhMe1KYaH73
androidIds
Object
-L5o-mHMFR_i-RmnJJYz
boolean
Example:
true
-L5DW9p6asn0xFsKSu64
boolean
Example:
true
-L5DW9AMyFhquRBGlmzC
boolean
Example:
true
-L5Cou0bocOekkHzb3pN
boolean
Example:
true
-L5CotLQKTuvhcBnIi4-
boolean
Example:
true
-L4yS0bGG7WdI69C3rDu
boolean
Example:
true
android
boolean
Example:
true
email
string
Example:
puneet.puneetmishra7@gmail.com
authKey
string
Example:
wSk3pYZwV1Ym1VEdZKhMe1KYaH73
events
Array
Object
_id
string
Example:
5a8c4a88ecefe7003806a232
data
Object
source
Array
Example:
["android"]
string
Example:
android
appId
string
Example:
5a7bfc8ebde31989008b456a
name
string
Example:
richa mishra
email
string
Example:
puneet.puneetmishra7@gmail.com
phone
string
Example:
+919044385689
deviceInfo
Object
IP
string
Example:
0.0.0.0
ANDROID_ID
string
Example:
312c9f3925c9cade
BOARD
string
Example:
msm8953
BOOTLOADER
string
Example:
MSM8953_TISSOT1.0_20171219100348
BRAND
string
Example:
xiaomi
CPU_ABI
string
Example:
arm64-v8a
CPU_ABI2
string
DISPLAY
string
Example:
N2G47H.7.12.19
FINGERPRINT
string
Example:
xiaomi/tissot/tissot_sprout:7.1.2/N2G47H/7.12.19:user/release-keys
HARDWARE
string
Example:
qcom
HOST
string
Example:
mi-server
ID
string
Example:
N2G47H
MANUFACTURER
string
Example:
Xiaomi
MODEL
string
Example:
Mi A1
PRODUCT
string
Example:
tissot
SERIAL
string
Example:
fdd6d38f0504
TAGS
string
Example:
release-keys
TIME
integer
Example:
1513652529000
TYPE
string
Example:
user
UNKNOWN
string
Example:
unknown
USER
string
Example:
builder
channel
string
Example:
android
FCM_Token
string
Example:
dsdPrF-xiao:APA91bH-2sWTzHMGbNGXyx-qGfs4Q1gjoLft2486VQLz-J8d31qH8EDjyXKUI9mkmui3NZ2Ez0rVa5BoncQAIQqN6ESKm8EtSJpciYuMXmQ2Sn4lHbdnMZZdTB6ryL_LI-UJ3evsr8dY
groupId
string
Example:
-L4yS0fS7YqpFbZSkhFR
applicationId
string
Example:
5a7bfc8ebde31989008b456a
eventType
string
Example:
newUser
eventId
string
Example:
5a7bfc8ebde31989008b456a5a7b
__v
integer
pageCount
integer

Total Pages

Example:
8
totalCount
integer

Total Count

Example:
16
currentPage
integer

Current Page number

Example:
1
currentLimit
integer

Current limit set

Example:
2
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
    }
}
401 Unauthorized

If either key or sessionid is not sent

Body
Object
message
string
Example:
No Authentication
error
Object
status
integer
Example:
401
Examples
{
    "message": "No Authentication",
    "error": {
        "status": 401
    }
}
401 Unauthorized

If application id not present

Body
Object
message
string
Example:
Please Provide App Id
error
Object
status
integer
Example:
401
Examples
{
    "message": "Please Provide App Id",
    "error": {
        "status": 401
    }
}
Schema Message Outgoing
Ougoing Message Format
Object
applicationId
string
Example:
58ba71c7e2ca0152008b456b
botId
string
Example:
58cba30f8a186f52008b4605
integration
string
Example:
web
needVerification
boolean
payload
Object
appId
string
Example:
58ba71c7e2ca0152008b456b
recipient
Object
id
string
Example:
-KrpBBCrU65vNiBKIX_G
sender
Object
id
string
Example:
bot
sentFromRep
boolean
sentFromServer
boolean
Example:
true
sentFromUser
boolean
timestamp
integer
Example:
1511789332988
uniqueUserId
string
Example:
-KrpBBCrU65vNiBKIX_G
Message Object
Schema Message Incoming
Incoming Message Format
Object
applicationId
string
Example:
58ba71c7e2ca0152008b456b
integration
string
Examples:
webfacebooktwitter
messageData
Any of
sentFromUser
boolean
Example:
true
timestamp
integer

Javascript Timestamp

sender
Object
id
string
Example:
-KrpBBCrU65vNiBKIX_G
payload
Object
global_lat
number
Example:
26.884702
global_long
number
Example:
80.9436752
botId
string nullable
Example:
58cba30f8a186f52008b4605
Message Object
Send Text
Object
message
Object
text
string
Example:
hi
endExistingFlow
boolean nullable
Example:
true
sender
Object
id
string
Example:
-KrpBBCrU65vNiBKIX_G
Send Click
Object
message
Object
text
string
Example:
Know More
postback
Object
payload
Object
value
string
Example:
know_about_start_up
variable
string
Example:
show_start_button
sender
Object
id
string
Example:
-KrpBBCrU65vNiBKIX_G
Bottom Button Template
Object
attachment
Object
payload
Object
buttons
Array
Any of
template_type
string
Example:
button_bottom
text
string
Example:
Hello! How can I help you with anything related to Start Up India?
type
string
Example:
template
confidence
number
Example:
94.259040984663
finalStep
boolean
suggestion
string
Button Template
Object
attachment
Object
payload
Object
buttons
Array
template_type
string
Example:
button
text
string
Example:
Please use button below to Login/Register:
type
string
Example:
template
confidence
integer
Example:
100
finalStep
boolean
Example:
true
suggestion
string
Template Component
Bottom Button
Object
payload
Object
value
string
Example:
know_about_start_up
variable
string
Example:
show_start_button
title
string
Example:
Know More
type
string
Example:
postback
variableType
Object
type
string
Example:
regexParser
valueName
string
Example:
show_start_button_about
values
Object
0
string
Example:
know
1
string
Example:
more
2
string
Example:
know more
Web Url Button
Object
title
string
Example:
Click Here
type
string
Example:
web_url
url
string
Example:
https://api.startupindiahub.org.in/sih/api/noauth/oauth2/code/generate?redirect_url=http://design.sbitms.in/getcode.html?user_id=-L-0auYeIElp720mgYWa?Conv_Id=58e240056ddea558008b4568?App_id=58ba71c7e2ca0152008b456b?Bot_id=58cba30f8a186f52008b4605?channelId=web
Card Object
Object
type
string
Example:
card_list
id
string
Example:
<videoId | required>
title
string
Example:
<videoTitle | required>
image
string
Example:
<videoThumbnail | required>
url
string
Example:
<url | optional>
default_action
Object
type
string
Example:
web_url
url
string
Example:
<url | optional | default_action added only when the url is present>
webview_height_ratio
string
Example:
tall
buttons
Array
Object
type
string
Example:
web_url
title
string
Example:
Watch Video
url
string
Example:
<url | optional | buttons added only when the url is present>
Card Template
Object
attachment
Object
type
string
Example:
template
payload
Object
template_type
string
Example:
search_list
text
string
Example:
Latest Videos
list
Array of Card Object
Schema Push Content
Send Text Object
Object
type
string
Example:
push
key
string
Example:
ae532a62-bdcb-4c15-bf1a-28f359bdd9ea
preview_title
string
Example:
hi user whats up..
preview_description
string
preview_image
string
message
Object
text
string
Example:
hi user whats up..
Send Chat Button
Object
type
string
Example:
push
message
Object
attachment
Object
type
string
Example:
template
payload
Object
template_type
string
Example:
button
text
string
Example:
Social Media
buttons
Array
Object
title
string
Example:
facebook
type
string
Example:
web_url
url
string
Example:
Https://facebook.com
key
string
Example:
ae532a62-bdcb-4c15-bf1a-28f359bdd9ea
Send Image
Object
type
string
Example:
push
key
string
Example:
ae532a62-bdcb-4c15-bf1a-28f359bdd9ea
preview_title
string
Example:
Indian Captain Virat Kohli
preview_description
string
preview_image
string
Example:
https://s3-ap-southeast-1.amazonaws.com/arrowai-dreamfactory/images/581d9538-57e6-ad27-ca66-5d305aef3d12263697.20.jpg
message
Object
attachment
Object
type
string
Example:
image
payload
Object
text
string
Example:
Indian Captain Virat Kohli
images
Object
url
string
Example:
https://s3-ap-southeast-1.amazonaws.com/arrowai-dreamfactory/images/581d9538-57e6-ad27-ca66-5d305aef3d12263697.20.jpg
attachment_id
boolean
send Video
Object
type
string
Example:
push
preview_title
string
preview_description
string
Example:
no
preview_image
string
message
Object
attachment
Object
type
string
Example:
template
payload
Object
template_type
string
Example:
search_list
text
string
Example:
Latest Videos
list
Array
Object
type
string
Example:
card_list
id
string
Example:
123456
title
string
Example:
virat kohli
image
string
Example:
https://s3-ap-southeast-1.amazonaws.com/arrowai-dreamfactory/images/16299449-9a22-be78-380c-2313bcd35b96263697.20.jpg
url
string
Example:
www.cricbuzz.com
default_action
Object
type
string
Example:
web_url
url
string
webview_height_ratio
string
Example:
tall
buttons
Array
Object
title
string
Example:
Captain
type
string
Example:
web_url
url
string
Example:
Https://google.com
key
string
Example:
ae532a62-bdcb-4c15-bf1a-28f359bdd9ea
Send List
Object
type
string
Example:
push
preview_title
string
preview_description
string
Example:
List
preview_image
string
message
Object
attachment
Object
payload
Object
button
Array
Object
title
string
Example:
aaa
type
string
Example:
web_url
url
string
Example:
aaa
list
Array
Object
buttons
Array
Object
title
string
Example:
button1
type
string
Example:
web_url
url
string
Example:
Https://google.com
description
string
Example:
virat virat virat
image
string
Example:
https://s3-ap-southeast-1.amazonaws.com/arrowai-dreamfactory/images/b70ca4a1-5e2c-4ea0-b521-10399f3e5258263697.20.jpg
title
string
Example:
virat is on fire
url
string
Example:
www.virat.com
template_type
string
Example:
compact_list
type
string
Example:
template
key
string
Example:
ae532a62-bdcb-4c15-bf1a-28f359bdd9ea
Cohort Conditions
Object
userWhoDidConditionList
Object
conditionType
string
Example:
or
conditions
Array
Object
mainFilterKey
Object
eventId
string
Example:
interaction_engine
eventType
string
Example:
new_user_created
timeFilter
Object
name
string
Example:
inPast
duration
integer
Example:
5
durationType
string
Example:
days
filters
Array
Object
key
string
Example:
integration
conditions
Object
operator
string
Example:
=
value
string
Example:
web
where
Object
key
string
Example:
count
conditions
Object
operator
string
Example:
=
value
integer
Example:
1
userWhoDidNotConditionList
Object
conditionType
string
Example:
or
conditions
Array
Object
mainFilterKey
Object
eventId
string
Example:
interaction_engine
eventType
string
Example:
new_user_created
timeFilter
Object
name
string
Example:
inPast
duration
integer
Example:
5
durationType
string
Example:
days
filters
Array
Object
key
string
Example:
integration
conditions
Object
operator
string
Example:
=
value
string
Example:
web
where
Object
key
string
Example:
count
conditions
Object
operator
string
Example:
=
value
integer
Example:
1
userPropertiesConditionList
Object
conditionType
string
Example:
or
conditions
Array
Object
conditions
Object
operator
string
Example:
=
key
string
Example:
data.integration
value
string
Example:
web
Example 1
{
    "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"
            }
        ]
    }
}