- Back API Introdution
- PUT activation device
- GET device by DeviceID
- GET list device
- UPDATE Device
- Переактивация устройства
- Создание нового устройства
Активация нового устройства
https://my2can.com/api/v1_device.json
Name | Require | Type | Description |
---|---|---|---|
device_address | no | varchar(200) | Адрес устройства. |
POST /api/v1_device.json/?action=activation HTTP/1.1
Host: my2can.com
token: e1ec049b388fbc7f2f9dca44dcbfde06
Cache-Control: no-cache
{
"status": "success",
"data":{
"model":{
"device_model": "",
"device_address": "Адрес",
"id": 60,
"storage_id": 0,
"name": "Название",
"device_id": "",
"is_available": 1,
"isDel": 0,
"date": "2018-04-18",
"time": "14:47:30",
"timestamp": 1524044850,
"activation_code": "1SDPUON9"
}
},
"base_id": 3,
"spd_id": 0
}
Переактивация устройства.
https://my2can.com/api/v1_device.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
SpdID | yes | int(10) | identifier device. |
PUT /api/v1_device.json/35?action=reactivation HTTP/1.1
Host: my2can.com
token: e1ec049b388fbc7f2f9dca44dcbfde06
Cache-Control: no-cache
{
"status": "success",
"data":{
"model":{
"device_model": "",
"id": 35,
"storage_id": 0,
"name": "dev2",
"device_id": "wwwqqq111",
"is_available": 0,
"isDel": 0,
"date": "2018-04-18",
"time": "14:31:30",
"timestamp": 1524043890,
"activation_code": "5N9062H6"
}
},
"base_id": 3,
"spd_id": 0
}
Активация устройства.
https://my2can.com/api/v1_auth.json
- Response formats
JSON
- Requires authentication?
No
Name | Require | Type | Description |
---|---|---|---|
activation_code | yes | char(8) | Код активации устройства |
device_id | yes | varchar(100) | Идентификатор внешнего устройства |
device_model | no | text | Описание устройства |
device_address | no | varchar(200) | Адрес торговой точки (Доступно с версии 1.0.0) |
PUT /api/v1_auth.json/FC5N46C8?action=device HTTP/1.1
Host: my2can.com
Cache-Control: no-cache
{
"PRIVATE_KEY": "5fab17617909231a9484b388bca27e90",
"PUBLIC_KEY": "b0cf9325515e1617b91a9e9eee5683f9"
}
Code | Description |
---|---|
'01003' | Кода активации не найдено |
'01004' | Код активации уже использован |
'99003' | Не передан обязательный параметр device_id |
https://storencash.com/api/v1_device.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
DeviceID | yes | int(10) | identifier device. |
GET /api/v1_device.json/445D-123-FG2 HTTP/1.1
Host: storencash.com
token: e1ec049b388fbc7f2f9dca44dcbfde06
Cache-Control: no-cache
{
"status": "success",
"data": {
"model": {
"id": 1,
"storage_id": 5,
"name": "Касса Сколково",
"device_id": "445D-123-FG2",
"device_model": "Sumsung G10",
"device_address": "Андропова, 49", (Доступно с версии 1.0.0)
"is_available": 1,
"isDel": 0,
"date": "2017-02-03",
"time": "10:59:31",
"timestamp": 1486097971
}
}
}
https://storencash.com/api/v1_device.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
page | no | int(10) | default = 0. Page. |
count | no | int(10) | default = 1000. Count models in page. Limit max 1000 models in one request! |
timestamp | no | int | default = 0. Список устройств измененных с указанной даты (>=). |
GET /api/v1_device.json?page=0&count=100×tamp=1486097971 HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
{
"status": "success",
"data": {
"collection": [
{
"id": 1,
"storage_id": 5,
"name": "Касса Сколково",
"device_id": "445D-123-FG2",
"device_model": "Sumsung G10",
"device_address": "Андропова, 49", (Доступно с версии 1.0.0)
"is_available": 1,
"isDel": 0,
"date": "2017-02-03",
"time": "10:59:31",
"timestamp": 1486097971
}
],
"total": 1,
"count": 1
}
}
https://storencash.com/api/v1_device.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
id | no | int(10) | default = null. Store&Cash device identifier. |
name | no | varchar(50) | default = null. Название устройства (семантика). |
device_id | yes | varchar(50) | default = null. Уникальный идентификатор устройства (серийный номер). |
device_model | no | text | default = null. Модель (описание) устройства. |
is_available | no | int(1) | default = null. Доступность устройства на приложениях 2can Касса. |
storage_id | no | int(10) | default = 0. Идентификатор склада к которому привязано устройство. |
device_address | no | varchar(200) | default = null. Адрес торговой точки. (Доступно с версии 1.0.0) |
PUT /api/v1_device.json/445D-123-FG2 HTTP/1.1
Host: storencash.com
token: 61e76bf664a0597144194eeee660cdc9
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
name=test&device_model=test&is_available=1&storage_id=1&device_address=Andropova
{
"status": "success",
"data": "Затронуто строк 1"
}