Вы можете получить список всех аккаунтов клиентов из вашей компании.
Для этого отправьте следующий GET запрос:
GET https://api.leeloo.ai/api/v1/accounts?limit=3&offset=0&filter[tags]=tag3 |
Пример ответа:
{ "data": [ { "id": "59bbc641b1223300210cdf2f", "name": "Kurt Bowie", "tags": [ "tag3" ], "from": "FACEBOOK", "botStatus": "BOT", "lastMessageTime": "2017-11-03T08:34:18.417Z", "createdAt": "2017-09-15T12:23:29.023Z" }, { "id": "5899afd15c97121f006c8b48", "name": "Weend Vidente", "tags": [ "68187", "tag3" ], "from": "TELEGRAM", "botStatus": "BOT", "lastMessageTime": "2017-09-07T14:30:58.798Z", "createdAt": "2017-02-07T11:30:25.324Z" } ], "meta": { "limit": 3, "offset": 0, "filteredCount": 2, "totalCount": 2 }, "status": 1 } |
meta:
Вы можете получить подробную информацию об аккаунте по его id.
Пример GET запроса:
GET https://api.leeloo.ai/api/v1/accounts/59bbc641b1223300210cdf2f?include=contactedUsers,orders |
Пример ответа:
{ "data": { "id": "59bbc641b1223300210cdf2f", "name": "Kurt Bowie", "tags": [ "tag3" ], "from": "FACEBOOK", "botStatus": "BOT", "gender": "FEMALE", "locale": "en_US", "subscribeHistory": [ { "tunnelName": "TunnelName_1", "leadgentoolName": "LGT_1", "trafficSource": "Default traffic source" }, { "tunnelName": "TunnelName_2", "leadgentoolName": "LGT_2", "trafficSource": "TrafficSource_1" } ], "links": { "contactedUsers": [ { "type": "users", "id": "58be00d668aaeaded60aa186" } ], "orders": [ { "type": "orders", "id": "59f2e2425bb695001a3f6388" }, { "type": "orders", "id": "59edb72dbed51e00152c1c1f" }, { "type": "orders", "id": "59edb6e5da15a0001be1261f" } ] }, "createdAt": "2017-09-15T12:23:29.023Z", "updatedAt": "2017-11-03T11:29:21.528Z" }, "included": { "users": [ { "id": "58be00d668aaeaded60aa186", "name": "Robert", "createdAt": "2017-01-25T13:06:47.652Z", "updatedAt": "2017-08-16T09:11:23.002Z" } ], "orders": [ { "price": 1, "currency": "UAH", "paymentMethod": "ASSET_PAYMENT", "status": "SUCCESS", "updatedAt": "2017-10-27T07:39:19.363Z" }, { "price": 1, "currency": "UAH", "paymentMethod": "YANDEX_MONEY", "status": "SUCCESS", "updatedAt": "2017-10-23T09:33:05.403Z" }, { "price": 1, "currency": "UAH", "paymentMethod": "YANDEX_MONEY", "status": "SUCCESS", "updatedAt": "2017-10-23T09:32:20.164Z" } ] }, "status": 1 } |