-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
297 lines (246 loc) · 9.09 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
FORMAT: 1A
# serviceTickets
Ticket Service is an API to manage Service Tickets. This API fronts both a microservice and a status update REST service from Integration Cloud Service (ICS)
## Tickets Collection [/tickets]
### List All Tickets [GET]
Issue a GET request to get a complete list of tickets. You can include any of the fields as a filter
+ Request
+ Headers
Tenant-id: 31
+ Response 200 (application/json)
{
"_items": [
{
"customer": "ACME Corp",
"status": "Resolved",
"product": "Widget",
"_id": "589a3774ebee507f7268bcff",
"_updated": "Tue, 07 Feb 2017 22:05:38 GMT",
"summary": "Customer reports the widget stopped working",
"_links": {
"self": {
"href": "tickets/589a3774ebee507f7268bcff",
"title": "Ticket"
}
},
"_created": "Thu, 01 Jan 1970 00:00:00 GMT",
"ticketID": "45001",
"_etag": "bd584d9a460eabdc979e428e1e0220923b0c5793",
"subject": "Widget stopped working"
},
{
"customer": "ACME Corp",
"status": "Unresolved",
"product": "Widget",
"ticketID": "45002",
"_updated": "Tue, 07 Feb 2017 21:44:21 GMT",
"summary": "Customer reports the widget stopped working",
"_links": {
"self": {
"href": "tickets/589a3fb534605c000176ef5f",
"title": "Ticket"
}
},
"_created": "Tue, 07 Feb 2017 21:44:21 GMT",
"_id": "589a3fb534605c000176ef5f",
"_etag": "cfe52a36fa7a1c738acc994f6e49a8f3f86ce4bf",
"subject": "Widget stopped working"
},
{
"customer": "ACME Corp",
"status": "Unresolved",
"product": "Widget",
"ticketID": "45002",
"_updated": "Tue, 07 Feb 2017 21:44:37 GMT",
"summary": "Customer reports the widget stopped working",
"_links": {
"self": {
"href": "tickets/589a3fc534605c000176ef60",
"title": "Ticket"
}
},
"_created": "Tue, 07 Feb 2017 21:44:37 GMT",
"_id": "589a3fc534605c000176ef60",
"_etag": "dbcf344b1bcaf9fc6781846ed944d147a875394c",
"subject": "Widget stopped working"
},
{
"status": "Resolved",
"_updated": "Tue, 07 Feb 2017 21:57:59 GMT",
"_links": {
"self": {
"href": "tickets/589a4133fbcb600001ac564b",
"title": "Ticket"
}
},
"_created": "Tue, 07 Feb 2017 21:50:43 GMT",
"_id": "589a4133fbcb600001ac564b",
"_etag": "a8706300f0a38c1d6aa871901475d2f7a9e29e1d"
},
{
"customer": "Smithers Corp",
"status": "Unresolved",
"product": "Idea tablet",
"ticketID": "45003",
"_updated": "Sun, 12 Feb 2017 21:28:52 GMT",
"summary": "When powering up unit, the display is blank",
"_links": {
"self": {
"href": "tickets/58a0d394e0577b0001bcc981",
"title": "Ticket"
}
},
"_created": "Sun, 12 Feb 2017 21:28:52 GMT",
"_id": "58a0d394e0577b0001bcc981",
"_etag": "7a898301b641f1f28dbcf69a6c0dfadf292d6861",
"subject": "Display blank"
}
],
"_links": {
"self": {
"href": "tickets",
"title": "tickets"
},
"parent": {
"href": "/",
"title": "home"
}
},
"_meta": {
"max_results": 25,
"total": 5,
"page": 1
}
}
### Create a New Ticket [POST]
To Create a ticket, post with the complete payload.
+ Request (application/json)
[
{
"ticketID": "45434",
"subject": "Keys are sticking",
"summary": "Customer reports that keys are sticking after spilling a sugar-laden soft-drink on it",
"customer": "Tech Experts",
"customerID": "46995",
"partner": "We-fix-em Computer Services",
"partnerID":"7309",
"product": "Lenovo Laptop Computer",
"status": "Unresolved",
"tracking":""
}
]
+ Response 201 (application/json)
+ Headers
Location: /tickets/58a0d394e0577b0001bcc981
+ Body
{
"_updated": "Sun, 12 Feb 2017 21:28:52 GMT",
"_links": {
"self": {
"href": "tickets/58a0d394e0577b0001bcc981",
"title": "Ticket"
}
},
"_created": "Sun, 12 Feb 2017 21:28:52 GMT",
"_status": "OK",
"_id": "58a0d394e0577b0001bcc981",
"_etag": "7a898301b641f1f28dbcf69a6c0dfadf292d6861"
}
### Update a Ticket [PATCH /tickets/{id}]
+ parameters
+ id: 58a0d394e0577b0001bcc981 (string, required)
+ request (application/json)
+ Headers
If-Match: 7a898301b641f1f28dbcf69a6c0dfadf292d6861
+ Body
{ "status": "Resolved" }
+ response 200 (application/json)
+ Headers
ETag: 638bed8fb23acec55e36beafc1d0f2b2d86539ce
+ Body
{
"_updated": "Sun, 12 Feb 2017 22:48:24 GMT",
"_links": {
"self": {
"href": "tickets/589a3774ebee507f7268bcff",
"title": "Ticket"
}
},
"_created": "Thu, 01 Jan 1970 00:00:00 GMT",
"_status": "OK",
"_id": "589a3774ebee507f7268bcff",
"_etag": "638bed8fb23acec55e36beafc1d0f2b2d86539ce"
}
## Incidents Collection [/incidents]
Incidents is an API for the REST service exposed by Integration Cloud Service. In the future, we will define PATCH /tickets to call the ICS REST service in the process of updating the status in the micro-service, but until that time, we will have a separate API for incidents.
### Update an incident [POST /incidents/{id}]
+ parameters
+ id: 44501 (string, required)
+ request (application/json)
+ Body
{ "status": "Resolved" }
+ response 200 (application/json)FORMAT: 1A
HOST: https://polls.apiblueprint.org/
# VM_ServiceTicket
Polls is a simple API allowing consumers to view polls and vote in them.
## Questions Collection [/questions]
### List All Questions [GET]
+ Response 200 (application/json)
[
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 2048
}, {
"choice": "Python",
"votes": 1024
}, {
"choice": "Objective-C",
"votes": 512
}, {
"choice": "Ruby",
"votes": 256
}
]
}
]
### Create a New Question [POST]
You may create your own question using this action. It takes a JSON
object containing a question and a collection of answers in the
form of choices.
+ Request (application/json)
{
"question": "Favourite programming language?",
"choices": [
"Swift",
"Python",
"Objective-C",
"Ruby"
]
}
+ Response 201 (application/json)
+ Headers
Location: /questions/2
+ Body
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 0
}, {
"choice": "Python",
"votes": 0
}, {
"choice": "Objective-C",
"votes": 0
}, {
"choice": "Ruby",
"votes": 0
}
]
}