This repository was archived by the owner on Sep 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollection.json
More file actions
611 lines (611 loc) · 33.7 KB
/
Copy pathcollection.json
File metadata and controls
611 lines (611 loc) · 33.7 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
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
{
"id": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"owner": "1485",
"name": "BAS People API - Version 1 [Test Runner]",
"description": "### BAS People API - Version 1 - Test Runner Collection\n\n#### Audience\n\nThis collection is reserved for automated testing.\n\nFor end-user reference, testing and experimentation see the *Reference* collection instead.\n\n#### Usage\n\nTODO:\n\n* Environment\n* Token request setup\n* Task runner\n* Newman",
"order": [
"58d151e8-ba1f-89da-0ae0-122d2054e118",
"e9bc0318-249e-f0be-6fb6-066f3c6e0d09",
"51345a45-bdfd-e98b-8ffe-9364d4953e92",
"55205d71-23f9-a4b3-c0cf-a041d6f9a114",
"09385747-ed0b-f4bc-d1fe-f2783955233b",
"207e6dba-0adc-f0b8-c20c-eb61df1079a1"
],
"folders": [],
"timestamp": 1441965282698,
"remoteLink": "",
"public": false,
"lastUpdatedBy": {
"id": "1485",
"username": "Felix Fennell"
},
"lastRevision": 2915956,
"team": null,
"requests": [
{
"id": "09385747-ed0b-f4bc-d1fe-f2783955233b",
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"url": "https://api.bas.ac.uk/people/v1/people/{{person-alias}}",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"tests": "// Tests\n\n// Check response was successful\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n// Check response was returned in good time\ntests[\"Response time is less than 1s\"] = responseTime < 1000;\n\n// Check response has correct content-type\nvar contentTypeHeader = postman.getResponseHeader(\"Content-type\");\nif (contentTypeHeader !== null)\n{\n tests[\"Content-Type is present\"] = true;\n}\nif (tests[\"Content-Type is present\"] === true && contentTypeHeader == 'application/json')\n{\n tests[\"Content-Type is JSON\"] = true;\n}\n\n// Check response contains token value\n// TODO: Convert to JSON schema validation\ntests[\"Data is present\"] = false;\n\nif (tests[\"Content-Type is JSON\"] === true) {\n var payload = JSON.parse(responseBody);\n if (typeof payload.data !== 'undefined')\n {\n tests[\"Data is present\"] = true;\n }\n}\n",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1442147740348,
"name": "Request a person (by alias)",
"description": "Requests a specific person by their alias.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n* `person-alias`: An alias (i.e. NERUM ID) of a valid person\n\n",
"collectionId": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"responses": [
{
"status": "",
"responseCode": {
"code": 200,
"name": "OK",
"detail": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action."
},
"time": 273,
"headers": [
{
"name": "Cache-Control",
"key": "Cache-Control",
"value": "no-cache",
"description": "Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds"
},
{
"name": "Content-Length",
"key": "Content-Length",
"value": "520",
"description": "The length of the response body in octets (8-bit bytes)"
},
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json",
"description": "The mime type of this content"
},
{
"name": "Date",
"key": "Date",
"value": "Fri, 11 Sep 2015 10:25:05 GMT",
"description": "The date and time that the message was sent"
},
{
"name": "Server",
"key": "Server",
"value": "Apache",
"description": "A name for the server"
},
{
"name": "Vary",
"key": "Vary",
"value": "Authorization",
"description": "Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server."
}
],
"cookies": [],
"mime": "",
"text": "{\"data\":{\"id\":1976,\"encoded_id\":\"0abb105ac09fdbcec1f94deeb6a1a859\",\"shortref_id\":null,\"phone\":\"1222\",\"show_phone\":\"0\",\"email_id\":\"saran\",\"name_title\":\"Miss\",\"name_first\":\"Sarah\",\"name_middle\":\"Marie\",\"name_last\":\"Chapman\",\"pref_name_title\":null,\"pref_name_first\":\"Sarah\",\"pref_name_last\":null,\"job_title\":\"Scientific Data Manager\",\"show_job_title\":\"1\",\"updated_on\":\"2015-07-13 08:00:12\",\"email_address\":\"saran@bas.ac.uk\",\"avatars\":[],\"biography\":null,\"research_interests\":null,\"collaborations\":null,\"publications\":null}}",
"language": "javascript",
"rawDataType": "text",
"state": {
"size": "normal"
},
"previewType": "html",
"searchResultScrolledTo": -1,
"forceNoPretty": false,
"write": true,
"empty": false,
"failed": false,
"isSample": true,
"scrollToResult": true,
"runTests": true,
"id": "ddaedf2f-fd2e-9b2a-6db3-3f9a8e5ad82b",
"name": "200-success",
"request": {
"name": "Request a person (by alias)",
"description": "Requests a specific person by their alias.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n* `sample-person-alias`: An alias (i.e. NERUM ID) of a valid person\n\n",
"url": "https://api.bas.ac.uk/people/v1/people/{{sample-person-alias}}",
"pathVariables": {},
"data": [],
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"dataMode": "params",
"method": "GET",
"tests": "",
"isFromCollection": true,
"write": true,
"version": 2
}
},
{
"status": "",
"responseCode": {
"code": 200,
"name": "OK"
},
"time": "273",
"headers": [
{
"name": "Cache-Control",
"key": "Cache-Control",
"value": "no-cache",
"description": ""
},
{
"name": "Content-Length",
"key": "Content-Length",
"value": "520",
"description": ""
},
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json",
"description": ""
},
{
"name": "Date",
"key": "Date",
"value": "Fri, 11 Sep 2015 10:25:05 GMT",
"description": ""
},
{
"name": "Server",
"key": "Server",
"value": "Apache",
"description": ""
},
{
"name": "Vary",
"key": "Vary",
"value": "Authorization",
"description": ""
}
],
"cookies": [],
"mime": "",
"text": "{\"data\":{\"id\":1976,\"encoded_id\":\"0abb105ac09fdbcec1f94deeb6a1a859\",\"shortref_id\":null,\"phone\":\"1222\",\"show_phone\":\"0\",\"email_id\":\"saran\",\"name_title\":\"Miss\",\"name_first\":\"Sarah\",\"name_middle\":\"Marie\",\"name_last\":\"Chapman\",\"pref_name_title\":null,\"pref_name_first\":\"Sarah\",\"pref_name_last\":null,\"job_title\":\"Scientific Data Manager\",\"show_job_title\":\"1\",\"updated_on\":\"2015-07-13 08:00:12\",\"email_address\":\"saran@bas.ac.uk\",\"avatars\":[],\"biography\":null,\"research_interests\":null,\"collaborations\":null,\"publications\":null}}",
"language": "javascript",
"rawDataType": "text",
"state": {
"size": "normal"
},
"previewType": "html",
"searchResultScrolledTo": "-1",
"name": "200-success",
"request": {
"name": "Request a person (by alias)",
"description": "Requests a specific person by their alias.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n* `sample-person-alias`: An alias (i.e. NERUM ID) of a valid person\n\n",
"url": "https://api.bas.ac.uk/people/v1/people/{{sample-person-alias}}",
"pathVariables": {},
"data": [],
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"dataMode": "params",
"method": "GET",
"tests": "",
"isFromCollection": true,
"write": true,
"version": 2
},
"requestObject": "{\"name\":\"Request a person (by alias)\",\"description\":\"Requests a specific person by their alias.\\n\\n#### Usage\\n\\nEnsure you have a suitable environment selected with the following variables defined:\\n\\n* `auth-token`: A valid API token generated using the *Request new API token* method\\n* `sample-person-alias`: An alias (i.e. NERUM ID) of a valid person\\n\\n\",\"url\":\"https://api.bas.ac.uk/people/v1/people/{{sample-person-alias}}\",\"pathVariables\":{},\"data\":[],\"headers\":\"Accept: application/json\\nContent-Type: application/json\\nAuthorization: Bearer {{auth-token}}\\n\",\"dataMode\":\"params\",\"method\":\"GET\",\"tests\":\"\",\"isFromCollection\":true,\"write\":true,\"version\":2}",
"owner": "1485",
"id": "ddaedf2f-fd2e-9b2a-6db3-3f9a8e5ad82b",
"lastUpdatedBy": {
"id": "1485",
"username": "Felix Fennell"
},
"createdAt": "2015-09-11T10:27:13.116Z",
"updatedAt": "2015-09-11T10:27:13.116Z",
"write": true
}
]
},
{
"id": "207e6dba-0adc-f0b8-c20c-eb61df1079a1",
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{api-token}}\n",
"url": "https://api.bas.ac.uk/people/v1/tokens",
"preRequestScript": "",
"pathVariables": {},
"method": "DELETE",
"data": [],
"dataMode": "params",
"version": 2,
"tests": "// Tests\n\n// Check response was successful\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n// Check response was returned in good time\ntests[\"Response time is less than 1s\"] = responseTime < 1000;\n\n// Check response has correct content-type\nvar contentTypeHeader = postman.getResponseHeader(\"Content-type\");\nif (contentTypeHeader !== null)\n{\n tests[\"Content-Type is present\"] = true;\n}\nif (tests[\"Content-Type is present\"] === true && contentTypeHeader == 'application/json')\n{\n tests[\"Content-Type is JSON\"] = true;\n}\n\n// TODO: Check payload is valid\n",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1442077304316,
"name": "Blacklist API Token",
"description": "Blacklists a non-expired API token to prevent any further use.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n",
"collectionId": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"responses": []
},
{
"id": "51345a45-bdfd-e98b-8ffe-9364d4953e92",
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"url": "https://api.bas.ac.uk/people/v1/people",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"tests": "// Tests\n\n// Check response was successful\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n// Check response was returned in good time\ntests[\"Response time is less than 3s\"] = responseTime < 3000;\n\n// Check response has correct content-type\nvar contentTypeHeader = postman.getResponseHeader(\"Content-type\");\nif (contentTypeHeader !== null)\n{\n tests[\"Content-Type is present\"] = true;\n}\nif (tests[\"Content-Type is present\"] === true && contentTypeHeader == 'application/json')\n{\n tests[\"Content-Type is JSON\"] = true;\n}\n\n// Check response contains token value\n// TODO: Convert to JSON schema validation\ntests[\"Data is present\"] = false;\n\nif (tests[\"Content-Type is JSON\"] === true) {\n var payload = JSON.parse(responseBody);\n if (typeof payload.data !== 'undefined')\n {\n tests[\"Data is present\"] = true;\n }\n}\n",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1442077193180,
"name": "Request all people",
"description": "Requests a listing of every person.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n",
"collectionId": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"responses": []
},
{
"id": "55205d71-23f9-a4b3-c0cf-a041d6f9a114",
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"url": "https://api.bas.ac.uk/people/v1/people/{{person-id}}",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"tests": "// Tests\n\n// Check response was successful\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n// Check response was returned in good time\ntests[\"Response time is less than 1s\"] = responseTime < 1000;\n\n// Check response has correct content-type\nvar contentTypeHeader = postman.getResponseHeader(\"Content-type\");\nif (contentTypeHeader !== null)\n{\n tests[\"Content-Type is present\"] = true;\n}\nif (tests[\"Content-Type is present\"] === true && contentTypeHeader == 'application/json')\n{\n tests[\"Content-Type is JSON\"] = true;\n}\n\n// Check response contains token value\n// TODO: Convert to JSON schema validation\ntests[\"Data is present\"] = false;\n\nif (tests[\"Content-Type is JSON\"] === true) {\n var payload = JSON.parse(responseBody);\n if (typeof payload.data !== 'undefined')\n {\n tests[\"Data is present\"] = true;\n }\n}\n",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1442147750065,
"name": "Request a person (by id)",
"description": "Requests a specific person by their identifier.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n* `person-id`: An API identifier of a valid person\n",
"collectionId": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"responses": [
{
"status": "",
"responseCode": {
"code": 200,
"name": "OK",
"detail": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action."
},
"time": 148,
"headers": [
{
"name": "Cache-Control",
"key": "Cache-Control",
"value": "no-cache",
"description": "Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds"
},
{
"name": "Content-Length",
"key": "Content-Length",
"value": "520",
"description": "The length of the response body in octets (8-bit bytes)"
},
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json",
"description": "The mime type of this content"
},
{
"name": "Date",
"key": "Date",
"value": "Fri, 11 Sep 2015 10:29:49 GMT",
"description": "The date and time that the message was sent"
},
{
"name": "Server",
"key": "Server",
"value": "Apache",
"description": "A name for the server"
},
{
"name": "Vary",
"key": "Vary",
"value": "Authorization",
"description": "Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server."
}
],
"cookies": [],
"mime": "",
"text": "{\"data\":{\"id\":1976,\"encoded_id\":\"0abb105ac09fdbcec1f94deeb6a1a859\",\"shortref_id\":null,\"phone\":\"1222\",\"show_phone\":\"0\",\"email_id\":\"saran\",\"name_title\":\"Miss\",\"name_first\":\"Sarah\",\"name_middle\":\"Marie\",\"name_last\":\"Chapman\",\"pref_name_title\":null,\"pref_name_first\":\"Sarah\",\"pref_name_last\":null,\"job_title\":\"Scientific Data Manager\",\"show_job_title\":\"1\",\"updated_on\":\"2015-07-13 08:00:12\",\"email_address\":\"saran@bas.ac.uk\",\"avatars\":[],\"biography\":null,\"research_interests\":null,\"collaborations\":null,\"publications\":null}}",
"language": "javascript",
"rawDataType": "text",
"state": {
"size": "normal"
},
"previewType": "html",
"searchResultScrolledTo": -1,
"forceNoPretty": false,
"write": true,
"empty": false,
"failed": false,
"isSample": true,
"scrollToResult": true,
"runTests": true,
"id": "0d825e3c-e97f-287e-1a61-e6d2a17dd136",
"name": "200-success",
"request": {
"name": "Request a person (by id)",
"description": "Requests a specific person by their identifier.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n* `sample-person-alias`: An API identifier of a valid person\n",
"url": "https://api.bas.ac.uk/people/v1/people/{{sample-person-id}}",
"pathVariables": {},
"data": [],
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"dataMode": "params",
"method": "GET",
"tests": "",
"isFromCollection": true,
"version": 2
}
},
{
"status": "",
"responseCode": {
"code": 200,
"name": "OK"
},
"time": "148",
"headers": [
{
"name": "Cache-Control",
"key": "Cache-Control",
"value": "no-cache",
"description": ""
},
{
"name": "Content-Length",
"key": "Content-Length",
"value": "520",
"description": ""
},
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json",
"description": ""
},
{
"name": "Date",
"key": "Date",
"value": "Fri, 11 Sep 2015 10:29:49 GMT",
"description": ""
},
{
"name": "Server",
"key": "Server",
"value": "Apache",
"description": ""
},
{
"name": "Vary",
"key": "Vary",
"value": "Authorization",
"description": ""
}
],
"cookies": [],
"mime": "",
"text": "{\"data\":{\"id\":1976,\"encoded_id\":\"0abb105ac09fdbcec1f94deeb6a1a859\",\"shortref_id\":null,\"phone\":\"1222\",\"show_phone\":\"0\",\"email_id\":\"saran\",\"name_title\":\"Miss\",\"name_first\":\"Sarah\",\"name_middle\":\"Marie\",\"name_last\":\"Chapman\",\"pref_name_title\":null,\"pref_name_first\":\"Sarah\",\"pref_name_last\":null,\"job_title\":\"Scientific Data Manager\",\"show_job_title\":\"1\",\"updated_on\":\"2015-07-13 08:00:12\",\"email_address\":\"saran@bas.ac.uk\",\"avatars\":[],\"biography\":null,\"research_interests\":null,\"collaborations\":null,\"publications\":null}}",
"language": "javascript",
"rawDataType": "text",
"state": {
"size": "normal"
},
"previewType": "html",
"searchResultScrolledTo": "-1",
"name": "200-success",
"request": {
"name": "Request a person (by id)",
"description": "Requests a specific person by their identifier.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-token`: A valid API token generated using the *Request new API token* method\n* `sample-person-alias`: An API identifier of a valid person\n",
"url": "https://api.bas.ac.uk/people/v1/people/{{sample-person-id}}",
"pathVariables": {},
"data": [],
"headers": "Accept: application/json\nContent-Type: application/json\nAuthorization: Bearer {{auth-token}}\n",
"dataMode": "params",
"method": "GET",
"tests": "",
"isFromCollection": true,
"version": 2
},
"requestObject": "{\"name\":\"Request a person (by id)\",\"description\":\"Requests a specific person by their identifier.\\n\\n#### Usage\\n\\nEnsure you have a suitable environment selected with the following variables defined:\\n\\n* `auth-token`: A valid API token generated using the *Request new API token* method\\n* `sample-person-alias`: An API identifier of a valid person\\n\",\"url\":\"https://api.bas.ac.uk/people/v1/people/{{sample-person-id}}\",\"pathVariables\":{},\"data\":[],\"headers\":\"Accept: application/json\\nContent-Type: application/json\\nAuthorization: Bearer {{auth-token}}\\n\",\"dataMode\":\"params\",\"method\":\"GET\",\"tests\":\"\",\"isFromCollection\":true,\"version\":2}",
"owner": "1485",
"id": "0d825e3c-e97f-287e-1a61-e6d2a17dd136",
"lastUpdatedBy": {
"id": "1485",
"username": "Felix Fennell"
},
"createdAt": "2015-09-11T10:29:54.609Z",
"updatedAt": "2015-09-11T10:29:54.609Z",
"write": true
}
]
},
{
"id": "58d151e8-ba1f-89da-0ae0-122d2054e118",
"headers": "Accept: application/json\nContent-Type: application/json\n",
"url": "https://api.bas.ac.uk/people/v1/heartbeat",
"preRequestScript": "",
"pathVariables": {},
"method": "OPTIONS",
"data": [],
"dataMode": "params",
"version": 2,
"tests": "// Check response was successful\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n// Check response was returned in good time\ntests[\"Response time is less than 1s\"] = responseTime < 1000;\n\n// Check response has correct content-type\nvar contentTypeHeader = postman.getResponseHeader(\"Content-type\");\nif (contentTypeHeader !== null)\n{\n tests[\"Content-Type is present\"] = true;\n}\nif (tests[\"Content-Type is present\"] === true && contentTypeHeader == 'application/json')\n{\n tests[\"Content-Type is JSON\"] = true;\n}\n\n// Check response contains heartbeat value\n// TODO: Convert to JSON schema validation\nif (tests[\"Content-Type is JSON\"] === true) {\n var payload = JSON.parse(responseBody);\n tests[\"Heartbeat is correct\"] = payload.data.heartbeat === 'badump, badump';\n}\n",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1442077038938,
"name": "Get API heartbeat",
"description": "Returns a successful response if the API is currently available.",
"collectionId": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"responses": []
},
{
"id": "e9bc0318-249e-f0be-6fb6-066f3c6e0d09",
"headers": "Accept: application/json\nContent-Type: application/json\n",
"url": "https://api.bas.ac.uk/people/v1/tokens",
"preRequestScript": "",
"pathVariables": {},
"method": "POST",
"data": [],
"dataMode": "raw",
"version": 2,
"tests": "// Schema for JSON schema validation\n// Must be defined before use in tests.\n// Due to https://github.com/postmanlabs/postman-app-support/issues/719 we can't use remote schema's (yet).\nvar schema = {$schema:\"http://json-schema.org/draft-04/schema#\",id:\"https://s3-eu-west-1.amazonaws.com/packages.calcifer.co/scratch/schemas.api.bas.ac.uk/people/v1/POST/tokens.json-schema\",type:\"object\",title:\"Root schema.\",description:\"Response payload returned after successfully generating a new auth token for the BAS People API - Version 1.\",name:\"/\",properties:{notices:{id:\"https://s3-eu-west-1.amazonaws.com/packages.calcifer.co/scratch/schemas.api.bas.ac.uk/people/v1/POST/tokens.json-schema/notices\",type:\"array\",title:\"Notices schema.\",description:\"One or more notices. Whether any are defined will depend on the rest of the response.\",name:\"notices\",items:{id:\"https://s3-eu-west-1.amazonaws.com/packages.calcifer.co/scratch/schemas.api.bas.ac.uk/people/v1/POST/tokens.json-schema/notices/notice\",type:\"object\",title:\"Notice schema.\",description:\"A human readable, informative, message regarding an aspect of the response or the service generally.\",name:\"notice\",properties:{type:{id:\"https://s3-eu-west-1.amazonaws.com/packages.calcifer.co/scratch/schemas.api.bas.ac.uk/people/v1/POST/tokens.json-schema/notices/notice/type\",type:\"string\",title:\"Notice type schema.\",description:\"A concise, URL safe, machine and human readable, description of the kind of notice.\",name:\"type\",example:\"token_generated\"}},required:[\"type\"]},additionalItems:!1},data:{id:\"https://s3-eu-west-1.amazonaws.com/packages.calcifer.co/scratch/schemas.api.bas.ac.uk/people/v1/POST/tokens.json-schema/data\",type:\"object\",title:\"Token data schema.\",description:\"A valid API authentication token and associated, machine readable, meta-data.\",name:\"data\",properties:{token:{id:\"https://s3-eu-west-1.amazonaws.com/packages.calcifer.co/scratch/schemas.api.bas.ac.uk/people/v1/POST/tokens.json-schema/data/token\",type:\"string\",title:\"Token schema.\",description:\"A valid API authentication token.\",name:\"token\",example:\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLmJhcy5hYy51a1wvdjFcL3Rva2VucyIsInN1YiI6MSwiaWF0IjoxNDQyNjY2MjQxLCJleHAiOjE0NDI2Njk4NDF9.bd9hzaMvORFE2JSRwdV3FluScT5QFwU1XvDGaQ2CqZ8\"}},required:[\"token\"]}},required:[\"data\"]};\n\n\n// Tests\n\n// Check response was successful\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n// Check response was returned in good time\ntests[\"Response time is less than 1s\"] = responseTime < 1000;\n\n// Check response has correct content-type\nvar contentTypeHeader = postman.getResponseHeader(\"Content-type\");\nif (contentTypeHeader !== null)\n{\n tests[\"Content-Type is present\"] = true;\n}\nif (tests[\"Content-Type is present\"] === true && contentTypeHeader == 'application/json')\n{\n tests[\"Content-Type is JSON\"] = true;\n}\n\n// Check response contains payload\nvar payload = null;\ntests[\"Payload is JSON\"] = false;\n\nif (tests[\"Content-Type is JSON\"] === true) {\n if (typeof responseBody !== 'undefined')\n {\n payload = JSON.parse(responseBody);\n tests[\"Payload is JSON\"] = true;\n }\n}\n\n// Check response payload passes JSON schema validation\nif (tests[\"Payload is JSON\"] === true)\n{\n console.log(tv4.error);\n tests[\"Payload is valid\"] = tv4.validate(payload, schema);\n}\n\n\n// Environment configuration\nif (tests[\"Payload is JSON\"] === true)\n{\n postman.setEnvironmentVariable(\"auth-token\", payload.data.token);\n}\n",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1442674227359,
"name": "Request new API token",
"description": "Requests a new API token using a specified user account.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-username`: The username of a valid API user account\n* `auth-password`: The corrisponding password to the API user account\n",
"collectionId": "44e015e2-460f-3a77-bc68-74c53e7b9afa",
"responses": [
{
"status": "",
"responseCode": {
"code": 200,
"name": "OK",
"detail": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action."
},
"time": 505,
"headers": [
{
"name": "Cache-Control",
"key": "Cache-Control",
"value": "no-cache",
"description": "Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds"
},
{
"name": "Content-Length",
"key": "Content-Length",
"value": "414",
"description": "The length of the response body in octets (8-bit bytes)"
},
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json",
"description": "The mime type of this content"
},
{
"name": "Date",
"key": "Date",
"value": "Fri, 11 Sep 2015 10:15:15 GMT",
"description": "The date and time that the message was sent"
},
{
"name": "Server",
"key": "Server",
"value": "Apache",
"description": "A name for the server"
}
],
"cookies": [],
"mime": "",
"text": "{\"notices\":[{\"type\":\"token_generated\",\"details\":{\"expiry\":{\"expires\":1441970115,\"message\":\"This token will expire at: 2015-09-11 12:15:15, at which point you will need to request a new token.\"}}}],\"data\":{\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLmJhcy5hYy51a1wvdjFcL3Rva2VucyIsInN1YiI6MSwiaWF0IjoxNDQxOTY2NTE1LCJleHAiOjE0NDE5NzAxMTV9.JzeXKqS4A2r3LQjLlBSIwlkRxC5xOQYRZjGCBJgKj8s\"}}",
"language": "javascript",
"rawDataType": "text",
"state": {
"size": "normal"
},
"previewType": "html",
"searchResultScrolledTo": -1,
"forceNoPretty": false,
"write": true,
"empty": false,
"failed": false,
"isSample": true,
"scrollToResult": true,
"runTests": true,
"id": "3f981504-3137-356a-fd16-d225af864964",
"name": "token-generated",
"request": {
"name": "Request new API token",
"description": "Requests a new API token using a specified user account.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-username`: The username of a valid API user account\n* `auth-password`: The corrisponding password to the API user account\n",
"url": "https://api.bas.ac.uk/people/v1/tokens",
"pathVariables": {},
"data": "{\n \"username\": \"{{auth-username}}\",\n \"password\": \"{{auth-password}}\"\n}\n",
"headers": "Accept: application/json\nContent-Type: application/json\n",
"dataMode": "raw",
"method": "POST",
"tests": "var payload = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"auth-token\", payload.data.token);\n",
"isFromCollection": true,
"version": 2
}
},
{
"status": "",
"responseCode": {
"code": 200,
"name": "OK"
},
"time": "505",
"headers": [
{
"name": "Cache-Control",
"key": "Cache-Control",
"value": "no-cache",
"description": ""
},
{
"name": "Content-Length",
"key": "Content-Length",
"value": "414",
"description": ""
},
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json",
"description": ""
},
{
"name": "Date",
"key": "Date",
"value": "Fri, 11 Sep 2015 10:15:15 GMT",
"description": ""
},
{
"name": "Server",
"key": "Server",
"value": "Apache",
"description": ""
}
],
"cookies": [],
"mime": "",
"text": "{\"notices\":[{\"type\":\"token_generated\",\"details\":{\"expiry\":{\"expires\":1441970115,\"message\":\"This token will expire at: 2015-09-11 12:15:15, at which point you will need to request a new token.\"}}}],\"data\":{\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLmJhcy5hYy51a1wvdjFcL3Rva2VucyIsInN1YiI6MSwiaWF0IjoxNDQxOTY2NTE1LCJleHAiOjE0NDE5NzAxMTV9.JzeXKqS4A2r3LQjLlBSIwlkRxC5xOQYRZjGCBJgKj8s\"}}",
"language": "javascript",
"rawDataType": "text",
"state": {
"size": "normal"
},
"previewType": "html",
"searchResultScrolledTo": "-1",
"name": "token-generated",
"request": {
"name": "Request new API token",
"description": "Requests a new API token using a specified user account.\n\n#### Usage\n\nEnsure you have a suitable environment selected with the following variables defined:\n\n* `auth-username`: The username of a valid API user account\n* `auth-password`: The corrisponding password to the API user account\n",
"url": "https://api.bas.ac.uk/people/v1/tokens",
"pathVariables": {},
"data": "{\n \"username\": \"{{auth-username}}\",\n \"password\": \"{{auth-password}}\"\n}\n",
"headers": "Accept: application/json\nContent-Type: application/json\n",
"dataMode": "raw",
"method": "POST",
"tests": "var payload = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"auth-token\", payload.data.token);\n",
"isFromCollection": true,
"version": 2
},
"requestObject": "{\"name\":\"Request new API token\",\"description\":\"Requests a new API token using a specified user account.\\n\\n#### Usage\\n\\nEnsure you have a suitable environment selected with the following variables defined:\\n\\n* `auth-username`: The username of a valid API user account\\n* `auth-password`: The corrisponding password to the API user account\\n\",\"url\":\"https://api.bas.ac.uk/people/v1/tokens\",\"pathVariables\":{},\"data\":\"{\\n \\\"username\\\": \\\"{{auth-username}}\\\",\\n \\\"password\\\": \\\"{{auth-password}}\\\"\\n}\\n\",\"headers\":\"Accept: application/json\\nContent-Type: application/json\\n\",\"dataMode\":\"raw\",\"method\":\"POST\",\"tests\":\"var payload = JSON.parse(responseBody);\\npostman.setEnvironmentVariable(\\\"auth-token\\\", payload.data.token);\\n\",\"isFromCollection\":true,\"version\":2}",
"owner": "1485",
"id": "3f981504-3137-356a-fd16-d225af864964",
"lastUpdatedBy": {
"id": "1485",
"username": "Felix Fennell"
},
"createdAt": "2015-09-11T10:15:25.685Z",
"updatedAt": "2015-09-11T10:15:25.685Z",
"write": true
}
],
"rawModeData": "{\n \"username\": \"{{auth-username}}\",\n \"password\": \"{{auth-password}}\"\n}\n"
}
]
}