From f02c1463acf743331ee449135d3dd9acf7295a2f Mon Sep 17 00:00:00 2001 From: max <6393905@gmail.com> Date: Wed, 21 Sep 2022 20:33:47 +0300 Subject: [PATCH] add info --- README.md | 55 ++++++++++++------------- examples/create.json | 96 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 30 deletions(-) create mode 100644 examples/create.json diff --git a/README.md b/README.md index 38c09f6..7a978aa 100644 --- a/README.md +++ b/README.md @@ -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": [ { diff --git a/examples/create.json b/examples/create.json new file mode 100644 index 0000000..1149483 --- /dev/null +++ b/examples/create.json @@ -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": ["да"] + } + ] +}