Table of Contents | ||
---|---|---|
|
Info |
---|
|
Шаблоны сообщений
...
|
Message templates
Get a list of message template categories
GET https://api.leeloo.ai/api/v2/categories/templates
...
Code Block |
---|
"data": { "categories": [ { "id": "5e3bf3fdb70492000f72cd6c", "name": "Category 1" }, { "id": "5e18a2a3ed0b7a000d6c948f", "name": "Category 2" } ] }, "status": 1 } |
...
Get a list of message templates within a category
GET https://api.leeloo.ai/api/v2/categories/templates/{category_id}
Path Paramscategory_id
(example: 5b3f543bb2737000133d25b0) -message template categories id категории шаблонов сообщений
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
...
Code Block |
---|
{ "data": { "templates": [ { "id": "5e42be758d4fff000cafe6ef", "message_name": "test template 2" }, { "id": "5e42be688d4fff000cafe5cc", "message_name": "test template 1" } ] }, "status": 1 } |
...
Sending a message template
POST https://api.leeloo.ai/api/v2/messages/send-template
...
Request Body(json)account_id
(example: 513f543gb2737020133d25b0) - communication channel id канала связиtemplate_id
(example: 6b3f543bb2737003133d25b4) - id шаблона сообщения на платформеof the message template on the platform
Code Block |
---|
{ "account_id": "5e42be688d4fff000cafe5cc", “template_id”: “5e42be758d4fff000cafe6ef” "variables": { "key1": "value1", "key2": "value2" } } |
...
Code Block |
---|
{ "status": 1, "data": {} } |
Сообщения
Получить список сообщений из чата по каналу коммуникации
...
Messages
Get a list of messages from a chat via a communication channel
Request
GET https://api.leeloo.ai/api/v2/communication-channels/{person_id}/chat-messages?limit=2&offset=0
Path Paramsperson_id
(example: 5b3f543bb2737000133d25b0) - communication channel id канала коммуникации.
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Paramslimit
- ограничение количества результатов (не рекомендуется выгружать большое количество данных сразу, так как это может замедлить выгрузку данных)offset
- сколько результатов пропустить (по умолчанию limiting the number of results (it is not recommended to upload a large amount of data at once, as this may slow down the data upload)offset
- how many results to skip (default 0)
Response
Code Block |
---|
{ "data": [ { "id": "5e3bf8d6c6ed91000c8534ae", "text": "Test API v.1 message template", "type": "YOUR_MESSAGE", "read": true, "createdAt": "2020-02-06T11:30:30.035Z", "updatedAt": "2020-02-06T11:30:30.035Z" }, { "id": "5e3beba47fa862000e3b4d05", "text": "API message", "type": "YOUR_MESSAGE", "read": true, "createdAt": "2020-02-06T10:34:12.230Z", "updatedAt": "2020-02-06T10:34:12.230Z" } ], "meta": { "limit": 3, "offset": 0, "filteredCount": 3, "totalCount": 52 }, "status": 1 } |
Info |
---|
ВАЖНО! Пример ответа на запрос показан для установленого параметра лимита равного двум. При изменении значения параметра лимита будет изменяться и кол-во сообщений в ответе на запрос. |
...
IMPORTANT! An example of a response to a request is shown for a limit parameter set to two. When changing the value of the limit parameter, the number of messages in the response to the request will also change. |
Sending messages
POST https://api.leeloo.ai/api/v2/messages/send-message
...
Request Body(json)account_id
(example: 5b3f543bb2737000133d25b0) - communication channel id канала связиtext
- текст сообщенияMessage text
Code Block |
---|
{ "account_id": "5b3f543bb2737000133d25b0", "text": "текстMessage сообщенияtext" } |
Response
Code Block |
---|
{ "status": 1, "data": {} } |
Каналы коммуникации
...
Communication channels
Get a list of communication channels (With external UTM tags)
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Paramslimit
- ограничение количества результатов (не рекомендуется выгружать большое количество данных сразу, так как это может замедлить выгрузку данных)offset
- сколько результатов пропустить (по умолчанию limiting the number of results (it is not recommended to upload a large amount of data at once, as this may slow down the data upload)offset
- how many results to skip (default 0)filter[last_message][from]
- фильтр по последнему сообщению от указанного числаfilter by last message from a specified date
filter[last_message][to]
- фильтр по последнему сообщению до указанного числаfilter by last message until a specified date
Response
Code Block |
---|
{ "data": [ { "id": "5ef074e9e31801000d73ba11", "person_id": "5ef074e9e31801000d73ba10", "name": "TIIIIK", "from": "TELEGRAM", "botStatus": "BOT", "lastMessageTime": "2020-08-31T07:55:53.865Z", "createdAt": "2020-06-22T09:07:53.351Z", "utmMarks": { "utm_source": "test_UTM_mark" } }, { "id": "5ea177b8ac8f55000d2c68f1", "person_id": "5ea177b8ac8f55000d2c68f0", "name": "Adolf Shtangencirkul", "from": "VKONTAKTE", "botStatus": "BOT", "lastMessageTime": "2020-08-29T08:31:51.211Z", "createdAt": "2020-04-23T11:10:48.337Z", "utmMarks": {} } ], "meta": { "limit": 2, "offset": 0, "filteredCount": 2, "totalCount": 2 }, "status": 1 } |
...
Obtaining information about a person via a communication channel (get person id knowing the account id parameter)
GET https://api.leeloo.ai/api/v2/communication-channels/{account_id}/person
Path Paramsaccount_id
(example: 5b3f543bb2737000133d25b0) - communication channel id канала коммуникации
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
...
Code Block |
---|
{ "data": { "id": "617fd5cc1cc06d2ae24dd9eb", "name": "Mark Down", "tags": [ "Tag 26" ], "profileImage": "https://static.leeloo.ai/images/5e18a2a3ed0b7a000d6c9446/abd88bd0-3b0a-11ec-82ee-bb08992a1760%5B571x1100%5Djpg", "gender": "OTHER", "phone": "+380977451099", "email": "lapaychuk95808@gmail.com", "locale": "ru_RU", "accounts": [ { "account_id": "617fd5cc1cc06d42c94dd9ec", "connection_id": "61308ac5d087cbc40f1e478d", "connection_status": "OK", "from": "FACEBOOK" } ], "subscribeHistory": [ { "tunnelName": "for list", "leadgentoolName": "New LGT", "trafficSource": "Default traffic source", "tunnelId": "617fa515557acb4a2472c560", "leadgentoolId": "617fa612925d13644ae58e55", "trafficSourceId": "617fa612925d1341eee58e58", "accountId": "617fd5cc1cc06d42c94dd9ec" } ], "links": { "contactedUsers": [ { "type": "users", "id": "60509800acc5ae000d74ce21" } ], "orders": [ { "type": "orders", "id": "618280605402c96fa86c125a" } ] }, "custom_fields": [], "created_at": "2021-11-01T11:55:56.358Z", "updated_at": "2024-02-02T12:07:54.882Z" }, "included": {}, "status": 1 } |
LGT
...
Create traffic sources in LGT
POST https://api.leeloo.ai/api/v2/leadgentools/{leadgentool_id}/create-traffic-source
...
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)name
- имя трафик соурсаtraffic source namedescription
- описание трафик соурсаtraffic source description
Code Block |
---|
{ "name": "some ts", "description": "some ts description" } |
...
Code Block |
---|
{ "data": { "type": "normal", "fb_adset_id": null, "name": "some ts", "description": "some ts description", "synchronized_with_fb": false, "synchronization_error": false, "disabled": false, "company_id": "5b9f63e3d244d2000e27692f", "leadgentool_id": "5e1f119d6c384804b31e945e", "tunnel_id": "5e1f11566c384804b31e9457", "created_by": "5b9f63e3d244d2000e276957", "hash": "nn7n15", "resubscribe_button_id": "5e32d0ed28faf61fc396f6b1", "createdAt": "2020-01-30T12:49:49.273Z", "updatedAt": "2020-01-30T12:49:49.273Z", "id": "5e32d0ed28faf61fc396f6b0" }, "status": 1 } |
Заказы
...
Orders
Create manual order
POST https://api.leeloo.ai/api/v2/orders
...
Request Body(json)paymentCreditsId
(example: 5b3f543bb2737000133d25b2) - payment system id платежной системы. Можно узнать в настройках платформы, раздел с платежными системами. You can find out in the platform settings, section with payment systems.email
- Емаил адрес человекаPerson's email addressphone
- телефон человекаman's phonetransactionDate
- желаемая дата проведения транзакции (для отображения на платформе) указывается в формате the desired transaction date (for display on the platform) is indicated in the format 2020-02-04T11:46:48.803ZofferId
(example: 5b3f543bb2737000133d25b0) - offer id оффераisNotifyAccount
- сообщать человеку о создании заказа или нет (может быть значение true или inform the person about the creation of an order or not (can be true or false)personId
(example: 5b3f543bb2737000133d25b1) - person id человекаmanagerId
(example: 5b3f543bb2737000133d25b0) - id юзера платформи за кем будет закреплен заказ. Опционально. Если не указать конкретного юзера - продажа будет platform user id and to whom the order will be assigned. Optional. If you do not specify a specific user, the sale will be System
Code Block |
---|
{ "paymentCreditsId": "5e3c3533f04b1f000c27b534", "email": "email123@gmail.com", "phone": "+380669999777", "transactionDate": "2020-02-04T11:46:48.803Z", "offerId": "5e3c357bf04b1f000c27b83a", "isNotifyAccount": "false", "personId": "5e1c4676b70fb2001279c268", "managerId": "5e1c1236b70fb3331279c444" } |
...
Code Block |
---|
{ "data": { "id": "5e5502a01b1668000ccc93ee", "title": "Ручной оффер", "price": 100, "currency": "USD", "status": "OPENED", "createdAt": "2020-02-25T11:18:56.419Z", "updatedAt": "2020-02-25T11:18:56.419Z" }, "status": 1 } |
...
Get a list of orders
GET https://api.leeloo.ai/api/v2/orders?limit=20&offset=0
Query Paramslimit
- ограничение количества результатов (не рекомендуется выгружать большое количество данных сразу, так как это может замедлить выгрузку данных)offset
- скольок результатов пропустить (по умолчанию limiting the number of results (it is not recommended to upload a large amount of data at once, as this may slow down the data upload)offset
- how many results to skip (default 0)
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
...
Code Block |
---|
{ "data": [ { "id": "5e399d72a2d0e2000dd584c1", "person_id": "5df0fac42121a5000e07d80b", "title": "manual offer", "price": 200, "currency": "USD", "status": "RESOLVED", "createdAt": "2020-02-04T16:36:02.213Z", "updatedAt": "2020-02-04T16:38:58.168Z" }], "meta": { "limit": 1, "offset": 0, "filteredCount": 20, "totalCount": 93 }, "status": 1 } |
...
Get information on a separate order
GET https://api.leeloo.ai/api/v2/orders/{order_id}
...
Code Block |
---|
{ "status": 1, "data": { "id": "5e2825e081fbca000d8596e4", "createdAt": "2015-04-02T14:20Z", "updatedAt": "2015-04-02T14:20Z", "title": "Title11", "description": "Description1", "price": 100, "currency": "UAH", //['USD', 'EUR', 'UAH', 'RUB'] "status": "SUCCESS", //['ORDER', 'PENDING', 'FAILED', 'SUCCESS', 'REFUNDED'], "paymentMethod": "WAYFORPAY", //['WAYFORPAY', 'YANDEX_MONEY', 'ASSET_PAYMENT', 'MANUAL'] } } |
Обновить информацию в МАНУАЛ (ручном) ордере
...
Update information in a MANUAL (manual) order
The order CANNOT BE with partial payments
POST https://api.leeloo.ai/api/v2/orders/{order_id}
Path Paramsorder_id
(example: 5b3f543bb2737000133d25b0) - айди ручного ордера без частичных оплатmanual order ID without partial payments.
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
...
Code Block |
---|
{ "data": { "id": "5b3f608db2737000133d25b6" }, "status": 1 } |
Люди
...
People
Get a list of people
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Params
limit - ограничение количества результатов (не рекомендуется выгружать большое количество данных сразу, так как это может замедлить выгрузку данных)offset
- скольок результатов пропустить (по умолчанию limiting the number of results (it is not recommended to upload a large amount of data at once, as this may slow down the data upload)
offset - how many results to skip (default 0)
filter[tags] - если необходима фильтрация по тегам. Опциональноif filtering by tags is required. Optional
filter[last_message] { from: 'js_date', to: 'js_date' } - фильтр по дате последнего сообщния. Обязателенfilter by date of the last message. Required.
filter[phone] - фильтр по номеру телефону. Опциональноfilter by phone number. Optional
filter[email] - фильтр по емейлу. Опциональноfilter by email. Optional
Response
Code Block |
---|
{ "status": 1, "data": [{ "id": "5e1c7ce2b4066a01900cdba0", "name": "Feliks", ”email": ”feliks@gmail.com", ”phone": ”+380966565556" "tags": [ "Mentor", "Professional" ], "accounts": [{ "account_id": "5e1c7ce2b4066a01900cdba1", "connection_id": "5e1c7afcb4066a01900cdb8c", "connection_status": "OK", "from": "TELEGRAM" }], "lastMessageTime": "2020-01-13T14:21:36.462Z" }], "meta": { "totalCount": 1, "filteredCount": 1, "limit": 20, "offset": 0 } } |
...
Get information about a specific person
GET https://api.leeloo.ai/api/v2/people/{person_id}?include=contactedUsers,orders
...
Code Block |
---|
{ "data": { "id": "625946dd585052c1629f1b2b", "name": "Mark Spenser", "tags": [], "profileImage": "NOT_DEFINED", "gender": "NO_DATA", "phone": "+380977451111", "email": "Ray37@hotmail.com", "locale": "", "accounts": [ { "account_id": "625946dd58505225f49f1b2c", "connection_id": "5e1edc3f18fc56000c0159b3", "connection_status": "OK", "from": "TELEGRAM" } ], "subscribeHistory": [ { "tunnelName": "Default tunnel", "leadgentoolName": "Default leadgentool", "trafficSource": "Default traffic source", "tunnelId": "5e18a2a3ed0b7a000d6c9484", "leadgentoolId": "5e18a2a3ed0b7a000d6c9486", "trafficSourceId": "5e18a2a3ed0b7a000d6c9488", "accountId": "625946dd58505225f49f1b2c" } ], "links": { "contactedUsers": [ { "type": "users", "id": "60509800acc5ae000d74ce21" } ], "orders": [ { "type": "orders", "id": "65cf58ba1261175f8d40a75f" } ] }, "custom_fields": [ { "type": "PHONE", "name": "phone", "value": "+48881644207" } ], "created_at": "2022-04-15T10:20:13.546Z", "updated_at": "2024-02-16T16:16:57.065Z" }, "included": { "users": [ { "id": "60509800acc5ae000d74ce21", "name": "Max", "createdAt": "2021-03-16T11:35:28.644Z", "updatedAt": "2024-02-19T12:59:04.460Z" } ], "orders": [ { "id": "65cf58ba1261175f8d40a75f", "title": "for API", "price": 100, "currency": "USD", "status": "OPENED", "updatedAt": "2024-02-16T12:44:42.569Z" } ] }, "status": 1 } |
...
Update information in the customer card
PUT https://api.leeloo.ai/api/v2/people/{person_id}
...
Code Block |
---|
{ "phone": "+380669991876", "email": "newmail@gmail.com", "custom_fields": [ { "type": "EMAIL", //PHONE, DATE, KEYWORD, NUMBER "name": "emailcust", "value": "customemail@gmail.com" } ] } |
...
Add a person on the platform
POST https://api.leeloo.ai/api/v2/people
...
Code Block |
---|
{ "data": { "id": "60a4bcd7bc45b806ac3b1a4a", "person_id": "60a4bcd7bc45b83b6e3b1a49", "name": "Feliks", "tags": [], "from": "MANUAL", "botStatus": "BOT", "connectionStatus": "OK", "gender": "NOT_DEFINED", "phone": "+380953066789", "email": "feliks@gmail.com", "locale": "", "subscribeHistory": [], "createdAt": "2021-05-19T07:23:03.546Z", "updatedAt": "2021-05-19T07:23:03.546Z" }, "status": 1 } |
...
Add SMS connection to a person
POST https://api.leeloo.ai/api/v2/people/sms
...
Code Block |
---|
{ "data": { "count_to_process": 1 }, "status": 1 } |
...
Add a comment to a person
PUT https://api.leeloo.ai/api/v2/people/{person_id}/add-comment
Path Paramsperson_id
(example: 5b3f543bb2737000133d25b0) - person id человека
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
...
Code Block |
---|
{ "data": { "created_by": "5b9f63e3d244d2000e276957", "company_id": "5b9f63e3d244d2000e27692f", "text": "some text", "entity_id": "5da5998fcecdb311d73d3049", "entity_type": "PERSON", "created_at": "2020-01-30T10:08:50.677Z", "updated_at": "2020-01-30T10:08:50.677Z", "id": "5e32ab3228faf61fc396f625" }, "status": 1 } |
Теги
...
Tags
Get a list of tags
GEThttps://api.leeloo.ai/api/v2/tags
...
Code Block |
---|
{ "status": 1, "data": [{ "id": "595f5d522a934035decc093d", "name": "Tag #1", }] } |
...
Remove a tag from a person
PUT https://api.leeloo.ai/api/v2/people/{person_id}/remove-tag
Path Paramsperson_id
(example: 5b3f543bb2737000133d25b0) - айди человекаperson id
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(form-data)tag_id
(example: 5b3f543bb2737000133d25b0) - tag id тега
Response
Code Block |
---|
{ "status": 1, "data": {} } |
...
Add a tag to a person
PUT https://api.leeloo.ai/api/v2/people/{person_id}/add-tag
Path Paramsperson_id
(example: 5b3f543bb2737000133d25b0) - айди человекаperson id
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(form-data)tag_id
(example: 5b3f543bb2737000133d25b0) - tag id тега
Response
Code Block |
---|
{ "status": 1, "data": {} } |
Туннели
...
Tunnels
Get a list of tunnels
GET https://api.leeloo.ai/api/v2/tunnels?limit=20&offset=0
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Params
limit - ограничение количества результатов (не рекомендуется выгружать большое количество данных сразу, так как это может замедлить выгрузку данных)offset
- сколько результатов пропустить (по умолчанию limiting the number of results (it is not recommended to upload a large amount of data at once, as this may slow down the data upload)
offset - how many results to skip (default 0)
Response
Code Block |
---|
{ "status": 1, "data": [{ "id": "595f5d522a934035decc093d", "name": "My tunnel", "createdAt": "2015-04-02T14:20Z", "updatedAt": "2015-04-02T14:20Z", }], "meta": { "totalCount": 1, "filteredCount": 1, "limit": 20, "offset": 0 } } |
...
Get information about the tunnel
GEThttps://api.leeloo.ai/api/v2/tunnels/{tunnel_id}?include=leadgentools
...
Code Block |
---|
{ "status": 1, "data": { "id": "595f5d522a934035decc093d", "name": "My tunnel", "createdAt": "2015-04-02T14:20Z", "updatedAt": "2015-04-02T14:20Z", "links": { "leadgentools": [{ "type": "leadgentools", "id": "222f5d522a934035decc093d" }] } }, "linked": { "leadgentools": [{ "id": "222f5d522a934035decc093d", "name": "LGT1", "type": "LINK", //['LINK', 'QR', 'WIDGET', 'POPUP', 'FORM', 'FB_AD', 'DEFAULT'] }] } } |
...
Get statistics for all tunnels
GEThttps://api.leeloo.ai/api/v2/tunnels/stats
...
Code Block |
---|
{ "status": 1, "data": [{ "subscribers": 10, "uniqSubscribers":2, "orders": 4, "sales": 3, "uniqSales": 2 "visits": 14, "uniqVisits": 5 "shows": 5, "uniqShows": 3 "totalSale": 200, // in USD "totalExpenses": 100 }] } |
...
Get statistics for one tunnel
Запрос
GEThttps://api.leeloo.ai/api/v2/tunnels/{tunnel_id}/stats
...
Code Block |
---|
{ "status": 1, "data": [{ "subscribers": 10, "uniqSubscribers":2, "orders": 4, "sales": 3, "uniqSales": 2 "visits": 14, "uniqVisits": 5 "shows": 5, "uniqShows": 3 "totalSale": 200, // in USD "totalExpenses": 100 }] } |
Пользователи
...
Get a list of platform users
GEThttps://api.leeloo.ai/api/v2/users?limit=20&offset=0
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Params
limit - ограничение количества результатовlimit the number of results
offset - сколько результатов пропустить(по умолчанию how many results to skip (default 0)
Ответ
Code Block |
---|
{ "status": 1, "data": [ { "id": "445f5d522a934035decc093d", "name": "Igor", "createdAt": "2015-04-02T14:20Z", "updatedAt": "2015-04-02T14:20Z", }, { "id": "125f5d522a934035decc093d", "name": "Alexey", "createdAt": "2015-04-02T14:20Z", "updatedAt": "2015-04-02T14:20Z", } ], "meta": { "totalCount": 1, "filteredCount": 1, "limit": 20, "offset": 0 } } |
...
Get information on a specific platform user
GEThttps://api.leeloo.ai/api/v2/users/{user_id}
Path Paramsuser_id
- platform user id пользователя платформы
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
...
Code Block |
---|
{ "data": { "id": "632af797bd3cc466fe1af584", "name": "John Mack", "createdAt": "2022-09-21T11:37:59.353Z", "updatedAt": "2022-09-27T12:26:12.786Z" }, "status": 1 } |
...
Getting a list of communication channels
GET https://api.leeloo.ai/api/v2/connections
...
Code Block |
---|
{ "data": { "connections": [ { "id": "65cf48536d81f496d4f9a673", "type": "telegram", "name": "Telegram bot" }, { "id": "65b3791a9af7b6ef6f4a8afd", "type": "sendGrid", "name": "Sendgrid bot" } ] }, "status": 1 } |
...
Subscription to tunnel and tunnel block:
POST https://api.leeloo.ai/api/v2/communication-channels/{account_id}/manual-subscribe
Path Paramsaccount_id
- id канала комуникации которого нужно подписатьID of the communication channel that needs to be subscribed
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(form-data)tunnel_id
(example: 5b3f543bb2737000133d25b0) - tunnel id тунеляtunnel_block_id
(example: 5b3f543bb2737000133d25b0) - id блока в тунелеblock id in the tunnel
Response
Code Block |
---|
{ "status": 1, "data": {} } |