Переменные

Список переменных

GET https://app.hightouch.ai/api/store/custom_fields/

Query Parameters

NameTypeDescription

shop_id

integer

ID магазина

limit

integer

Кол-во записей (макс. 100)

offset

integer

Сдвиг по записям

search

string

Строка поиска по названию или ID переменной

{
  "status": "ok",
  "result": {
    "count": 42,
    "next": null,
    "previous": null,
    "results": [
      {
        "id": 577,
        "shop_id": 2,
        "name": "about",
        "dtype": {
          "id": "text",
          "name": "Текст"
        },
        "description": null
      },
      ...
    ]
  }
}

Добавить новую переменную

POST https://app.hightouch.ai/api/store/custom_fields/

Переменные бывают следующих типов: text - строка; number - целое или дробное число; bool - булевый тип ("Да/Нет"); image - сохраняет в себе URL картинки; json - сохраняет в себе JSON-объект произвольной структуры;

Request Body

NameTypeDescription

shop_id

integer

ID магазина

name

string

Название переменной (латиницей)

dtype

object

Тип данных. Например, {"id": "number"}

description

string

Описание переменной

{
  "status": "ok",
  "result": {
    "id": 758,
    "shop_id": 2,
    "name": "my_new_var",
    "dtype": {
      "id": "number",
      "name": "Число"
    },
    "description": "Новая переменная"
  }
}

Изменить переменную

PATCH https://app.hightouch.ai/api/store/custom_fields/:id/

Path Parameters

NameTypeDescription

id

integer

ID переменной

Request Body

NameTypeDescription

shop_id

integer

ID магазина

name

string

Новое имя переменной

description

string

Новое описание переменной

 {
  "status": "ok",
  "result": {
    "id": 758,
    "shop_id": 2,
    "name": "my_new_var",
    "dtype": {
      "id": "number",
      "name": "Число"
    },
    "description": "Новая переменная"
  }
}

Удалить переменную

DELETE https://app.hightouch.ai/api/store/custom_fields/:id/

Path Parameters

NameTypeDescription

id

integer

ID переменной

Última actualización