The post has been translated automatically. Original language: Russian
How to send the first test POST request to the amoCRM or Bitrix24 API via Postman
CRM integration with a website, mobile application, Telegram bot, or internal system usually begins with one simple action - sending a test request to the API.
In practice, many entrepreneurs and even novice developers face the same problem: documentation seems complicated, OAuth raises questions, and incomprehensible errors like 401 Unauthorized or 400 Bad Request appear even before the first result is received.
In fact, one tool is enough to get to know the API for the first time — Postman. It allows you to quickly check the functionality of integration, test CRM methods and understand the structure of queries before writing code.
What is Postman and why is it needed?
Postman is an API testing tool.
With its help, you can:
- send GET and POST requests;
- send JSON data;
- checking server responses;
- test authorization;
- debug integrations before starting development.
In fact, Postman acts as a sandbox between the developer and the CRM system.
Before starting work
For a test query, you will need:
For amoCRM
- amoCRM account;
- integration created;
- Access Token;
- account domain.
For Bitrix24
- Bitrix24 portal;
- incoming webhook or app;
- The webhook URL;
- rights to create CRM entities.
For the first test, it is easier to use Bitrix24 webhooks, since they do not require full-fledged OAuth authorization.
Test request in Bitrix24
Step 1. Create an incoming webhook
Open:
To developers → Other → Incoming webhook
Select the necessary permissions:
CRM
After creation, the system will give you an address like:
https://portal.bitrix24.ru/rest/1/xxxxxxxxxxxx/
This will be the base URL for requests.
Step 2. Create a POST request in Postman
Method:
POST
URL:
https://portal.bitrix24.ru/rest/1/xxxxxxxxxxxx/crm.lead.add.json
Step 3. Configure the Body
Choose:
Body → raw → JSON
Sample content:
{
"fields": {
"TITLE": "Test application from Postman",
"NAME": "Ivan",
"PHONE": [
{
"VALUE": "+77001234567",
"VALUE_TYPE": "WORK"
}
]
}
}
Step 4. Click Send
If successful, you will receive a response.:
{
"result": 123
}
The number will be the ID of the new lead.
Test request in amoCRM
Things are a bit more complicated with amoCRM because of OAuth 2.0.
Step 1. Get Access Token
After creating the integration, the system will issue:
- Client ID
- Client Secret
- Redirect URI
After OAuth authorization, you will receive:
Access Token
That's what you'll need for queries.
Step 2. Create a query
Method:
POST
URL:
https://yourdomain.amocrm.ru/api/v4/leads
Step 3. Configure Headers
Add:
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json
Example:
Authorization: Bearer eyJhbGciOi...
Step 4. Transfer the data
Body:
[
{
"name": "Test deal from Postman",
"price": 10000
}
]
Step 5. Send the request
The successful response looks something like this:
{
"_links": {},
"_embedded": {}
}
The response will contain information about the created transaction.
The most common mistakes
401 Unauthorized
Reasons:
- invalid token;
- the token has expired;
- the Authorization header is missing.
Check it out:
Authorization: Bearer TOKEN
403 Forbidden
It usually means that you don't have any rights.
For example:
- no access to CRM;
- The integration does not have the necessary scope;
- the user is limited by roles.
400 Bad Request
Data structure error.
Most often, the problem is:
- incorrect JSON;
- missing required fields;
- invalid array format.
A useful technique:
First, send a minimal set of data from the documentation, and only then gradually complicate the request.
404 Not Found
It usually occurs when:
- error in the URL;
- the wrong domain;
- using an outdated API method.
A convenient API testing scheme
Before full-fledged integration, you should follow the following procedure:
- Get a token
- Check authorization
- Get a list of entities (GET)
- Create an entity (POST)
- Update the entity (PATCH)
- Delete test data
This approach allows you to quickly locate the problem and understand at what stage the error occurs.
What does a typical website integration path with CRM look like?
After a successful test, the following scheme is usually built in Postman:
- Form on the website
- Backend (PHP / Node.js)
- API CRM
- Creating a lead
- Business process automation
- Notification to the manager
That is why the first POST request is an important verification point for all future integration.
Conclusion
Postman allows you to test the amoCRM and Bitrix24 API in just a few minutes without writing a full-fledged application. For Bitrix24, the fastest way is to use an incoming webhook, and for amoCRM, work through OAuth and Access Token.
After the successful creation of the first lead or deal, it becomes much easier to design further integration of a website, chatbot, mobile application or internal information system with CRM. For most projects, this test is the starting point for all sales automation and application processing.
Как отправить первый тестовый POST-запрос к API AmoCRM или Bitrix24 через Postman
Интеграция CRM с сайтом, мобильным приложением, Telegram-ботом или внутренней системой обычно начинается с одного простого действия — отправки тестового запроса к API.
На практике многие предприниматели и даже начинающие разработчики сталкиваются с одной и той же проблемой: документация кажется сложной, OAuth вызывает вопросы, а непонятные ошибки вроде 401 Unauthorized или 400 Bad Request появляются еще до получения первого результата.
На самом деле для первого знакомства с API достаточно одного инструмента — Postman. Он позволяет быстро проверить работоспособность интеграции, протестировать методы CRM и понять структуру запросов до написания кода.
Что такое Postman и зачем он нужен
Postman — это инструмент для тестирования API.
С его помощью можно:
- отправлять GET и POST-запросы;
- передавать JSON-данные;
- проверять ответы сервера;
- тестировать авторизацию;
- отлаживать интеграции до начала разработки.
Фактически Postman выступает в роли «песочницы» между разработчиком и CRM-системой.
Перед началом работы
Для тестового запроса потребуется:
Для AmoCRM
- аккаунт AmoCRM;
- созданная интеграция;
- Access Token;
- домен аккаунта.
Для Bitrix24
- портал Bitrix24;
- входящий вебхук или приложение;
- URL вебхука;
- права на создание сущностей CRM.
Для первого теста проще использовать именно вебхуки Bitrix24, поскольку они не требуют полноценной OAuth-авторизации.
Тестовый запрос в Bitrix24
Шаг 1. Создаем входящий вебхук
Откройте:
Разработчикам → Другое → Входящий вебхук
Выберите необходимые права:
CRM
После создания система выдаст адрес вида:
https://portal.bitrix24.ru/rest/1/xxxxxxxxxxxx/
Это и будет базовый URL для запросов.
Шаг 2. Создаем POST-запрос в Postman
Метод:
POST
URL:
https://portal.bitrix24.ru/rest/1/xxxxxxxxxxxx/crm.lead.add.json
Шаг 3. Настраиваем Body
Выберите:
Body → raw → JSON
Пример содержимого:
{
"fields": {
"TITLE": "Тестовая заявка из Postman",
"NAME": "Иван",
"PHONE": [
{
"VALUE": "+77001234567",
"VALUE_TYPE": "WORK"
}
]
}
}
Шаг 4. Нажимаем Send
При успешном выполнении получите ответ:
{
"result": 123
}
Число будет являться ID нового лида.
Тестовый запрос в AmoCRM
С AmoCRM всё немного сложнее из-за OAuth 2.0.
Шаг 1. Получаем Access Token
После создания интеграции система выдаст:
- Client ID
- Client Secret
- Redirect URI
После OAuth-авторизации вы получите:
Access Token
Именно он понадобится для запросов.
Шаг 2. Создаем запрос
Метод:
POST
URL:
https://yourdomain.amocrm.ru/api/v4/leads
Шаг 3. Настраиваем Headers
Добавьте:
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json
Пример:
Authorization: Bearer eyJhbGciOi...
Шаг 4. Передаем данные
Body:
[
{
"name": "Тестовая сделка из Postman",
"price": 10000
}
]
Шаг 5. Отправляем запрос
Успешный ответ выглядит примерно так:
{
"_links": {},
"_embedded": {}
}
Внутри ответа будет информация о созданной сделке.
Самые частые ошибки
401 Unauthorized
Причины:
- неверный токен;
- токен истек;
- отсутствует заголовок Authorization.
Проверьте:
Authorization: Bearer TOKEN
403 Forbidden
Обычно означает отсутствие прав.
Например:
- нет доступа к CRM;
- интеграция не имеет нужного scope;
- пользователь ограничен ролями.
400 Bad Request
Ошибка структуры данных.
Чаще всего проблема заключается в:
- неправильном JSON;
- отсутствующих обязательных полях;
- неверном формате массива.
Полезный прием:
Сначала отправить минимальный набор данных из документации, а уже затем постепенно усложнять запрос.
404 Not Found
Обычно возникает при:
- ошибке в URL;
- неправильном домене;
- использовании устаревшего метода API.
Удобная схема тестирования API
Перед полноценной интеграцией стоит придерживаться следующего порядка:
- Получить токен
- Проверить авторизацию
- Получить список сущностей (GET)
- Создать сущность (POST)
- Обновить сущность (PATCH)
- Удалить тестовые данные
Такой подход позволяет быстро локализовать проблему и понять, на каком этапе возникает ошибка.
Как выглядит типичный путь интеграции сайта с CRM
После успешного теста в Postman обычно строится следующая схема:
- Форма на сайте
- Backend (PHP / Node.js)
- API CRM
- Создание лида
- Автоматизация бизнес-процессов
- Уведомление менеджера
Именно поэтому первый POST-запрос является важной точкой проверки всей будущей интеграции.
Вывод
Postman позволяет проверить работу API AmoCRM и Bitrix24 буквально за несколько минут без написания полноценного приложения. Для Bitrix24 самый быстрый способ — использование входящего вебхука, а для AmoCRM — работа через OAuth и Access Token.
После успешного создания первого лида или сделки становится значительно проще проектировать дальнейшую интеграцию сайта, чат-бота, мобильного приложения или внутренней информационной системы с CRM. Для большинства проектов именно такой тест является отправной точкой всей автоматизации продаж и обработки заявок.