API v 2.0 (en)
UA | US | RU
|
---|
- 1 Message templates
- 1.2 Messages
- 1.2.1 Sending messages
- 1.3 Communication channels
- 1.4 LGT
- 1.5 Orders
- 1.6 People
- 1.7 Tags
- 1.7.1 Remove a tag from a person
- 1.7.2 Add a tag to a person
- 1.8 Tunnels
- 1.9 Пользователи
- 1.10 Getting a list of communication channels
- 1.11 Subscription to tunnel and tunnel block:
In all requests, the date must be specified taking into account the zero time zone UTC-0
all requests must be sent in JSON format
Message templates
Get a list of message template categories
GET https://api.leeloo.ai/api/v2/categories/templates
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
"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.
Response
{
"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
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)account_id
(example: 513f543gb2737020133d25b0) - communication channel idtemplate_id
(example: 6b3f543bb2737003133d25b4) - id of the message template on the platform
{
"account_id": "5e42be688d4fff000cafe5cc",
“template_id”: “5e42be758d4fff000cafe6ef”
"variables": {
"key1": "value1",
"key2": "value2"
}
}
Response
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
- 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
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
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)account_id
(example: 5b3f543bb2737000133d25b0) - communication channel idtext
- Message text
Response
Communication channels
Get a list of communication channels (With external UTM tags)
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Paramslimit
- 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
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.
Response
LGT
Create traffic sources in LGT
POST https://api.leeloo.ai/api/v2/leadgentools/{leadgentool_id}/create-traffic-source
Path Paramsleadgentool_id
(example: 5b3f543bb2737000133d25b0) - id инструмента лидогенерации
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)name
- traffic source namedescription
- traffic source description
Response
Orders
Create manual order
POST https://api.leeloo.ai/api/v2/orders
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
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 idisNotifyAccount
- inform the person about the creation of an order or not (can be true or false)personId
(example: 5b3f543bb2737000133d25b1) - person idmanagerId
(example: 5b3f543bb2737000133d25b0) - 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
Response
Get a list of orders
GET https://api.leeloo.ai/api/v2/orders?limit=20&offset=0
Query Paramslimit
- 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.
Response
Get information on a separate order
GET https://api.leeloo.ai/api/v2/orders/{order_id}
Path Paramsorder_id
(example: 5b3f543bb2737000133d25b0) - айди конкретного ордера
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
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.
Request Body(form-data)status
example: 'RESOLVED', (one_of: RESOLVED REJECTED)paymentDate
example: '2018-06-27 07:32',currency
example: 'RUB',price
example: '100' (actual price that you receive from account),userComments
example: 'actual date dont match'
Response
People
Get a list of people
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Query Params
limit - 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
Get information about a specific person
GET https://api.leeloo.ai/api/v2/people/{person_id}?include=contactedUsers,orders
Path Paramsperson_id
(example: 5b3f543bb2737000133d25b0) - id человека на платформе
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
Update information in the customer card
PUT https://api.leeloo.ai/api/v2/people/{person_id}
Path Paramsperson_id
(example: 5b3f543bb2737000133d25b0) - айди человека.
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)
Add a person on the platform
POST https://api.leeloo.ai/api/v2/people
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)
NOTE: connected_users_ids - is not required
Response
Add SMS connection to a person
POST https://api.leeloo.ai/api/v2/people/sms
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Request Body(json)
Response
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.
Request Body(json)
Response
Tags
Get a list of tags
GEThttps://api.leeloo.ai/api/v2/tags
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
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
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
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 - 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
Get information about the tunnel
GEThttps://api.leeloo.ai/api/v2/tunnels/{tunnel_id}?include=leadgentools
Path Paramstunnel_id
(example: 5b3f543bb2737000133d25b0) - id тунеля
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
Get statistics for all tunnels
GEThttps://api.leeloo.ai/api/v2/tunnels/stats
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
Get statistics for one tunnel
Запрос
GEThttps://api.leeloo.ai/api/v2/tunnels/{tunnel_id}/stats
Path Paramstunnel_id
(example: 5b3f543bb2737000133d25b0) - id тунеля
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
Пользователи
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)
Ответ
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.
Response
Getting a list of communication channels
GET https://api.leeloo.ai/api/v2/connections
IMPORTANT: Pass your auth token in 'X-Leeloo-AuthToken
' header.
Response
Subscription to tunnel and tunnel block:
POST https://api.leeloo.ai/api/v2/communication-channels/{account_id}/manual-subscribe
Path Paramsaccount_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 idtunnel_block_id
(example: 5b3f543bb2737000133d25b0) - block id in the tunnel
Response