This commit is contained in:
max 2022-09-21 20:33:47 +03:00
parent 0b6706adf3
commit f02c1463ac
2 changed files with 121 additions and 30 deletions

View File

@ -21,56 +21,51 @@ REQUEST:
```json
{
"title": "Произвольное название сборки",
"watchers": [
{
"type" : "site",
"sld" : "emex.ru",
"city" : "москва",
"rules" : ["emex"]
}
"title" : "Произвольное название сборки",
"watchers" : [
{
"type" : "site",
"sld" : "emex.ru",
"city" : "москва"
}
],
"records": [
{
"sku": "articul_code",
"vcode": "5531",
"brand": "ngk",
"title": "full item title",
"model": "5531",
"tags": [
"some",
"free",
"tags"
],
"price": 5000
}
"records" : [
{
"sku" : "your_inner_code",
"vcode" : "5531",
"brand" : "ngk",
"model" : "5531",
"price" : 12,
"tags" : [
"tag1",
"tag2"
]
}
]
}
```
RESPONSE:
codes (200, 400, 403, 502)
possible codes (202, 400, 403, 500, 502)
```json
{
"code" : "http_code_duplicate",
"message" : "Описание ошибки если есть",
"matcher_id" : 10
"matcher_id" : 10,
... В случае успеха поля как в ответе на matcher/status с описание состояния сборки ...
}
```
### Обновление исходных записей
endpoint: api/(matcher?|source?)/update?token=XXXXXXXXXXX
endpoint: api/(matcher)/update?token=XXXXXXXXXXX
REQUEST
```json
{
"matcher_id": 10,
"matching": [
"brand",
"model"
],
"matching": ["brand","model"],
"actions": ["create", "update", "delete"],
"records": [
{

96
examples/create.json Normal file
View File

@ -0,0 +1,96 @@
{
"title" : "test one",
"watchers" : [
{
"type" : "site",
"sld" : "emex.ru",
"city" : "москва"
}
],
"records" : [
{
"sku": "13273",
"vcode": "C-10",
"brand": "HKT",
"model": "C-10",
"tags": ["да"]
},
{
"sku": "9733",
"vcode": "P102",
"brand": "TAMA",
"model": "P102",
"tags": ["да"]
},
{
"sku": "7004",
"vcode": "JNDX-34M",
"brand": "FCC",
"model": "JNDX-34M",
"tags": ["да"]
},
{
"sku": "119060",
"vcode": "DOP1150",
"brand": "DREIK",
"model": "DOP1150",
"tags": ["да"]
},
{
"sku": "9730",
"vcode": "P101",
"brand": "TAMA",
"model": "P101",
"tags": ["да"]
},
{
"sku": "13275",
"vcode": "C-12D",
"brand": "HKT",
"model": "C-12D",
"tags": ["да"]
},
{
"sku": "133336",
"vcode": "SE-N151R",
"brand": "555",
"model": "SE-N151R",
"tags": ["да"]
},
{
"sku": "6985",
"vcode": "JNDSX-41",
"brand": "FCC",
"model": "JNDSX-41",
"tags": ["да"]
},
{
"sku": "9766",
"vcode": "WV48B-82",
"brand": "TAMA",
"model": "WV48B-82",
"tags": ["да"]
},
{
"sku": "8396",
"vcode": "WV48B-88",
"brand": "TAMA",
"model": "WV48B-88",
"tags": ["да"]
},
{
"sku": "4469",
"vcode": "PT-150",
"brand": "HKT",
"model": "PT-150",
"tags": ["да"]
},
{
"sku": "156443",
"vcode": "PU176012RDXW",
"brand": "KOYO",
"model": "PU176012RDXW",
"tags": ["да"]
}
]
}