rail-locator-api 1.0.35 → 1.0.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +0 -542
- data/lib/rail-locator-api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f9d6ab8b3ee1262f0c465e5514c9c54250629263ddd9844eb7e86f403e95e3
|
4
|
+
data.tar.gz: b2bc9b609f34bf04c4913772a02f995b07c383f62c4b4de470e89d14893885f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8b81a281da285e95ec1a0e85e6a1f23cb9447428d796b8f8a3e91d4db5eb46da691edc9e1dc336628a551c5b7947225ba992e42f5ba324e03889bf8cef5ca75
|
7
|
+
data.tar.gz: 0fcecbea8647cc12a765999cfef4961df82ac9516b521e1d9af43bf78961374e9f3068ed264a5a758641bf00950de18ea0fe6ceee0826a28f7de23903ff24a91
|
data/README.markdown
CHANGED
@@ -1,542 +0,0 @@
|
|
1
|
-
# RailLocator API
|
2
|
-
|
3
|
-
API wrapper для RailLocator API v2
|
4
|
-
|
5
|
-
# Оглавление
|
6
|
-
0. [Установка](#install)
|
7
|
-
1. [Использование Rails](#using_rails)
|
8
|
-
2. [Использование Ruby](#using_ruby)
|
9
|
-
3. [Debug Logging](#debug_logging)
|
10
|
-
4. [Custom logger](#custom_logger)
|
11
|
-
1. [Треки](#tracks)
|
12
|
-
1. [Получение Списка Треков](#tracks_dislocation_get)
|
13
|
-
2. [Постановка На Слежение](#tracks_dislocation_post)
|
14
|
-
3. [Получение Дислокации По Нескольким Трекам](#tracks_dislocation_batch_get)
|
15
|
-
4. [Получение Информации О Маршруте](#tracks_dislocation_route_info_get)
|
16
|
-
5. [Получение Дислокации По Одному Треку](#tracks_dislocation__track_id__get)
|
17
|
-
2. [Справки](#inquiries)
|
18
|
-
1. [Получение Справок](#tracks_inquiries_get)
|
19
|
-
2. [Постановка На Слежение](#tracks_inquiries_get)
|
20
|
-
3. [Получение Справки](#tracks_inquiries__track_id__get)
|
21
|
-
3. [Подходы](#approaches)
|
22
|
-
1. [Постановка На Слежение](#tracks_approaches_post)
|
23
|
-
4. [Тех. паспорт вагона](#tech_passport)
|
24
|
-
1. [Получение Тех. Паспортов](#tracks_tech_passport_batch_get)
|
25
|
-
2. [Получение Тех. Паспорта](#tracks_tech_passport__track_id__get)
|
26
|
-
5. [Контроль тех. состояния](#tech_condition)
|
27
|
-
1. [Получение Тех. Состояния](#tracks_tech_condition_get)
|
28
|
-
2. [Постановка На Слежение](#tracks_tech_condition_post)
|
29
|
-
6. [Изменение/Снятие треков](#update_delete_tracks)
|
30
|
-
1. [Снятие Со Слежения Нескольких Треков](#tracks_batch_delete)
|
31
|
-
2. [Изменение Информации О Нескольких Треках](#tracks_batch_patch)
|
32
|
-
3. [Снятие Со Слежения Одного Трека](#tracks__track_id__delete)
|
33
|
-
4. [Изменение Информации О Треке](#tracks__track_id__patch)
|
34
|
-
7. [Группы](#groups)
|
35
|
-
1. [Получение Списка Групп](#groups_get)
|
36
|
-
2. [Создание Группы](#groups_post)
|
37
|
-
3. [Удаление Группы](#groups__group_id__delete)
|
38
|
-
4. [Изменение Группы](#groups__group_id__patch)
|
39
|
-
5. [Добавление Вагона В Группу](#groups__group_id__cargo_transport_unit_number_batch_put)
|
40
|
-
6. [Удаление Вагонов Из Группы](#groups__group_id__cargo_transport_unit_number_batch_delete)
|
41
|
-
7. [Добавление Вагона В Группу](#groups__group_id__cargo_transport_unit_number__cargo_transport_unit_number__put)
|
42
|
-
8. [Удаление Вагона Из Группы](#groups__group_id__cargo_transport_unit_number__cargo_transport_unit_number__delete)
|
43
|
-
8. [Справочники](#references)
|
44
|
-
1. [Получение Координат Станции](#references_station_get)
|
45
|
-
2. [Получение Списка Станций С Краткой Информацией](#references_stations_get)
|
46
|
-
9. [Рассылки](#emailings)
|
47
|
-
1. [Создание Рассылки](#emailings_post)
|
48
|
-
|
49
|
-
# <a name="install"></a> Установка
|
50
|
-
|
51
|
-
Для авторизации по api key необходимо получить его [в личном кабинете локатора](https://rail-scan.com/app/api-keys)
|
52
|
-
или в телеграм боте [@RailLocatorApiBot](https://t.me/RailLocatorApiBot)
|
53
|
-
|
54
|
-
либо использовать другие методы авторизации:
|
55
|
-
|
56
|
-
`:keycloak, :api_key, :base64`
|
57
|
-
|
58
|
-
## Ruby
|
59
|
-
$ gem install rail-locator-api
|
60
|
-
## Rails
|
61
|
-
добавьте в Gemfile:
|
62
|
-
|
63
|
-
gem 'rail-locator-api'
|
64
|
-
|
65
|
-
и запустите `bundle install`.
|
66
|
-
|
67
|
-
Затем:
|
68
|
-
|
69
|
-
rails g rail_locator_api:install
|
70
|
-
|
71
|
-
## <a name="using_rails"></a> Использование Rails
|
72
|
-
|
73
|
-
В файл `config/rail_locator_api.yml` вставьте ваши данные
|
74
|
-
|
75
|
-
## <a name="using_ruby"></a> Использование Ruby
|
76
|
-
|
77
|
-
Сначала создайте экземпляр объекта `RailLocatorApi::Request`:
|
78
|
-
|
79
|
-
```ruby
|
80
|
-
locator = RailLocatorApi::Request.new(api_key: "***")
|
81
|
-
# или
|
82
|
-
locator = RailLocatorApi::Request.new(api_auth_method: :base64, api_user_email: "email@ctm.ru", api_user_password: "12345678")
|
83
|
-
```
|
84
|
-
|
85
|
-
Вы можете изменять `api_auth_method`, `api_key`, `api_user_email`, `api_user_password`, `timeout`, `open_timeout`, `faraday_adapter`, `proxy`, `symbolize_keys`, `logger`, и `debug`:
|
86
|
-
|
87
|
-
```ruby
|
88
|
-
RailLocatorApi::Request.timeout = 15
|
89
|
-
RailLocatorApi::Request.open_timeout = 15
|
90
|
-
RailLocatorApi::Request.symbolize_keys = true
|
91
|
-
RailLocatorApi::Request.debug = false
|
92
|
-
|
93
|
-
RailLocatorApi::Request.api_key = "your_api_key"
|
94
|
-
# или
|
95
|
-
RailLocatorApi::Request.api_auth_method = :base64
|
96
|
-
RailLocatorApi::Request.api_user_email = "email@ctm.ru"
|
97
|
-
RailLocatorApi::Request.api_user_password = "12345678"
|
98
|
-
```
|
99
|
-
|
100
|
-
Либо в файле `config/initializers/rail_locator_api.rb` для Rails.
|
101
|
-
|
102
|
-
## <a name="debug_logging"></a> Debug Logging
|
103
|
-
|
104
|
-
Измените `debug: true` чтобы включить логирование в STDOUT.
|
105
|
-
|
106
|
-
```ruby
|
107
|
-
locator = RailLocatorApi::Request.new(api_key: "***", debug: true)
|
108
|
-
```
|
109
|
-
|
110
|
-
### <a name="custom_logger"></a> Custom logger
|
111
|
-
|
112
|
-
`Logger.new` используется по умолчанию, но вы можете изменить на свой:
|
113
|
-
|
114
|
-
```ruby
|
115
|
-
locator = RailLocatorApi::Request.new(api_key: "***", debug: true, logger: MyLogger.new)
|
116
|
-
```
|
117
|
-
|
118
|
-
Или:
|
119
|
-
|
120
|
-
```ruby
|
121
|
-
RailLocatorApi::Request.logger = MyLogger.new
|
122
|
-
```
|
123
|
-
|
124
|
-
# <a name="examples"></a> Примеры
|
125
|
-
## <a name="tracks"></a> Дислокация
|
126
|
-
### <a name="tracks_dislocation_get"></a> [Получение Списка Треков](https://rail-scan.com/api/v2.0/redoc#tag/Dislokaciya/operation/________________________tracks_dislocation_get)
|
127
|
-
```ruby
|
128
|
-
request = {
|
129
|
-
"limit": 100,
|
130
|
-
"offset": 0,
|
131
|
-
"filters": [
|
132
|
-
{
|
133
|
-
"field": "is_broken",
|
134
|
-
"operand": "in",
|
135
|
-
"value": [
|
136
|
-
null,
|
137
|
-
true
|
138
|
-
]
|
139
|
-
},
|
140
|
-
{
|
141
|
-
"field": "track_create_time",
|
142
|
-
"operand": ">=",
|
143
|
-
"value": "2010-10-10 00:00"
|
144
|
-
},
|
145
|
-
{
|
146
|
-
"field": "track_stop_time",
|
147
|
-
"operand": "between",
|
148
|
-
"value": [
|
149
|
-
"2010-10-10 00:00",
|
150
|
-
"2021-10-10 00:00"
|
151
|
-
]
|
152
|
-
}
|
153
|
-
],
|
154
|
-
"sort": [
|
155
|
-
{
|
156
|
-
"field": "is_active",
|
157
|
-
"order": "asc"
|
158
|
-
}
|
159
|
-
],
|
160
|
-
"fulltext_filter": {
|
161
|
-
"value": "2010",
|
162
|
-
"fields": [
|
163
|
-
"track_create_time",
|
164
|
-
"track_stop_time"
|
165
|
-
],
|
166
|
-
"operation": "include"
|
167
|
-
}
|
168
|
-
}
|
169
|
-
response = RailLocatorApi::Request.tracks.dislocation.retrieve(body: request)
|
170
|
-
p response.body
|
171
|
-
```
|
172
|
-
|
173
|
-
### <a name="tracks_dislocation_post"></a> [Постановка На Слежение](https://rail-scan.com/api/v2.0/redoc#tag/Dislokaciya/operation/_______________________tracks_dislocation_post)
|
174
|
-
|
175
|
-
```ruby
|
176
|
-
request = [
|
177
|
-
{
|
178
|
-
"is_validate_vehicle": true,
|
179
|
-
"cargo_transport_unit_number": "ASVD123",
|
180
|
-
"country_code": "01",
|
181
|
-
"tracking_type": 1,
|
182
|
-
"is_cross_country_tracking": true
|
183
|
-
}
|
184
|
-
]
|
185
|
-
response = RailLocatorApi::Request.tracks.dislocation.create(body: request)
|
186
|
-
p response.body
|
187
|
-
```
|
188
|
-
|
189
|
-
### <a name="tracks_dislocation_batch_get"></a> [Получение Дислокации По Нескольким Трекам](https://rail-scan.com/api/v2.0/redoc#tag/Dislokaciya/operation/__________________________________________tracks_dislocation_batch_get)
|
190
|
-
|
191
|
-
```ruby
|
192
|
-
request = {
|
193
|
-
"track_ids": [
|
194
|
-
0
|
195
|
-
],
|
196
|
-
"operations_count": 10
|
197
|
-
}
|
198
|
-
response = RailLocatorApi::Request.tracks.dislocation.history.retrieve(body: request)
|
199
|
-
p response.body
|
200
|
-
```
|
201
|
-
|
202
|
-
### <a name="tracks_dislocation_route_info_get"></a> [Получение Информации О Маршруте](https://rail-scan.com/api/v2.0/redoc#tag/Dislokaciya/operation/________________________________tracks_dislocation_route_info_get)
|
203
|
-
|
204
|
-
```ruby
|
205
|
-
track_id = 1
|
206
|
-
response = RailLocatorApi::Request.tracks.dislocation(track_id).route.retrieve
|
207
|
-
p response.body
|
208
|
-
```
|
209
|
-
|
210
|
-
### <a name="tracks_dislocation__track_id__get"></a> [Получение Дислокации По Одному Треку](https://rail-scan.com/api/v2.0/redoc#tag/Dislokaciya/operation/_____________________________________tracks_dislocation__track_id__get)
|
211
|
-
|
212
|
-
```ruby
|
213
|
-
track_id = 1
|
214
|
-
response = RailLocatorApi::Request.tracks.dislocation(track_id).history.retrieve
|
215
|
-
p response.body
|
216
|
-
```
|
217
|
-
|
218
|
-
## <a name="inquiries"></a> Справки
|
219
|
-
|
220
|
-
### <a name="tracks_inquiries_get"></a> [Получение Справок](https://rail-scan.com/api/v2.0/redoc#tag/Spravki/operation/__________________tracks_inquiries_get)
|
221
|
-
```ruby
|
222
|
-
request = {
|
223
|
-
"limit": 100,
|
224
|
-
"offset": 0,
|
225
|
-
"filters": [
|
226
|
-
{
|
227
|
-
"field": "is_broken",
|
228
|
-
"operand": "in",
|
229
|
-
"value": [
|
230
|
-
null,
|
231
|
-
true
|
232
|
-
]
|
233
|
-
},
|
234
|
-
{
|
235
|
-
"field": "track_start",
|
236
|
-
"operand": ">=",
|
237
|
-
"value": "2010-10-10 00:00"
|
238
|
-
},
|
239
|
-
{
|
240
|
-
"field": "track_stop",
|
241
|
-
"operand": "between",
|
242
|
-
"value": [
|
243
|
-
"2010-10-10 00:00",
|
244
|
-
"2021-10-10 00:00"
|
245
|
-
]
|
246
|
-
}
|
247
|
-
],
|
248
|
-
"sort": [
|
249
|
-
{
|
250
|
-
"field": "is_active",
|
251
|
-
"order": "asc"
|
252
|
-
}
|
253
|
-
],
|
254
|
-
"fulltext_filter": {
|
255
|
-
"value": "2010",
|
256
|
-
"fields": [
|
257
|
-
"track_start",
|
258
|
-
"track_stop"
|
259
|
-
],
|
260
|
-
"operation": "include"
|
261
|
-
}
|
262
|
-
}
|
263
|
-
response = RailLocatorApi::Request.tracks.inquiries.retrieve(body: request)
|
264
|
-
p response.body
|
265
|
-
```
|
266
|
-
|
267
|
-
### <a name="tracks_inquiries_post"></a> [Постановка На Слежение](https://rail-scan.com/api/v2.0/redoc#tag/Spravki/operation/_______________________tracks_inquiries_post)
|
268
|
-
```ruby
|
269
|
-
request = [
|
270
|
-
{
|
271
|
-
"inquiry_type": "2612",
|
272
|
-
"cargo_transport_unit_number": "12345678"
|
273
|
-
}
|
274
|
-
]
|
275
|
-
response = RailLocatorApi::Request.tracks.inquiries.create(body: request)
|
276
|
-
p response.body
|
277
|
-
```
|
278
|
-
|
279
|
-
### <a name="tracks_inquiries__track_id__get"></a> [Получение Справки](https://rail-scan.com/api/v2.0/redoc#tag/Spravki/operation/__________________tracks_inquiries__track_id__get)
|
280
|
-
```ruby
|
281
|
-
track_id = 1
|
282
|
-
response = RailLocatorApi::Request.tracks.inquiries(track_id).retrieve
|
283
|
-
p response.body
|
284
|
-
```
|
285
|
-
|
286
|
-
## <a name="approaches"></a> Подходы
|
287
|
-
### <a name="tracks_approaches_post"></a> [Постановка На Слежение](https://rail-scan.com/api/v2.0/redoc#tag/Podhody/operation/_______________________tracks_approaches_post)
|
288
|
-
```ruby
|
289
|
-
request = [
|
290
|
-
{
|
291
|
-
"cargo_transport_unit_type": 0,
|
292
|
-
"stop_tracking_condition": 0,
|
293
|
-
"cargo_transport_unit_load_state": 0,
|
294
|
-
"cargo_code": "string",
|
295
|
-
"tracking_type": 0,
|
296
|
-
"destination_station": "string",
|
297
|
-
"which_okpo_to_use": 0,
|
298
|
-
"cargo_sender_okpo": "string",
|
299
|
-
"cargo_receiver_okpo": "string"
|
300
|
-
}
|
301
|
-
]
|
302
|
-
response = RailLocatorApi::Request.tracks.approaches.create(body: request)
|
303
|
-
p response.body
|
304
|
-
```
|
305
|
-
|
306
|
-
## <a name="tech_passport"></a> Тех. паспорт вагона
|
307
|
-
### <a name="tracks_tech_passport_batch_get"></a> [Получение Тех. Паспортов](https://rail-scan.com/api/v2.0/redoc#tag/Teh.-pasport-vagona/operation/_________________________tracks_tech_passport_batch_get)
|
308
|
-
```ruby
|
309
|
-
request = {
|
310
|
-
"track_ids": [
|
311
|
-
0
|
312
|
-
],
|
313
|
-
"count": 1
|
314
|
-
}
|
315
|
-
response = RailLocatorApi::Request.tracks.dislocation.tech_passports.retrieve(body: request)
|
316
|
-
p response.body
|
317
|
-
```
|
318
|
-
### <a name="tracks_tech_passport__track_id__get"></a> [Получение Тех. Паспорта](https://rail-scan.com/api/v2.0/redoc#tag/Teh.-pasport-vagona/operation/_________________________tracks_tech_passport__track_id__get)
|
319
|
-
```ruby
|
320
|
-
track_id = 1
|
321
|
-
response = RailLocatorApi::Request.tracks.dislocation(track_id).tech_passports.retrieve
|
322
|
-
p response.body
|
323
|
-
```
|
324
|
-
|
325
|
-
## <a name="tech_condition"></a> Контроль тех. состояния
|
326
|
-
### <a name="tracks_tech_condition_get"></a> [Получение Тех. Состояния](https://rail-scan.com/api/v2.0/redoc#tag/Kontrol-teh.-sostoyaniya/operation/_________________________tracks_tech_condition_get)
|
327
|
-
```ruby
|
328
|
-
request = {
|
329
|
-
"limit": 100,
|
330
|
-
"offset": 0,
|
331
|
-
"filters": [
|
332
|
-
{
|
333
|
-
"field": "is_broken",
|
334
|
-
"operand": "in",
|
335
|
-
"value": [
|
336
|
-
null,
|
337
|
-
true
|
338
|
-
]
|
339
|
-
},
|
340
|
-
{
|
341
|
-
"field": "track_start",
|
342
|
-
"operand": ">=",
|
343
|
-
"value": "2010-10-10 00:00"
|
344
|
-
},
|
345
|
-
{
|
346
|
-
"field": "track_stop",
|
347
|
-
"operand": "between",
|
348
|
-
"value": [
|
349
|
-
"2010-10-10 00:00",
|
350
|
-
"2021-10-10 00:00"
|
351
|
-
]
|
352
|
-
}
|
353
|
-
],
|
354
|
-
"sort": [
|
355
|
-
{
|
356
|
-
"field": "active",
|
357
|
-
"order": "asc"
|
358
|
-
}
|
359
|
-
],
|
360
|
-
"fulltext_filter": {
|
361
|
-
"value": "2010",
|
362
|
-
"fields": [
|
363
|
-
"track_start",
|
364
|
-
"track_stop"
|
365
|
-
],
|
366
|
-
"operation": "include"
|
367
|
-
}
|
368
|
-
}
|
369
|
-
response = RailLocatorApi::Request.tracks.tech_condition.retrieve(body: request)
|
370
|
-
p response.body
|
371
|
-
```
|
372
|
-
|
373
|
-
### <a name="tracks_tech_condition_post"></a> [Постановка На Слежение](https://rail-scan.com/api/v2.0/redoc#tag/Kontrol-teh.-sostoyaniya/operation/_______________________tracks_tech_condition_post)
|
374
|
-
|
375
|
-
```ruby
|
376
|
-
request = [
|
377
|
-
{
|
378
|
-
"cargo_transport_unit_number": "12345678"
|
379
|
-
}
|
380
|
-
]
|
381
|
-
response = RailLocatorApi::Request.tracks.tech_condition.create(body: request)
|
382
|
-
p response.body
|
383
|
-
```
|
384
|
-
|
385
|
-
## <a name="update_delete_tracks"></a> Изменение/Снятие треков
|
386
|
-
### <a name="tracks_batch_delete"></a> [Снятие Со Слежения Нескольких Треков](https://rail-scan.com/api/v2.0/redoc#tag/IzmenenieSnyatie-trekov/operation/_____________________________________tracks_batch_delete)
|
387
|
-
```ruby
|
388
|
-
request = {
|
389
|
-
"track_ids": [
|
390
|
-
123,
|
391
|
-
1234
|
392
|
-
]
|
393
|
-
}
|
394
|
-
response = RailLocatorApi::Request.tracks.batch.delete(body: request)
|
395
|
-
p response.body
|
396
|
-
```
|
397
|
-
|
398
|
-
### <a name="tracks_batch_patch"></a> [Изменение Информации О Нескольких Треках](https://rail-scan.com/api/v2.0/redoc#tag/IzmenenieSnyatie-trekov/operation/_________________________________________tracks_batch_patch)
|
399
|
-
```ruby
|
400
|
-
request = [
|
401
|
-
{
|
402
|
-
"track_id": 123456,
|
403
|
-
"comment": "Примечание трека"
|
404
|
-
}
|
405
|
-
]
|
406
|
-
response = RailLocatorApi::Request.tracks.batch.update(body: request)
|
407
|
-
p response.body
|
408
|
-
```
|
409
|
-
|
410
|
-
### <a name="tracks__track_id__delete"></a> [Снятие Со Слежения Одного Трека](https://rail-scan.com/api/v2.0/redoc#tag/IzmenenieSnyatie-trekov/operation/________________________________tracks__track_id__delete)
|
411
|
-
```ruby
|
412
|
-
track_id = 1
|
413
|
-
response = RailLocatorApi::Request.tracks(track_id).delete
|
414
|
-
p response.body
|
415
|
-
```
|
416
|
-
|
417
|
-
### <a name="tracks__track_id__patch"></a> [Изменение Информации О Треке](https://rail-scan.com/api/v2.0/redoc#tag/IzmenenieSnyatie-trekov/operation/_____________________________tracks__track_id__patch)
|
418
|
-
```ruby
|
419
|
-
track_id = 1
|
420
|
-
request = {
|
421
|
-
"comment": "Примечание трека"
|
422
|
-
}
|
423
|
-
response = RailLocatorApi::Request.tracks(track_id).update(body: request)
|
424
|
-
p response.body
|
425
|
-
```
|
426
|
-
|
427
|
-
## <a name="groups"></a> Группы
|
428
|
-
### <a name="groups_get"></a> [Получение Списка Групп](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/_______________________groups_get)
|
429
|
-
```ruby
|
430
|
-
response = RailLocatorApi::Request.groups.retrieve
|
431
|
-
p response.body
|
432
|
-
```
|
433
|
-
### <a name="groups_post"></a> [Создание Группы](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/________________groups_post)
|
434
|
-
```ruby
|
435
|
-
request = {
|
436
|
-
"group_name": "Название новой группы"
|
437
|
-
}
|
438
|
-
response = RailLocatorApi::Request.groups.create(body: request)
|
439
|
-
p response.body
|
440
|
-
```
|
441
|
-
### <a name="groups__group_id__delete"></a> [Удаление Группы](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/________________groups__group_id__delete)
|
442
|
-
```ruby
|
443
|
-
group_id = 1
|
444
|
-
response = RailLocatorApi::Request.groups(group_id).delete
|
445
|
-
p response.body
|
446
|
-
```
|
447
|
-
### <a name="groups__group_id__patch"></a> [Изменение Группы](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/_________________groups__group_id__patch)
|
448
|
-
```ruby
|
449
|
-
group_id = 1
|
450
|
-
request = {
|
451
|
-
"group_name": "Переименованная группа"
|
452
|
-
}
|
453
|
-
response = RailLocatorApi::Request.groups(group_id).update(body: request)
|
454
|
-
p response.body
|
455
|
-
```
|
456
|
-
### <a name="groups__group_id__cargo_transport_unit_number_batch_put"></a> [Добавление Вагона В Группу](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/___________________________groups__group_id__cargo_transport_unit_number_batch_put)
|
457
|
-
```ruby
|
458
|
-
group_id = 1
|
459
|
-
request = {
|
460
|
-
"cargo_transport_unit_numbers": [
|
461
|
-
"ASD1234",
|
462
|
-
"F0123454D"
|
463
|
-
]
|
464
|
-
}
|
465
|
-
response = RailLocatorApi::Request.groups(group_id).cargo_transport_unit_number.batch.update(body: request)
|
466
|
-
p response.body
|
467
|
-
```
|
468
|
-
### <a name="groups__group_id__cargo_transport_unit_number_batch_delete"></a> [Удаление Вагонов Из Группы](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/___________________________groups__group_id__cargo_transport_unit_number_batch_delete)
|
469
|
-
```ruby
|
470
|
-
group_id = 1
|
471
|
-
request = {
|
472
|
-
"cargo_transport_unit_numbers": [
|
473
|
-
"ASD1234",
|
474
|
-
"F0123454D"
|
475
|
-
]
|
476
|
-
}
|
477
|
-
response = RailLocatorApi::Request.groups(group_id).cargo_transport_unit_number.batch.delete(body: request)
|
478
|
-
p response.body
|
479
|
-
```
|
480
|
-
### <a name="groups__group_id__cargo_transport_unit_number__cargo_transport_unit_number__put"></a> [Добавление Вагона В Группу](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/___________________________groups__group_id__cargo_transport_unit_number__cargo_transport_unit_number__put)
|
481
|
-
```ruby
|
482
|
-
group_id = 1
|
483
|
-
cargo_transport_unit_number = "11111"
|
484
|
-
response = RailLocatorApi::Request.groups(group_id).cargo_transport_unit_number(cargo_transport_unit_number).update
|
485
|
-
p response.body
|
486
|
-
```
|
487
|
-
### <a name="groups__group_id__cargo_transport_unit_number__cargo_transport_unit_number__delete"></a> [Удаление Вагона Из Группы](https://rail-scan.com/api/v2.0/redoc#tag/Gruppy/operation/__________________________groups__group_id__cargo_transport_unit_number__cargo_transport_unit_number__delete)
|
488
|
-
```ruby
|
489
|
-
group_id = 1
|
490
|
-
cargo_transport_unit_number = "11111"
|
491
|
-
response = RailLocatorApi::Request.groups(group_id).cargo_transport_unit_number(cargo_transport_unit_number).delete
|
492
|
-
p response.body
|
493
|
-
```
|
494
|
-
|
495
|
-
## <a name="references"></a> Справочники
|
496
|
-
### <a name="references_station_get"></a> [Получение Координат Станции](https://rail-scan.com/api/v2.0/redoc#tag/Spravochniki/operation/____________________________references_station_get)
|
497
|
-
```ruby
|
498
|
-
response = RailLocatorApi::Request.references.station.retrieve(params: {disloc_id: 1})
|
499
|
-
p response.body
|
500
|
-
```
|
501
|
-
|
502
|
-
### <a name="references_stations_get"></a> [Получение Списка Станций С Краткой Информацией](https://rail-scan.com/api/v2.0/redoc#tag/Spravochniki/operation/_______________________________________________references_stations_get)
|
503
|
-
```ruby
|
504
|
-
response = RailLocatorApi::Request.references.stations.retrieve(params: {station_code: "111"})
|
505
|
-
p response.body
|
506
|
-
```
|
507
|
-
## <a name="emailings"></a> Рассылки
|
508
|
-
### <a name="emailings_post"></a> [Создание Рассылки](https://rail-scan.com/api/v2.0/redoc#tag/Rassylki/operation/__________________emailings_post)
|
509
|
-
|
510
|
-
```ruby
|
511
|
-
request = {
|
512
|
-
"title": "Название рассылки",
|
513
|
-
"data_source": "groups",
|
514
|
-
"data_ids": [
|
515
|
-
"1234",
|
516
|
-
"12345"
|
517
|
-
],
|
518
|
-
"recipients": [
|
519
|
-
"example@mail.ru"
|
520
|
-
],
|
521
|
-
"sending_days": [
|
522
|
-
"Sun",
|
523
|
-
"Mon",
|
524
|
-
"Tue",
|
525
|
-
"Wed",
|
526
|
-
"Thu",
|
527
|
-
"Fri",
|
528
|
-
"Sat"
|
529
|
-
],
|
530
|
-
"sending_times": [
|
531
|
-
"08:00:00",
|
532
|
-
"17:00:00"
|
533
|
-
],
|
534
|
-
"template_title": "Тема письма",
|
535
|
-
"template_content": "Текст письма",
|
536
|
-
"active_objects": true,
|
537
|
-
"language": "ru",
|
538
|
-
"user_note": "Примечание"
|
539
|
-
}
|
540
|
-
response = RailLocatorApi::Request.emailings.create(body: request)
|
541
|
-
p response.body
|
542
|
-
```
|