API Интеграма позволяет делать все те же действия, которые доступны пользователю в базовом интерфейсе. Также есть некоторые команды, которые доступны только по API.
Терминология
Общие правила
integram.io/{база}/{действие}/{id}?JSON=1 https://integram.io/apix/metadata/42 curl --location 'integram.io/apix/metadata/42' {
"id": "42",
"up": "0",
"type": "3",
"val": "Роль",
"unique": "1",
"reqs": [
{
"num": 1,
"id": "117",
"val": "Объекты",
"type": "5",
"arr_id": "116"
},
{
"num": 2,
"id": "154",
"val": "Меню",
"type": "3",
"arr_id": "151"
},
{
"num": 3,
"id": "135",
"val": "Описание",
"type": "12"
}
]
} Список команд API
Авторизация и управление базами
Авторизация
curl --location 'https://integram.io/apix/auth?JSON=1' \
--form 'login="apiuser"' \
--form 'pwd="************"' {
"_xsrf": "cd4b6417a3940ed4a84h074d",
"token": "ea15dcc3a8cae93e8f5e17e25b6710",
"id": "632",
"msg": ""
} curl --location 'integram.io/apix/metadata/42' \
--header 'Authorization: ea15dcc3a8cae93e8f5e17e25b6710' curl --location 'https://integram.io/apix/_d_new?JSON=1' \
--form 't="3"' \
--form 'val="Клиент"' \
--header 'Authorization: ea15dcc3a8cae93e8f5e17e25b6710' \
--form '_xsrf="1cb413634d074d3804ed48"' Basic HTTP Authentication
Authorization: Basic Username:Password Токены, ID и имя пользователя
curl --location 'https://integram.io/apix/xsrf' {
"_xsrf": "cd4b6417a3940ed4a84h074d",
"token": "ea15dcc3a8cae93e8f5e17e25b6710",
"user": "apiuser",
"role": "api",
"id": "632",
"msg": ""
} Список баз
curl --location 'https://integram.io/my/report/313?JSON_KV=1' [
{
"User": null,
"Email": "alex@gmail.com",
"Name": "Alexey Samuel",
"Phone": "",
"Date": "08.07.2024",
"Notes": "",
"Picture": "https://lh3.googleusercontent.com/a/Agg8cJ2WhxugeQNadTqoZaYxbORgdTEq_I-FRg=6-c",
"DBID": "178652",
"DB": "test",
"Balance": "0",
"Bonus": "",
"Referrals": "",
"Template": "RU",
"Description": "",
"Count": "0",
"Plan": "Startup",
"Plan date": "23.04.2025",
"PlanID": "1147"
},
{
"User": null,
"Email": "alex@gmail.com",
"Name": "Alexey Samuel",
"Phone": "",
"Date": "08.07.2024",
"Notes": "",
"Picture": "https://lh3.googleusercontent.com/a/Agg8cJ2WhxugeQNadTqoZaYxbORgdTEq_I-FRg=6-c",
"DBID": "195822",
"DB": "redes",
"Balance": "0",
"Bonus": "",
"Referrals": "",
"Template": "ru",
"Description": "",
"Count": "0",
"Plan": "Startup",
"Plan date": "23.04.2025",
"PlanID": "1147"
}
] Создать базу
curl --location 'https://integram.io/my/_new_db/?JSON=1&db=apiman&template=RU' {
status: "Ok",
id: 221756
} Метаданные
Базовые типы
Описание данных
curl --location 'https://integram.io/apix/metadata?JSON=1' curl --location 'https://integram.io/apix/metadata/18?JSON=1' [
{
"id": "18",
"up": "0",
"type": "3",
"val": "Пользователь",
"unique": "1",
"reqs": [
{
"num": 1,
"id": "115",
"val": "Роль",
"type": "3",
"ref": "42",
"ref_id": "114",
"attrs": ":!NULL:164"
},
{
"num": 2,
"id": "41",
"val": "Email",
"type": "3",
"attrs": ":!NULL:"
},
{
"num": 3,
"id": "30",
"val": "Телефон",
"type": "3"
},
{
"num": 4,
"id": "156",
"val": "Дата",
"type": "9",
"attrs": "[TODAY]"
},
{
"num": 5,
"id": "33",
"val": "Имя",
"type": "3"
},
{
"num": 6,
"id": "39",
"val": "Примечание",
"type": "12"
},
{
"num": 7,
"id": "38",
"val": "Фото",
"type": "10"
},
{
"num": 8,
"id": "124",
"val": "Activity",
"type": "4"
},
{
"num": 9,
"id": "130",
"val": "Secret",
"type": "3"
},
{
"num": 10,
"id": "20",
"val": "Password",
"type": "6"
},
{
"num": 11,
"id": "125",
"val": "Token",
"type": "6"
},
{
"num": 12,
"id": "40",
"val": "xsrf",
"type": "6"
},
{
"num": 13,
"id": "647",
"val": "Тег",
"type": "3",
"ref": "616",
"ref_id": "617",
"attrs": ":MULTI:"
}
]
}
] Таблицы
Список таблиц
curl --location 'https://integram.io/apix/dict?JSON=1' {
"18": "Пользователь",
"22": "Запрос",
"29": "Формат",
"42": "Роль",
"47": "Доступ",
"63": "Функция",
"65": "Итог",
"137": "Форма",
"269": "Настройка",
"300": "Категории",
"301": "Вид",
"515": "Опорос",
"616": "Тег"
} curl --location 'https://integram.io/apix/object/42?JSON_DATA=1' [
{
"i": 145,
"u": 1,
"o": 1,
"r": [
"admin",
"3",
"6",
""
]
},
{
"i": 164,
"u": 1,
"o": 1,
"r": [
"user",
"2",
"",
""
]
},
{
"i": 512,
"u": 1,
"o": 1,
"r": [
"api",
"2",
"",
""
]
},
{
"i": 626,
"u": 1,
"o": 1,
"r": [
"guest",
"1",
"",
""
]
}
] Создать таблицу
curl --location 'https://integram.io/apix/_d_new?JSON=1' \
--form 't="3"' \
--form 'val="Клиент"' {
"id": "",
"obj": 641,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
} Добавить колонку
curl --location 'https://integram.io/apix/_d_new?JSON=1' \
--form 't="3"' \
--form 'val="ИНН"' {
"id": "",
"obj": 642,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
} curl --location 'https://integram.io/apix/_d_req/641?JSON=1' \
--form 't="642"'
{
"id": 643,
"obj": 641,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
}
Добавить колонку-справочник
curl --location 'https://integram.io/apix/_d_new?JSON=1' \
--form 't="3"' \
--form 'val="Категория"' {
"id": "",
"obj": 644,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
} curl --location 'https://integram.io/apix/_d_ref/644?JSON=1' {
"id": 644,
"obj": 645,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
} curl --location 'https://integram.io/apix/_d_req/641?JSON=1' \
--form 't="645"' {
"id": 646,
"obj": 641,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
}
Колонка-справочник с мульти-выбором
curl --location 'https://integram.io/apix/_d_multi/646?JSON=1' {
"id": 646,
"obj": "641",
"next_act": "edit_types",
"args": "ext",
"warnings": ""
}
Удалить колонку
curl --location 'https://integram.io/apix/_d_ord/643?JSON=1' [
{
"error": "Вы хотите удалить реквизит у типа при наличии этого реквизита у экземпляров (всего: 1)!"
}
] curl --location 'https://integram.io/apix/_d_del_req/643?JSON=1' \
--form 'forced="1"' {
"id": "641",
"obj": "641",
"next_act": "edit_types",
"args": "ext",
"warnings": ""
}
Переместить колонку
curl --location 'https://integram.io/apix/_d_ord/648?JSON=1' \
--form 'order="1"'
{
"id": 648,
"obj": 648,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
} Удалить таблицу
curl --location 'https://integram.io/apix/_d_del/642?JSON=1' {
"id": 642,
"obj": null,
"next_act": "edit_types",
"args": "ext",
"warnings": ""
} Задать псевдоним
curl --location 'https://integram.io/apix/_d_alias/648?JSON=1' \
--form 'val="Метка"' {
"id": "641",
"obj": "641",
"next_act": "edit_types",
"args": "ext",
"warnings": ""
}
Справочные поля
Запросить справочник
curl --location 'https://integram.io/apix/_ref_reqs/646?JSON=1&id=649' {
"650": "Лид",
"660": "Клиент",
"661": "ЧС"
} Выбрать значение
curl --location 'https://integram.io/apix/_m_set/649?JSON=1' \
--form 't646="660"' {
"id": "658",
"obj": 649,
"next_act": "nul",
"args": "",
"warnings": ""
} Удалить значение
curl --location 'https://integram.io/apix/_m_set/649?JSON=1' \
--form 't646=" "' curl --location 'https://integram.io/apix/_m_del/654?JSON=1' Дополнить справочник
curl --location 'integram.io/apix/metadata/641' {
"id": "641",
"up": "0",
"type": "3",
"val": "Клиент",
"unique": "0",
"reqs": [
{
"num": 1,
"id": "648",
"val": "Тег",
"type": "3",
"ref": "616",
"ref_id": "617",
"attrs": ":MULTI::ALIAS=Метка:"
},
{
"num": 2,
"id": "646",
"val": "Категория",
"type": "3",
"ref": "644",
"ref_id": "645"
}
]
} curl --location 'https://integram.io/apix/_m_new/644?JSON=1' \
--form 't644="Бывший"' \
--form 'up="1"' {
"id": 662,
"obj": 662,
"ord": 1,
"next_act": "object",
"args": "",
"val": "Бывший"
} {
"650": "Лид",
"660": "Клиент",
"661": "ЧС",
"662": "Бывший"
} Записи
Запросить список
curl --location 'https://integram.io/apix/object/641?JSON=1' [
{
"i": 649,
"u": 1,
"o": 1,
"r": [
"АО Ромашка",
"Летняя, 21",
"8(555)0123456"
]
},
{
"i": 668,
"u": 1,
"o": 1,
"r": [
"ПАО Эллипс",
"Центральная, 7",
"8(555)6543210"
]
}
]