/visits
Получает список визитов на портале или создает новый визит.
Адрес: https://instance_name/api/v1.5/visits/
Методы:
- GET — получает список визитов;
- POST — добавляет новый визит на портал.
Content-type: application/json
- GET
- POST
Параметры тела запроса
limit integer
Количество результатов, которые возвращаются в ответе.
offset integer
Начальный индекс, с которого возвращаются результаты.
Пример запроса
curl –i –X GET
https://test.inspector-cloud.com/api/v1.5/visits/
-H ‘Authorization: Token <<your_token>>’
–F "limit=1" \
–F "offset=0"
Пример ответа
{
"count": 1,
"next": "http://example.com",
"previous": null,
"results": [
{
"id": 2323,
"shop": "1504553224092",
"agent": "agent",
"started_date": "2020-07-27T18:35:46.586695Z",
"task": null,
"latitude": 53.7356226,
"longitude": 91.4279673,
"shop_name": "The one with ondemand task groups",
"shop_area": null,
"gps_shop": {
"id": 5316,
"logo": null,
"route": "939-EAH",
"route_type_description": null,
"customer_id": "1504553224092",
"customer_name": "The one with ondemand task groups",
"region": "South Ashley",
"region_l3": null,
"region_l4": null,
"area": null,
"area_l5": null,
"area_l6": null,
"city": "Garrisonfurt",
"sales_route_id": null,
"latitude": -45.5718055,
"longitude": 110.701806,
"created_at": "2020-06-29T15:24:18.290885Z",
"updated_at": "2021-10-08T08:16:02.513126Z",
"address": "51805 James StreamWilliamsview, NM 65300",
"distr_name": null,
"team_id": null,
"rsm_name": null,
"rsm_code": null,
"tsm_name": null,
"route_type_full": null,
"segment": null,
"pos_code": null,
"matrix_name": null,
"gtm_role_id_description": null,
"id_dealer": null,
"golden_id": null,
"sector": null,
"manager": null,
"inn": null,
"kpp": null,
"sale_channel": null,
"country": "Somalia",
"fss": null,
"fss_code": null,
"sfss": null,
"sfss_code": null,
"em": null,
"em_code": null,
"agency": null,
"agency_region": null,
"kam_food": null,
"kam_food_code": null,
"kam_hpc": null,
"kam_hpc_code": null,
"ctl": null,
"ctl_code": null,
"mte": null,
"mte_code": null,
"nsd": null,
"nsd_code": null,
"visit_plan_id": null,
"driver_id": null,
"sap_code": null,
"sales_group": null,
"visit_type": null,
"hierarchy_l5": null,
"hierarchy_l6": null,
"visit_frequency": null,
"dsd_distr": null,
"store_number": null,
"virtual_flag": null,
"lka_segment": null,
"customer_segment": null,
"y_cust_hier_level_6": null,
"y_cust_hier_level_8": null,
"store_format": null,
"team_route": null,
"route_type_dsd": null,
"route_merch": null,
"service_type": null,
"svm": null,
"tm": null,
"rmm": null,
"kam_ekam": null,
"skam": null,
"days_sequence_code": null,
"weekly_frequency": null,
"bm": null,
"sv": null,
"se": null,
"task_type": null,
"task_subtype": null,
"enabled": true,
"week_days": "1,2,3,4,5,6,7",
"uuid": "5be684a7-7fd8-4256-92cc-b8d50e279a20",
"global_channel": null,
"sync_point": null,
"master_code": null,
"dt": null,
"svme": null,
"me": null,
"description_toloka": null,
"visits_per_month": 1,
"supervisor_code": null,
"ka_dt": null,
"svme_code": null,
"svme_email": null,
"me_code": null,
"json": {
"RAR": 16,
"WAV": 17,
"attr": "Test value"
},
"description": "Stop again across. Arrive across develop address across. Business suffer responsibility choice rich account involve.",
"retail_chain": 5,
"store_type": null,
"group": null,
"agent_routes": []
},
"images": [
{
"12859": "https://test.inspector-cloud.com/media/2020/07/27/b42e4d19-05aa-4485-8141-4bb59775fce8.jpg"
}
],
"current_agent_name": "agent",
"current_agent_route": "staging",
"moderation": null,
"results": {
"id": 25314,
"status": "POSITIVE",
"update_type": "VISIT RESULTS",
"message_type": "TEXT",
"message": " <h2> Количество обработанных кассовых узлов: 5 из 3 </h2> ...",
"created_date": "2020-07-27T18:43:13.624437Z",
"updated_at": "2020-07-27T18:43:13.624482Z",
"message_short": null,
"agent": 864,
"visit": 2323,
"scene": null
},
"helpdesk": null
}
]
}
Параметры ответа
count integer
next string (uri) Nullable
Следующая страница списка.
previous string (uri) Nullable
Предыдущая страница списка.
results Array of objects
Обязательный. Массив объектов с информацией о визитах.
id string
Уникальный идентификатор визита.
shop string
Идентификатор магазина.
agent string
Агент, который выполняет визит.
started_date string (date-time)
Дата и время начала визита (UTC) в формате «ГГГГ-ММ-ДДTЧЧ:ММ:ССZ».
task string
latitude float
Координаты мерчендайзера во время визита. Широта
longitude float
Координаты мерчендайзера во время визита. Долгота
shop_name string
shop_area string
gps_shop Array of objects
Массив с информацией о точке продаж, в которой проходит визит.
id string
Идентификатор магазина.
logo string
route string
route_type_description string
customer_id string
customer_name string
region string
region_l3 string
region_l4 string
area string
area_l5 string
area_l6 string
city string
sales_route_id string
latitude float
longitude float
created_at string
updated_at string
address string
distr_name string
team_id string
rsm_name string
rsm_code string
tsm_name string
route_type_full string
segment string
pos_code string
matrix_name string
gtm_role_id_description string
id_dealer string
golden_id string
sector string
manager string
inn string
kpp string
sale_channel string
country string
fss string
fss_code string
sfss string
sfss_code string
em string
em_code string
agency string
agency_region string
kam_food string
kam_food_code string
kam_hpc string
kam_hpc_code string
ctl string
ctl_code string
mte string
mte_code string
nsd string
nsd_code string
visit_plan_id string
driver_id string
sap_code string
sales_group string
visit_type string
hierarchy_l5 string
hierarchy_l6 string
visit_frequency string
dsd_distr string
store_number string
virtual_flag string
lka_segment string
customer_segment string
y_cust_hier_level_6 string
y_cust_hier_level_8 string
store_format string
team_route string
route_type_dsd string
route_merch string
service_type string
svm string
tm string
rmm string
kam_ekam string
skam string
days_sequence_code string
weekly_frequency string
bm string
sv string
se string
task_type string
task_subtype string
enabled boolean
week_days string
uuid string
global_channel string
sync_point string
master_code string
dt string
svme string
me string
description_toloka string
visits_per_month number
supervisor_code string
ka_dt string
svme_code string
svme_email string
me_code string
json Array of objects
Просмотреть вложенные объекты
RAR number
WAV number
attr string
description string
retail_chain string
store_type string
group string
agent_routes Array of objects
images Array of objects
Фотографии в визите.
current_agent_name string
current_agent_route string
moderation string
results Array of objects
Результаты визита.
id string
status string
update_type string
message_type text
Тип данных, в котором выводится результат.
message text
Информация о результатах визита.
helpdesk string
Параметры тела запроса
id string
Уникальный идентификатор визита.
shop string
Пользовательский идентификатор покупателя, магазин, точка продаж.
agent string
Имя, идентификатор, маршрут агента пользователя.
started_date string (date-time)
Дата и время начала визита (UTC). Чтобы создать визит, дата должна быть указана в формате «ДД.ММ.ГГГГ ЧЧ:ММ.СС».
latitude float
Местоположение мерчендайзера во время визита по широте.
longitude float
Местоположение мерчендайзера во время визита по долготе.
Пример запроса
curl –i –X POST
https://test.inspector-cloud.com/api/v1.5/visits/
-H ‘Authorization: Token <<your_token>>’
-F "id=2323" \
-F "shop=1504553224092" \
-F "agent=alex"
...
Пример ответа
Код ответа: 201