-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
342 lines (296 loc) · 12.2 KB
/
apiary.apib
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
FORMAT: 1A
HOST: http://www.google.com
# ETMC Comments
Comments API is a service that performs CRUD on comments.
# Group Comments Resources
Comments related resources of the **Comments API**
## Comments Collection [/hub-internal/v1/comments{?filter,pageSize,page,orderBy}]
This API returns all comments that meet the filter criteria.
<strong>Example:</strong> /hub-internal/v1/comments?$filter=Category1 eq 'CampaignApproval-V2' and Category2 eq 1234 and Category3 like 'Email%25' or Category3 like 'Mobile%25' and ObjectId eq 12345$orderBy=CompletedDate DESC, Category3 ASC
+ Parameters
+ filter (optional, string) ... A filter query that can contain any of the following fields (case-sensitive): `Category1`, `Category2`, `Category3`, `ObjectId`, `AddressedDate`, `CompletedDate`
+ orderBy (optional, string) ... keyword used to sort the result-set by one or more columns. It can contain any of the following fields (case-sensitive): `Category1`, `Category2`, `Category3`, `ObjectId`, `AddressedDate`, `CompletedDate`
+ pageSize (optional, number) ... The maximum number of results to return. If not set, **or if the page parameter is not also set**, then defaults to `100`.
+ page (optional, number) ... The one-based page number for results. If not set, defaults to `1`.
### List all Comments [GET]
+ Response 200 (application/json)
[{
"_links": {
"self": { "href": "/comments?page=2&pageSize=3" },
"next": { "href": "/comments?page=1&pageSize=3" },
"prev": { "href": "/comments?page=3&pageSize=3" }
},
"count": 2,
"page": 1,
"pageSize": 10,
"entries": [
{
"id": 123456,
"createdDate": "2014-05-01T16:20:02",
"modifiedDate": "2014-05-01T16:26:31",
"createdBy": 10654823,
"commentVersion": 1,
"category1": "CampaignApproval-V2",
"category2": "5096",
"category3": "EmailComments:Round=1",
"objectId": "25416",
"commentText": "Comment 1",
"childCommentCount": 0,
"ordinal": 1,
"x": "0.36833333333333335",
"y": "0.7341772151898734",
"isActive": true,
"createdByUserName": "John Smith",
"modifiedByUserName": "John Smith",
"modifiedBy": 10654823
},
{
"id": 123457,
"createdDate": "2014-05-01T16:20:02",
"modifiedDate": "2014-05-01T16:26:31",
"createdBy": 10654823,
"commentVersion": 1,
"category1": "CampaignApproval-V2",
"category2": "5096",
"category3": "EmailComments:Round=1",
"objectId": "25416",
"commentText": "Comment 2",
"childCommentCount": 3,
"ordinal": 1,
"x": "0.36833333333333335",
"y": "0.7341772151898734",
"isActive": true,
"createdByUserName": "John Smith",
"modifiedByUserName": "John Smith",
"modifiedBy": 10654823
}]
}]
# Group Comment Resources
## Comment [/hub-internal/v1/comments/]
A single Comment object with all its details
### Create a Comment [POST]
+ Request (application/json)
{
"category1": "CampaignApproval-V2",
"category2": "5096",
"category3": "EmailComments:Round=1",
"objectId": "25416",
"commentText": "Create a comment (post)",
"ordinal": 0,
"x": "0.16666666666666666",
"y": "0.16877637130801687"
}
+ Response 201 (application/json)
{
"id": 123456,
"createdDate": "2014-05-01T16:20:02",
"modifiedDate": "2014-05-01T16:26:31",
"createdBy": 10654823,
"commentVersion": 1,
"category1": "CampaignApproval-V2",
"category2": "5096",
"category3": "EmailComments:Round=1",
"objectId": "25416",
"commentText": "Create a comment (post)",
"childCommentCount": 0,
"commentVersion": 0,
"ordinal": 0,
"x": "0.16666666666666666",
"y": "0.16877637130801687"
"isActive": true,
"createdByUserName": "John Smith",
"modifiedByUserName": "John Smith",
"modifiedBy": 10654823,
"parentId": 0
}
## Comment [/hub-internal/v1/comments/{id}]
A single Comment object with all its details
+ Parameters
+ id (required, number, `123456`) ... number `id` of the Comment to perform action with. Has example value.
### Retrieve a Comment [GET]
+ Response 200 (application/json)
{
"id": 123456,
"createdDate": "2014-05-02T12:52:16",
"modifiedDate": "2014-05-02T12:59:20",
"createdBy": 10654823,
"commentVersion": 3,
"category1": "CampaignApproval-V2",
"category2": "5096",
"category3": "EmailComments:Round=1",
"objectId": "25416",
"commentText": "Comment (Get)",
"ordinal": 2,
"x": "0.27166666666666667",
"y": "0.25316455696202533",
"isActive": true,
"createdByUserName": "John Smith",
"modifiedByUserName": "John Smith",
"modifiedBy": 10654823,
"childCommentCount": 2
}
### Update a Comment [PATCH]
Update a Comment object. A Comment object could be a parent or a child comment.
All fields in the request payload object are optional.
+ Request (application/json)
+ Body
{
"category1": "CampaignApproval-V2",
"category2": "5096",
"category3": "EmailComments:Round=1",
"objectId": "25416",
"commentText": "add comment\nsadfasdf",
"ordinal": 2,
"x": "0.27166666666666667",
"y": "0.25316455696202533",
"isAddressed": true,
"isCompleted": true
}
+ Response 200
+ Body
{
"id": 109,
"createdDate": "2014-05-16T18:01:50.787",
"modifiedDate": "2014-06-06T14:13:24.42",
"commentVersion": 1,
"category1": "yup",
"category2": "hmm",
"category3": "right",
"objectId": "qwerty",
"commentText": "wassup",
"childCommentCount": 0,
"ordinal": 12,
"x": "1.23",
"y": "6.54",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 0,
"addressedDate": "2014-06-06T14:13:24.42",
"completedDate": "2014-06-06T14:13:24.42",
"modifiedBy": 30980
}
### Remove a Comment [DELETE]
Removes a Comment object
+ Response 200 (application/json)
+ Body
{
"message": "Comment 123456 successfully deleted."
}
# Group Child Comments Resources
## Get Collection of Child Comments [/hub-internal/v1/comments/{id}/children/{?pageSize,page}]
### Get [GET]
+ Parameters
+ id (required, number, `101`) ... number `id` of the parent comment to perform action with. Has example value.
+ pageSize (optional, number) ... The maximum number of results to return. If not set, **or if the page parameter is not also set**, then defaults to `100`.
+ page (optional, number) ... The one-based page number for results. If not set, defaults to `1`.
+ Response 200 (application/json)
{
"count": 6,
"page": 0,
"pageSize": 0,
"links": {},
"items": [
{
"id": 102,
"createdDate": "2014-05-12T13:37:46.14",
"modifiedDate": "2014-05-12T13:37:46.14",
"commentVersion": 0,
"commentText": "word",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
},
{
"id": 108,
"createdDate": "2014-05-16T18:00:27.247",
"modifiedDate": "2014-05-16T18:00:27.247",
"commentVersion": 0,
"commentText": "riiiiight",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
},
{
"id": 109,
"createdDate": "2014-05-16T18:01:50.787",
"modifiedDate": "2014-05-16T18:01:50.787",
"commentVersion": 0,
"commentText": "w3rd",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
},
{
"id": 110,
"createdDate": "2014-06-04T11:05:51.42",
"modifiedDate": "2014-06-04T11:05:51.42",
"commentVersion": 0,
"commentText": "riiiiight",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
},
{
"id": 111,
"createdDate": "2014-06-04T11:50:21.93",
"modifiedDate": "2014-06-04T11:50:21.93",
"commentVersion": 0,
"commentText": "riiiiight",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
},
{
"id": 112,
"createdDate": "2014-06-04T11:53:52.01",
"modifiedDate": "2014-06-04T11:53:52.01",
"commentVersion": 0,
"commentText": "riiiiight",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
}
]
}
## Create a Child Comment [/hub-internal/v1/comments/{id}/children/]
+ Parameters
+ id (required, number, `101`) ... number `id` of the parent comment to perform action with. Has example value.
### Create [POST]
+ Request (application/json)
{
"commentText": "New child comment"
}
+ Response 201 (application/json)
{
"id": 114,
"createdDate": "2014-06-06T14:12:00.643",
"modifiedDate": "2014-06-06T14:12:00.643",
"commentVersion": 0,
"commentText": "New child comment",
"isActive": true,
"createdByUserName": "MDS Sub04 2nd DB",
"modifiedByUserName": "MDS Sub04 2nd DB",
"createdBy": 30980,
"parentId": 101,
"modifiedBy": 30980
}