-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.yml
141 lines (130 loc) · 3.72 KB
/
user.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
ids: ids.yml
device: device.yml
service:
display-name: User Service
auth: true
base-path: /v1/apps
endpoints:
createOrUpdate:
docs: Creates an AppUser if doesn't exist already, or updates user properties
method: POST
path: /{app_id}/users
path-parameters:
app_id: ids.AppId
request:
name: CreateUserRequest
body:
properties:
user_id:
type: ids.UserId
docs: |
Your user identifier.
if user_id already exists, user properties will be updated else a new user will be created
mobile: optional<string>
email: optional<string>
whats_app:
type: optional<string>
docs: include this only when user's whatsapp mobile is different than primary
mobile
response:
type: RavenUser
docs: Returns updated or newly created user.
examples:
- path-parameters:
app_id: my-app-id
request:
user_id: test-user
mobile: "9876543210"
email: [email protected]
response:
body:
user_id: test-user
slack:
access_token: my-access-token
email: [email protected]
channel_id: channel-123
get:
docs: Gets the requested user
method: GET
path: /{app_id}/users/{user_id}
path-parameters:
app_id:
type: ids.AppId
docs: your app identifier
user_id:
type: ids.UserId
docs: your user identifier
response: RavenUser
examples:
- path-parameters:
app_id: my-app-id
user_id: my-user-id
response:
body:
user_id: my-user-id
slack:
access_token: my-access-token
email: [email protected]
channel_id: channel-123
types:
RavenUser:
properties:
user_id:
type: ids.UserId
docs: |
Your user identifier.
If user_id already exists, user properties will be updated else a new user will be created
user_sid: optional<string>
onesignal_external_id: optional<string>
mobile:
type: optional<string>
email:
type: optional<string>
whatsapp_mobile:
type: optional<string>
docs: Include this only when user's whatsapp mobile is different than primary
mobile
slack: optional<SlackProfile>
telegram: optional<TelegramProfile>
fcm_tokens: optional<list<string>>
onesignal_player_ids: optional<list<string>>
ios_tokens: optional<list<string>>
created_at: optional<long>
updated_at: optional<long>
SlackProfile:
properties:
access_token: string
email: optional<string>
channel_id: optional<string>
TelegramProfile:
properties:
chat_id: string
UserPreferences:
properties:
preferred_channel: optional<Channel>
channel_preferences: optional<ChannelPreferences>
Channel:
enum:
- VOICE
- PUSH
- SMS
- EMAIL
- WHATSAPP
- WEBHOOK
- SLACK
- IN_APP
- TELEGRAM
ChannelPreferences:
properties:
sms: optional<ChannelPreference>
push: optional<ChannelPreference>
whatsapp: optional<ChannelPreference>
email: optional<ChannelPreference>
slack: optional<ChannelPreference>
voice: optional<ChannelPreference>
teams: optional<ChannelPreference>
ChannelPreference:
properties:
disabled: boolean