-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapiary.apib
223 lines (173 loc) · 8.87 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
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# UAddress
Simple API for searching Ukraine Addresses
## Search Streets [/streets]
### List of Streets by Search Params [GET /streets{?settlement_id,name,type}]
+ Parameters
+ settlement_id: `eea333b5-e26d-4e3e-92e2-2ab37b131502` (string, required) - Settlement identifier
+ name: `Незалежності` (string, optional) - Street name
+ type: STREET (string, optional) - Street type (Dictionary STREET_TYPE)
+ Response 200 (application/json)
+ Attributes (Response_Collection)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (array[`Response_Street`])
## Search Settlements [/settlements]
### List Of Cities By Search Params [GET /settlements{?name,region,district,koatuu}]
+ Parameters
+ name: Новосілки (string, optional) - Name of searching settlement
+ region: Київ (string, required) - Province name
+ district: `Києво-Святошинський` (string, optional) - Administrative district of province
+ koatuu: `2625286301` (string, optional) - koatuu classifier id
+ Response 200 (application/json)
+ Attributes (Response_Collection)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (array[`Response_Settlement`])
## Search Regions [/regions]
### List Of Regions By Search Params [GET /regions{?name,koatuu}]
+ Parameters
+ name: Київ (string, optional) - Province name
+ koatuu: `2625286301` (string, optional) - koatuu classifier id
+ Response 200 (application/json)
+ Attributes (Response_Collection)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (array[`Response_Region`])
## Search Districts [/districts]
### List Of Districts By Search Params [GET /districts{?region,name,koatuu}]
+ Parameters
+ region: Київ (string) - Province name
+ name: `Києво-Святошинський` (string, optional) - Administrative district of province
+ koatuu: `2625286301` (string, optional) - koatuu classifier id
+ Response 200 (application/json)
+ Attributes (Response_Collection)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (array[`Response_District`])
### Districts by Region [GET /regions/290f1ee-6c54-4b01-90e6-d701748f0851/districts{?name,koatuu}]
+ Parameters
+ name: `Києво-Святошинський` (string, optional) - Filter by district name
+ koatuu: `2625286301` (string, optional) - koatuu classifier id
+ Response 200 (application/json)
+ Attributes (Response_Collection)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (array[`Response_District_Short`])
### Settlements by district [GET /districts/290f1ee-6c54-4b01-90e6-d701748f0851/settlements{?name,koatuu}]
Get list of cities by district
+ Parameters
+ name: `Київ` (string, optional) - Filter by settlement name
+ koatuu: `2625286301` (string, optional) - koatuu classifier id
+ Response 200 (application/json)
+ Attributes (Response_Collection)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (array[`Response_Settlement_Short`])
## Private API [/]
### Add new street [POST /api/street/]
+ Request (application/json)
+ Attributes (`Create_Street`)
+ Response 200 (application/json)
+ Attributes (Response_OK)
+ meta (Response_Meta)
+ code: 201 (number)
+ data (`Response_Street`)
### Change street name [PUT /api/street/d290f1ee-6c54-4b01-90e6-d701748f0851/change]
Changing street name.
NOTE: Street will be searchable by old name too
+ Request (application/json)
+ Attributes (object)
+ street_name: `Єрмоленка Володимира` (string)
+ Response 200 (application/json)
+ Attributes (Response_OK)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (`Response_Street`)
### Add different street name [PUT /api/street/d290f1ee-6c54-4b01-90e6-d701748f0851/add]
Adding different street name.
Example: In Kiev we have Artema street, but some people search it as Sichovuh Striltciv
NOTE: Street will be searchable by both names
+ Request (application/json)
+ Attributes (object)
+ street_name: `Єрмоленка Володимира` (string)
+ Response 200 (application/json)
+ Attributes (Response_OK)
+ meta (Response_Meta)
+ code: 200 (number)
+ data (`Response_Street`)
### Add new city [POST /api/settlement/]
+ Request (application/json)
+ Attributes (`Create_Settlement`)
+ Response 200 (application/json)
+ Attributes (Response_OK)
+ meta (Response_Meta)
+ code: 201 (number)
+ data (`Response_Settlement`)
# Data Structures
## Responses
### `Response_Collection`
+ meta (Response_Meta, fixed-type)
+ data (array[], fixed-type)
+ paging (Response_Pagination, fixed-type)
### `Response_OK`
+ meta (Response_Meta, fixed-type)
+ data (object, fixed-type)
### `Response_Meta`
+ code: 200 (number) - HTTP response code.
+ url: http://example.com/resource (string) - URL to requested resource.
+ type (enum) - Type of data that is located in `data` attribute.
- object (string) - `data` attribute is a JSON object.
- list (string) - `data` attribute is a list.
+ code: 200 (number) - HTTP response code.
+ `idempotency_key`: `idemp-ssjssdjoa8308u0us0` (string, optional) - [Idempotency key](http://docs.apimanifest.apiary.io/#introduction/optional-features/idempotent-requests). Send it trough `X-Idempotency-Key` header.
+ `request_id`: `req-adasdoijasdojsda` (string) - [Request ID](http://docs.apimanifest.apiary.io/#introduction/interacting-with-api/request-id). Send it with `X-Request-ID` header.
### `Response_Street`
+ id: `d290f1ee-6c54-4b01-90e6-d701748f0851` (string) - Address ID
+ settlement_name: Новосілки (string) - City name
+ street_type: вул (string) - Type of street
+ street_name: `Єрмоленка Володимира` (string) - Street name
### `Response_Settlement_Short`
+ id: `b075f148-7f93-4fc2-b2ec-2d81b19a9b7b` (string) - Settlement ID
+ settlement_name: Новосілки (string) - City name
### `Response_Settlement`
+ id: `b075f148-7f93-4fc2-b2ec-2d81b19a9b7b` (string) - Settlement ID
+ region: Київ (string) - Region name
+ district: `Києво-Святошинський` (string) - District name
+ settlement_name: Новосілки (string) - City name
+ mountain_group: 0 (string) - Mountain group
+ type: `С` (string, optional) - Settlement type
+ koatuu: 3520380802 (string, optional) - KOATUU code
+ parent_settlement: Берегово (string, optional) - Parent settlement name
### `Response_Region`
+ id: `b075f148-7f93-4fc2-b2ec-2d81b19a9b7b` (string) - Region ID
+ region: Київ (string) - Region name
+ koatuu: 3520380802 (string, optional) - KOATUU code
### `Response_District_Short`
+ id: `b075f148-7f93-4fc2-b2ec-2d81b19a9b7b` (string) - District ID
+ district: `Києво-Святошинський` (string) - District name
### `Response_District`
+ id: `b075f148-7f93-4fc2-b2ec-2d81b19a9b7b` (string) - District ID
+ region: Київ (string) - Region name
+ district: `Києво-Святошинський` (string) - District name
+ koatuu: 3520380802 (string, optional) - KOATUU code
### `Create_Settlement`
+ region: Київ (string, required) - Region name
+ district: `Києво-Святошинський` (string, required) - District name
+ settlement_name: Новосілки (string, required) - City name
### `Create_Street`
+ region: Київ (string, required) - Region name
+ district: `Києво-Святошинський` (string, required) - District name
+ settlement_name: Новосілки (string, required) - City name
+ street_type: вул (string, required) - Type of street
+ street_name: `Єрмоленка Володимира` (string, required) - Street name
+ street_number: 67 (string, required) - Number of building
+ postal_code: 02140 (string, required) - Postal code
### `Response_Pagination`
+ limit: 20 (number) - A limit on the number of objects to be returned, between 1 and 100. Default: 50.
+ cursors (object)
+ `starting_after`: 56c31536a60ad644060041af (string) - A cursor for use in pagination. An object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
+ `ending_before`: 56c31536a60ad644060041aa (string) - A cursor for use in pagination. An object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
+ size: 1000 (number) - Total number of objects in collection.
+ has_more: false (boolean) - Is this collection have more data to load in the same style as last request loaded it.