-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_interaction.apib
More file actions
163 lines (142 loc) · 5.65 KB
/
user_interaction.apib
File metadata and controls
163 lines (142 loc) · 5.65 KB
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
# User interaction [/devrant]
## Get user notifications [GET /users/me/notif-feed{?app,token_id,token_key,user_id}]
+ Parameters
+ app: 3 (required, number) - App ID parameter
+ token_id (required, number) - Token ID of the user. Used for authentication
+ token_key (required, string) - Token key of the user. Used for authentication
+ user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication
+ Response 200 (application/json)
+ Attributes (object)
+ success: true (boolean)
+ data (object)
+ items (array) - 100 items in total
+ (object)
+ created_time: 1591546309 (number)
+ type: `content_vote` (enum[string])
Type of notif
+ Members
+ `comment_vote`
+ `comment_content`
+ `comment_mention`
+ `comment_discuss`
+ `content_vote`
+ `rant_sub`
+ read: 0 (number) - 0 = unread, 1 = read
+ rant_id: 2619313 (number)
+ uid: 2451362 (number) - ID of the user that "fired" the notif
+ check_time: 1591546309 (number)
+ username_map (object) - Object with key-value pairs where key is notif ID and value is username
+ unread (object)
+ all: 1 (number)
+ upvotes: 1 (number)
+ mentions: 0 (number)
+ comments: 0 (number)
+ subs: 0 (number)
+ total: 1 (number) - Same as all
+ Body
```js
{
"success": true
"data": {
"items": [
{
"created_time":1591546309,
"type":"content_vote", //Type of ++ (form x_y where x is content/comment and y is vote/discuss)
"read":0, //0 = unread, 1 = read
"rant_id":2619313,
"uid":2451362,
},
//There is going to be 100 total
]
"check_time":1591546309
"username_map": {
"2451362":'"frogstair", // "notif id": "username"
// ...
},
"unread": {
"all": 1,
"upvotes": 1,
"mentions": 0,
"comments": 0,
"subs": 0,
"total": 1 //Same as all
}
}
}
```
## Post a rant [POST /devrant/rants{?app,rant,type,token_id,token_key,user_id}]
+ Parameters
+ app: 3 (required, number) - App ID Parameters
+ rant: `Bla bla bla fuck my life` (required, string) - Text in the rant
+ type: 3 (required, enum[number])
Type of rant
+ Members
+ 1 - Rant
+ 2 - Undefined
+ 3 - Joke/Meme
+ 4 - Question
+ 5 - devRant
+ 6 - Random
+ token_id (required, number) - Token ID of the user. Used for authentication
+ token_key (required, string) - Token key of the user. Used for authentication
+ user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication
+ Request (application/x-form-urlencoded)
+ Response 200 (application/json)
+ Attributes (object)
+ success: true (boolean)
+ rant_id: 2619313 (number)
+ Body
```js
{
"success": true,
"rant_id": 2619313
}
```
## Post a comment [POST /devrant/rants/{id}/comments{?app,comment,token_id,token_key,user_id}]
+ Parameters
+ app: 3 (required, number) - App ID Parameters
+ comment: `This rant sucks!` (required, string) - Comment text
+ token_id (required, number) - Token ID of the user. Used for authentication
+ token_key (required, string) - Token key of the user. Used for authentication
+ user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication
+ Response 200 (application/json)
+ Attributes (object)
+ success: true (boolean)
+ Body
```js
{
"success": true
}
```
## Delete a rant [DELETE /devrant/rants/{id}{?app,token_id,token_key,user_id}]
+ Parameters
+ id (required, number) - ID of the rant to delete
+ app: 3 (required, number) - App ID Parameters
+ token_id (required, number) - Token ID of the user. Used for authentication
+ token_key (required, string) - Token key of the user. Used for authentication
+ user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication
+ Response 200 (application/json)
+ Attributes (object)
+ success: true (boolean)
+ Body
```js
{
"success": true
}
```
## Delete a comment [DELETE /devrant/comments/{id}{?app,token_id,token_key,user_id}]
+ Parameters
+ id (required, number) - ID of the comment to delete
+ app: 3 (required, number) - App ID Parameters
+ token_id (required, number) - Token ID of the user. Used for authentication
+ token_key (required, string) - Token key of the user. Used for authentication
+ user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication
+ Response 200 (application/json)
+ Attributes (object)
+ success: true (boolean)
+ Body
```js
{
"success": true
}
```