Index
1. /lead/funnels
Pathname:
{{baseUrl}}/api/v1/{{codename}}/lead/funnels?skip={{skip}}&limit={{limit}} {{baseUrl}}/api/v1/{{codename}}/lead/funnels?skip={{skip}}&limit={{limit}}&accountId={{accountId}}
Method: GET
Header:
Accept: 'application/json' Content-Type: 'application/json' Authorization: 'Bearer ' + accessToken
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
skip | String | 0 (Default 0) |
limit | String | 10 (Default and max value 100) |
accountId | String | Optional value, account id. |
Response:
Returns the funnels created for the bot with their interactions.
{ "limit": 10, "skip": 0, "funnels": { "sacarTarjeta": { "interactions": [ "INICIO", "DNI", "CELULAR", "INGRESO", "FIN" ], "groups": [ { "doubleCounting": true, "newAt": 24, "interactions": [ "INICIO", "DNI", "CELULAR", "INGRESO", "FIN" ], "_id": "5d7a6b9266f1bf664e3f6a7b", "funnelId": "sacarTarjeta", "name": "Sacar Tarjeta" } ] } } }
2. /lead/records
Pathname:
{{baseUrl}}/api/v1/{{codename}}/lead/records?skip={{skip}}&limit={{limit}}
Method: GET
Header:
Accept: 'application/json' Content-Type: 'application/json' Authorization: 'Bearer ' + accessToken
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
skip | String | 0 (Default 0) |
limit | String | 10 (Default and max value 100) |
Request params:
Parameter | type | Description |
---|---|---|
funnel | String | Required value, funnel name. |
funnelGroup | String | Required value, funnelGroup name. |
account | String | Optional value. |
startDate | Date(ISO_8601) | Optional value. |
endDate | Date(ISO_8601) | Optional value. |
Body:
{ "funnel": "sacarTarjeta", "funnelGroup": "Sacar Tarjeta" }
Response:
Returns 'Leads' generated by users.
{ "limit": 10, "skip": 0, "objects": [ { "_id": "5d7bfc1298317f98fa111f99", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "interaction": { "funnel": "sacarTarjeta", "last": "INGRESO", "group": "Sacar Tarjeta" }, "user": { "extraData": [ { "name": "DNI", "cxt": "12345678" }, { "name": "Celular", "cxt": "1412345678" }, { "name": "Ingreso", "cxt": "1000" } ], "messageUser": "5d7aa7b9a2b64670f6653afe", "platform": "messenger", "firstName": "Juan", "lastName": "Perez" }, "createdAt": "2019-09-13T20:29:06.684Z", "updatedAt": "2019-09-13T20:31:05.057Z" }, { "_id": "5d7bfaff98317f98fa111f3c", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", }, ... ] }
3. /lead/export
Pathname:
{{baseUrl}}/api/v1/{{codename}}/lead/export?funnel={{funnel}}&funnelGroup={{funnelGroup}}&exportType={{exportType}}
Method: GET
Header:
Accept: 'application/json' Content-Type: 'application/json' Authorization: 'Bearer ' + accessToken
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
funnel | String | Required value, funnel name. |
funnelGroup | String | Required value, funnelGroup name. |
exportType | String | Required value: csv json xlsx |
account | String | Optional value, account id. |
startDate | Date(ISO_8601) | Optional value. |
endDate | Date(ISO_8601) | Optional value. |
Response:
Returns 'Leads' generated by users, the file is sent to the mail.
{ "message": "Te enviaremos un email en cuanto se termine de procesar el listado" }
4. Download archives
Pathname:
{{baseUrl}}/api/v1/{{codename}}/archive/url?token={{appToken}}&name={{name}}
Method: GET
Header:
Accept: 'application/json' Content-Type: 'application/json'
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
token | String | Required value, app token. Request the Chat-Tonic team. |
name | String | Required value, file name. |
Query example (funnels, leads, messageUsers):
{ "token": "...", "name": "funnels/account-accountPlatform-accountId/2021-05-01.zip" }
Name composition:
Parts | Description |
---|---|
Folder 1 | Model (funnels, leads, messageUsers, messages). |
Folder 2 | Account information separated by dashes. |
File name | Date (YYYY-MM-DD). Always ends with .zip |
Response:
Returns the url to download the file and the time remaining until it expires in seconds
{ expiresIn: 86400 url: "https://s3.amazonaws.com/chattonic.mobile-tonic.com/archive/demo_codename/csv/funnels/account-webchattonic-accountId/2021-05-01.zip" }
4. Navigate between archive folders (Private. To be published soon)
Pathname:
{{baseUrl}}/api/v1/{{codename}}/archive/list?format=csv&prefix=funnels%2F
Method: GET
Header:
Accept: 'application/json' Content-Type: 'application/json'
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
format | String | csv |
prefix | String | Possible example values: ““, “funnels” or “leads”. |
Response:
{ "objects": [ { "prefix": "funnels", "complete": "funnels/" }, { "prefix": "leads", "complete": "leads/" }, { "prefix": "messageUsers", "complete": "messageUsers/" }, { "prefix": "messages", "complete": "messages/" } ] }