-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathapi-error-cases.http
More file actions
41 lines (33 loc) · 1.39 KB
/
api-error-cases.http
File metadata and controls
41 lines (33 loc) · 1.39 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
### Missing API Code
# Should be OK since GET requests ignore the API code
GET {{baseUrl}}/api/{{apiVersion}}/timers
### Invalid API Code
# Should be OK since GET requests ignore the API code
GET {{baseUrl}}/api/{{apiVersion}}/timers
x-api-code: {{badApiCode}}
### Invalid API Version
# Should return 400 Bad Request with error code 1138 "Api version not supported""
GET {{baseUrl}}/api/v99/timers
x-api-code: {{apiCode}}
### Invalid Endpoint
GET {{baseUrl}}/api/{{apiVersion}}/invalid
x-api-code: {{apiCode}}
### Unsupported HTTP Method
# Should return 405 Method not allowed with error code 1135 "Wrong http method used"
PATCH {{baseUrl}}/api/{{apiVersion}}/timers
x-api-code: {{apiCode}}
### Malformed URI (Too Many Segments)
# Should return 400 Bad Request with error code 1130 "Malformed URI"
GET {{baseUrl}}/api/v4/timers/ABC/123/ABC
### Malformed URI Posting to timers with too few segments
# Should return 400 Bad Request with error code 1130 "Malformed URI"
POST {{baseUrl}}/api/{{apiVersion}}/timers
x-api-code: {{apiCode}}
### Try to start a timer with a bad Talk ID
# Should return 404 Not Found with error code 1129 "Timer does not exist"
POST {{baseUrl}}/api/{{apiVersion}}/timers/1234
x-api-code: {{apiCode}}
### Try to stop a timer with a bad Talk ID
# Should return 404 Not Found with error code 1129 "Timer does not exist"
DELETE {{baseUrl}}/api/{{apiVersion}}/timers/1234
x-api-code: {{apiCode}}