-
Notifications
You must be signed in to change notification settings - Fork 1
/
INTERFACE.apib
111 lines (72 loc) · 2.19 KB
/
INTERFACE.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
FORMAT: 1A
HOST: https://one-list-api.herokuapp.com
# One List
One List is a simple API allowing consumers to manage a TODO list.
## Authentication
*One List API* uses token authentication. Your token can be any text you wish. As long as you use the same token between requests, you'll have access to the same list items.
# Group Items
## Item Collections [/items{?access_token}]
+ Attributes (array[Item])
+ Parameters
+ access_token: illustriousvoyage (string) - Your unique access token
### List Items [GET]
+ Response 200 (application/json)
[
{
"id": 1,
"text": "Learn HTML & CSS",
"complete": true
},
{
"id": 2,
"text": "Master React",
"complete": false
}
]
### Create a New Item [POST]
You may create new items using this action. It takes a JSON object containing the task text.
+ Request (application/json)
{
"item": {
"text": "Learn about Regular Expressions"
}
}
+ Response 201 (application/json)
+ Headers
Location: /items/3
+ Body
{
"id": 3,
"text": "Learn about Regular Expressions",
"complete": false
}
## Singular Item [/items/{id}{?access_token}]
+ Attributes (Item)
+ Parameters
+ id: 1 (number) - The unique identifier of the item
+ access_token: "illustriousvoyage" (string) - Your unique access token
### Retrieve an Item [GET]
+ Request (application/json)
+ Response 200 (application/json)
+ Attributes (Item)
+ Body
{
"id": 1,
"text": "Learn HTML & CSS",
"complete": true
}
### Update an Item [PUT]
+ Request (application/json)
{
"item": {
"complete": true
}
}
+ Response 204
### Remove an Item [DELETE]
+ Request (application/json)
+ Response 200
# Data Structures
## Item (object)
+ text (required, string) - The task at hand
+ complete (boolean) - Whether or not the task has been completed.