-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathopenapi.yaml
286 lines (273 loc) · 7.85 KB
/
openapi.yaml
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
openapi: 3.1.0
info:
title: Vartalap
description: >-
[Vartalap](https://vartalap.one9x.org/) is an open source personal chat
application. It is design to provide the level of transparency in the
personal messaging application with your data.
This is a API documentation of the Vartalap.
For Authorization always set the following headers
``` plaintext
accesskey= # Authentication token as response of login api
user= # Authenticated username
```
version: 1.0.0
servers:
- url: https://{{baseurl}}
components:
securitySchemes:
apikeyAuth:
type: http
scheme: apikey
security:
- apikeyAuth: []
tags:
- name: v1.0
- name: v1.0 > Auth
description: Authentication endpoints
- name: v1.0 > Profile
description: User Profile Endpoints
- name: v1.0 > Gateway
description: >-
Web socket and HTTP Gateway
As postman doesn't yet support adding web socket request in normal
collection.
Endpoint: `wss://{{hostname}}/wss`
- name: v1.0 > Group
description: Endpoints for performing group related actions
- name: v1.0 > Assets
description: File service endpoint to upload and download files
- name: v1.0 > Contact Book
paths:
/v1.0/login:
post:
tags:
- v1.0 > Auth
summary: Login With Firebase
description: Authenticate with Firebase such as Phone Auth
requestBody:
content:
application/json:
schema:
type: object
example:
username: '{{username}}'
authToken: '{{firebase_auth_token}}'
notificationToken: fcm token
deviceId: default
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/profile/:
get:
tags:
- v1.0 > Profile
summary: Get Profile
description: Get User profile
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/messages:
post:
tags:
- v1.0 > Gateway
summary: Send Message
description: Http endpoint to send messages
requestBody:
content:
application/json:
schema:
type: object
example:
- >-
{"_v":2,"id":"string","head":{"type":"chat|group|channel|bot|notification","to":"username|group_id|channel_id|bot_id","from":"username","chatid":"chatid","contentType":"json|text|video|audio|location|form","action":"message|ack|subscribe|unsubscribe|join|leave|create|add-member|remove-member"},"meta":{"hash":"md5:hash","content_hash":"md5:hash","generate_ts":123455667890},"body":{"text":"Hello
this a text message"}}
- >-
{"_v":2,"id":"string","head":{"type":"chat|group|channel|bot|notification","to":"username|group_id|channel_id|bot_id","from":"username","chatid":"chatid","contentType":"json|text|video|audio|location|form","action":"message|ack|subscribe|unsubscribe|join|leave|create|add-member|remove-member"},"meta":{"hash":"md5:hash","content_hash":"md5:hash","generate_ts":123455667890},"body":{"text":"Hello
this a text message"}}
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/groups/:
get:
tags:
- v1.0 > Group
summary: Get All Groups
description: Get All the groups user have access to
responses:
'200':
description: Successful response
content:
application/json: {}
post:
tags:
- v1.0 > Group
summary: Create New Group
description: Create new group chat
requestBody:
content:
application/json:
schema:
type: object
example:
name: Group Name/Title
profilePic: profile-pic-id
members:
- member_1_username
- member_2_username
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/groups/{groupId}:
get:
tags:
- v1.0 > Group
summary: Get Group Info
description: Get group chat information including name, display pic, members
parameters:
- name: groupId
in: path
schema:
type: string
required: true
example: e3dbe14f-c8da-4436-b912-da059098c6a5
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/groups/{groupId}/members:
post:
tags:
- v1.0 > Group
summary: Add Members to Group
description: Add members to existing group chat
requestBody:
content:
application/json:
schema:
type: object
example:
members:
- member_3_username
- member_4_username
parameters:
- name: groupId
in: path
schema:
type: string
required: true
example: e3dbe14f-c8da-4436-b912-da059098c6a5
responses:
'200':
description: Successful response
content:
application/json: {}
delete:
tags:
- v1.0 > Group
summary: Remove Member From Group
description: >-
Remove other members only valid if you have admin permission or Leave
group chat.
parameters:
- name: groupId
in: path
schema:
type: string
required: true
example: e3dbe14f-c8da-4436-b912-da059098c6a5
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/assets/upload/presigned_url:
get:
tags:
- v1.0 > Assets
summary: Generate Presigned URL for upload
parameters:
- name: ext
in: query
schema:
type: string
example: .png
- name: category
in: query
schema:
type: string
example: chat
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/assets/download/{assetId}/presigned_url:
get:
tags:
- v1.0 > Assets
summary: Get Presigned Url to download assets
parameters:
- name: assetId
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/assets/{assetId}/status:
put:
tags:
- v1.0 > Assets
summary: Update Asset Status
requestBody:
content:
application/json:
schema:
type: object
example:
status: true
parameters:
- name: assetId
in: path
schema:
type: string
required: true
example: e3dbe14f-c8da-4436-b912-da059098c6a5
responses:
'200':
description: Successful response
content:
application/json: {}
/v1.0/contactbook/sync:
post:
tags:
- v1.0 > Contact Book
summary: Sync Contact
description: Sync contact book, to fetch list of users using this service
requestBody:
content:
application/json:
schema:
type: object
example:
users:
- username_1
- username_2
responses:
'200':
description: Successful response
content:
application/json: {}