dapp

Base URI

http://dapp.astwellsoft.com/{version}
API Methods
Бренды
GET /v1/brands/{id}
POST /v1/brands/closest
Список всех брендов
GET /v1/brands

Request parameters

page
number optional

Страница вывода

Example:
1
category
number optional

ID категории

Example:
1
fields
string optional

Выводить только указанные поля

Example:
name,barcode
expand
string optional

Вывести вместе со связанной информацией Возможны варианты: coupons divisions category

Example:
coupons,divisions,category
sort
string optional

Сортировать по значению Для обратной сортировки поставить - перед значением

Example:
category_id

Responses

200 OK
Headers
X-Pagination-Total-Count
unknown optional

Всего найденно элементов

Example:
2500
X-Pagination-Page-Count
string optional

Кол-во страниц в постраничной навигации

Example:
12
X-Pagination-Current-Page
string optional

Текущая страница

Example:
2
X-Pagination-Per-Page
string optional

Кол-во элементов на странице

Example:
20
Body
Object
id
number
Example:
1
category_id
number
Example:
4
name
string
Example:
test Brands
description
string
Example:
<p>Nullam nec sodales ligula. <strong>Nunc</strong> id <em>fermentum</em> leo. Maecenas et nibh ac lorem accumsan iaculis. In sit amet augue a elit laoreet imperdiet et vitae eros. Phasellus leo lorem, tristique id risus blandit, laoreet gravida mi. Donec varius scelerisque pharetra. Duis ut mauris mattis eros vulputate rutrum. Nulla facilisis metus at blandit vulputate. Sed nunc dolor, laoreet ut ipsum in, rutrum gravida nunc. Duis malesuada urna vel porttitor faucibus.</p>
discount
number
Example:
12
image_name
string
Example:
5447af6643fc4.png
barcode
string
Example:
312312312312312312
code_type
string
Example:
QR
Бренд
GET /v1/brands/{id}

Path variables

id
number required

ID бренда

Example:
1

Request parameters

expand
string optional

Вывести вместе со связанной информацией Возможны варианты: coupons divisions category

Example:
coupons,divisions,category
fields
string optional

Выводить только указанные поля

Example:
name,barcode

Responses

200 OK
Body
Object
id
number
Example:
1
category_id
number
Example:
4
name
string
Example:
test Brands
description
string
Example:
<p>Nullam nec sodales ligula. <strong>Nunc</strong> id <em>fermentum</em> leo. Maecenas et nibh ac lorem accumsan iaculis. In sit amet augue a elit laoreet imperdiet et vitae eros. Phasellus leo lorem, tristique id risus blandit, laoreet gravida mi. Donec varius scelerisque pharetra. Duis ut mauris mattis eros vulputate rutrum. Nulla facilisis metus at blandit vulputate. Sed nunc dolor, laoreet ut ipsum in, rutrum gravida nunc. Duis malesuada urna vel porttitor faucibus.</p>
discount
number
Example:
12
image_name
string
Example:
5447af6643fc4.png
barcode
string
Example:
312312312312312312
code_type
string
Example:
QR
404 Not Found
Ближайшие бренды
POST /v1/brands/closest

Request parameters

lat
number required

Широта

Example:
49.8403
lon
number required

Долгота

Example:
24.0114
radius
number required

Радиус

Example:
0.5

Responses

200 OK
Headers
X-Pagination-Total-Count
string optional

Всего найденно элементов

Example:
2500
X-Pagination-Page-Count
string optional

Кол-во страниц в постраничной навигации

Example:
12
X-Pagination-Current-Page
string optional

Текущая страница

Example:
2
X-Pagination-Per-Page
string optional

Кол-во элементов на странице

Example:
20
Body
Object
id
number
Example:
1
category_id
number
Example:
4
name
string
Example:
test Brands
description
string
Example:
<p>Nullam nec sodales ligula. <strong>Nunc</strong> id <em>fermentum</em> leo. Maecenas et nibh ac lorem accumsan iaculis. In sit amet augue a elit laoreet imperdiet et vitae eros. Phasellus leo lorem, tristique id risus blandit, laoreet gravida mi. Donec varius scelerisque pharetra. Duis ut mauris mattis eros vulputate rutrum. Nulla facilisis metus at blandit vulputate. Sed nunc dolor, laoreet ut ipsum in, rutrum gravida nunc. Duis malesuada urna vel porttitor faucibus.</p>
discount
number
Example:
12
image_name
string
Example:
5447af6643fc4.png
barcode
string
Example:
312312312312312312
code_type
string
Example:
QR
400 Bad Request
Купоны
GET /v1/coupons
GET /v1/coupons/{id}
POST /v1/coupons/closest
Все купоны
GET /v1/coupons

Request parameters

page
number optional

Страница вывода

Example:
1
brand
number optional

Бренд

Example:
1
fields
string optional

Выводить только указанные поля

Example:
name,description
expand
string optional

Вывести вместе со связанной информацией Возможны варианты: brand

Example:
brand
sort
string optional

Сортировать по значению Для обратной сортировки поставить - перед значением

Example:
brand_id

Responses

200 OK
Headers
X-Pagination-Total-Count
string optional

Всего найденно элементов

Example:
25500
X-Pagination-Page-Count
string optional

Кол-во страниц в постраничной навигации

Example:
12
X-Pagination-Current-Page
string optional

Текущая страница

Example:
2
X-Pagination-Per-Page
string optional

Кол-во элементов на странице

Example:
20
Body
Object
id
number
Example:
1
brand_id
number
Example:
1
name
string
Example:
trest Coupon
description
string
Example:
<p>Description Description<strong> </strong>Description Description Description</p>
key
string
Example:
<p>Key Key Key Key Key Key Key</p>
image_name
string
Example:
active_from
number
Example:
1414011600
active_to
number
Example:
1414533600
is_active
boolean
Example:
true
Купон
GET /v1/coupons/{id}

Path variables

id
string required

Request parameters

expand
string optional

Вывести вместе со связанной информацией Возможны варианты: brand

Example:
brand
fields
string optional

Выводить только указанные поля

Example:
name,description

Responses

200 OK
Body
Object
id
number
Example:
1
brand_id
number
Example:
1
name
string
Example:
trest Coupon
description
string
Example:
<p>Description Description<strong> </strong>Description Description Description</p>
key
string
Example:
<p>Key Key Key Key Key Key Key</p>
image_name
string
Example:
active_from
number
Example:
1414011600
active_to
number
Example:
1414533600
is_active
boolean
Example:
true
404 Not Found
Ближайшие купоны
POST /v1/coupons/closest

Request parameters

lat
string optional

Широта

Example:
49.8403
lon
string optional

Долгота

radius
string optional

Радиус

Responses

200 OK
Headers
X-Pagination-Total-Count
string optional

Всего найденно элементов

Example:
31231
X-Pagination-Page-Count
string optional

Кол-во страниц в постраничной навигации

Example:
123
X-Pagination-Current-Page
string optional

Текущая страница

Example:
122
X-Pagination-Per-Page
string optional

Кол-во элементов на странице

Example:
20
Body
Object
id
number
Example:
1
brand_id
number
Example:
1
name
string
Example:
trest Coupon
description
string
Example:
<p>Это заголовок первого уровня<br>Это заголовок второго уровня<br>Это заголовок третьего уровня<br>Это заголовок четвертого уровня<br>Это заголовок пятого уровня<br>Это заголовок шестого уровня<br>Это просто текст Источник: http://www.site-do.ru/html/html3.php© site-do.ru</p>
discount
string
Example:
3qeadas dsa
barcode
string
Example:
1234567890123
code_type
string
Example:
EAN13
image_name
string
Example:
545a61ad0b963.png
active_from
number
Example:
1415138400
active_to
number
Example:
1416952800
image
string
Example:
http://dapp.astwellsoft.com/images/coupons/545a61ad0b963.png
is_active
boolean
Example:
true
400 Bad Request
Сообщения
Список всех сообщений
GET /v1/messages

Request parameters

page
string optional

Страница вывода

Example:
2
brand
string optional

Бренд

Example:
24
fields
string optional

Выводить только указанные поля

Example:
name,description
expand
string optional

Вывести вместе со связанной информацией Возможны варианты: brand

Example:
brand
sort
string optional

Сортировать по значению Для обратной сортировки поставить - перед значением

Example:
brand_id

Responses

200 OK
Headers
X-Pagination-Total-Count
string optional

Всего найденно элементов

Example:
2500
X-Pagination-Page-Count
string optional

Кол-во страниц в постраничной навигации

Example:
12
X-Pagination-Current-Page
string optional

Текущая страница

Example:
2
X-Pagination-Per-Page
string optional

Кол-во элементов на странице

Example:
20
Body
Object
id
number
Example:
3
brand_id
number
Example:
1
name
string
Example:
name push
description
string
Example:
2 bdsf sdfdsfsdfsfsdfds
image_name
string
Example:
54598697bdf79.png
image
string
Example:
http://dapp.astwellsoft.com/images/messages/54598697bdf79.png
Сообщение
GET /v1/messages/{id}

Path variables

id
string required

Request parameters

expand
string optional

Вывести вместе со связанной информацией Возможны варианты: brand

Example:
brand
fields
string optional

Выводить только указанные поля

Example:
name,description

Responses

200 OK
Body
Object
id
number
Example:
3
brand_id
number
Example:
1
name
string
Example:
name push
description
string
Example:
2 bdsf sdfdsfsdfsfsdfds
image_name
string
Example:
54598697bdf79.png
image
string
Example:
http://dapp.astwellsoft.com/images/messages/54598697bdf79.png
404 Not Found

{“name”:“Not Found”,“message”:“Object not found: 145464”,“code”:0,“status”:404,“type”:“yii\web\NotFoundHttpException”}

Ближайшие Сообщения
POST /v1/messages/closest

Request parameters

lat
string optional

Широта

Example:
49.8403
lon
string optional

Долгота

Example:
24.0114
radius
string optional

Радиус

Example:
0.5

Responses

200 OK
Headers
X-Pagination-Total-Count
string optional

Всего найденно элементов

Example:
1234
X-Pagination-Page-Count
string optional

Кол-во страниц в постраничной навигации

Example:
56
X-Pagination-Current-Page
string optional

Текущая страница

Example:
2
X-Pagination-Per-Page
string optional

Кол-во элементов на странице

Example:
20
Body
Object
id
number
Example:
3
brand_id
number
Example:
1
name
string
Example:
name push
description
string
Example:
2 bdsf sdfdsfsdfsfsdfds
image_name
string
Example:
54598697bdf79.png
image
string
Example:
http://dapp.astwellsoft.com/images/messages/54598697bdf79.png
Сообщения для указанного устройства
POST /v1/messages/device

Request parameters

token
string optional

Токен устройства

Example:
491a398fdda42e0d50b07a56da73920c6b18a271949f1d512151ffde7a5adaff

Responses

200 OK
Body
Object
id
number
Example:
3
brand_id
number
Example:
1
name
string
Example:
name push
description
string
Example:
2 bdsf sdfdsfsdfsfsdfds
image_name
string
Example:
54598697bdf79.png
image
string
Example:
http://dapp.astwellsoft.com/images/messages/54598697bdf79.png
Разное
Управление устройством
POST /v1/device/register

Регистрация/обновление координат устройства

Request parameters

os_type
string required

Тип устройства Допустимые варианты: ios или android

Example:
ios
token
string required

Токен

Example:
adef3i818r23nr4uhuiwdi23239fh8wd
lat
number optional

Широта

Example:
49.8403
lon
string optional

Долгота

Example:
24.0114

Responses

200 OK
Body
Object
id
number

ID устройства в базе данных

Example:
1
os_type
string

Тип устройства

Example:
ios
token
string

Токен

Example:
adef3i818r23nr4uhuiwdi23239fh8wd
lat
number

Широта

Example:
1
lon
number

Долгота

Example:
1
created_at
number

Дата регистрации

Example:
1414152812
updated_at
number

Дата обновления

Example:
1414154308
400 Bad Request

Не указаны обязательные параметры запроса

422 Data Validation Failed

Не правильно указаны данные