-
Notifications
You must be signed in to change notification settings - Fork 4
/
apiary.apib
166 lines (100 loc) · 3.54 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
FORMAT: 1A
# Dataface
Build and manage data with a spreadsheet-like interface.
# Group Sheets
Resources related to sheets (which is what dataface calls database tables).
## Sheet Collection [/sheets]
### List All Sheets [GET]
+ Response 200 (application/json; charset=utf-8)
+ Attributes (array[Sheet])
### Create a New Sheet [POST]
+ Request (application/json)
{"name": "invoices"}
+ Response 201 (application/json; charset=utf-8)
+ Headers
Location: /sheets/{sheet_name}
+ Body
{"name": "invoices"}
## Sheet [/sheets/{sheet_name}]
+ Parameters
+ sheet_name: `people` (string) - Name of the sheet
### Get basic information about a Sheet [GET]
+ Response 200 (application/json; charset=utf-8)
+ Attributes (Sheet)
### Update a Sheet [PATCH]
To update a Sheet send a JSON payload with the updated value for one or more attributes.
+ Request (application/json)
{"name": "persons"}
+ Response 200 (application/json; charset=utf-8)
{"name": "persons"}
### Delete a Sheet [DELETE]
+ Response 204
## Sheet Column Collection [/sheets/{sheet_name}/columns]
+ Parameters
+ sheet_name: `people` (string) - Name of the sheet
### Get a Sheet's Columns [GET]
+ Response 200 (application/json; charset=utf-8)
+ Attributes (array[Column])
### Create a Column [POST]
+ Request (application/json)
{"name": "email"}
+ Response 201 (application/json; charset=utf-8)
+ Headers
Location: /sheets/{sheet_name}/columns/{column_name}
+ Body
{"name": "email", "type": "text"}
## Sheet Column [/sheets/{sheet_name}/columns/{column_name}]
+ Parameters
+ sheet_name: `people` (string) - Name of the sheet
+ column_name: `name` (string) - Name of the column
### Update a Column [PATCH]
Use this method to rename a column, alter its type or metadata.
+ Request (application/json)
{"name": "full_name"}
+ Response 200 (application/json; charset=utf-8)
{"name": "full_name", "type": "text"}
### Delete a Column [DELETE]
+ Response 204
## Sheet Row Collection [/sheets/{sheet_name}/rows{?id}]
Filter the rows by adding conditions on columns through the querystring parameters.
For example:
+ `?name=John&age=20`
+ Parameters
+ sheet_name: `people` (string) - Name of the sheet
+ id: `2` (number) - Example of filtering the rows by the `id` column
### Get a Sheet's Rows [GET]
+ Response 200 (application/json; charset=utf-8)
+ Headers
+ Attributes (array[Sample Row])
### Add a Row to a Sheet [POST]
+ Request (application/json)
+ Attributes (Sample Row)
+ Response 201 (application/json; charset=utf-8)
+ Attributes (Sample Row)
### Update a Row in a Sheet [PATCH]
> Don't forget to filter the rows through querystrings to ensure you're limiting your update to a single row!
+ `?id=2`
+ Request (application/json)
+ Headers
+ Body
{"name": "Jane"}
+ Response 200 (application/json; charset=utf-8)
+ Body
{"name": "Jane", "age": 35}
### Delete a Row in a Sheet [DELETE]
> Don't forget to filter the rows through querystrings to ensure you're limiting your delete to a single row!
+ `?id=2`
+ Response 204
# Data Structures
## Sheet (object)
+ name: `people` (string) - Name of the sheet. Should be a valid database table name.
## Column (object)
+ name: `name` (string) - Name of the column. Should be a valid database column name.
+ type: `text` (enum[string]) - The type of data stored in the column
+ Members
+ `text`
+ `number`
+ `checkbox`
## Sample Row (object)
+ name: `John` (string)
+ age: `35` (number)