Leads

Index

1. /lead/funnels

Pathname:

1 2 {{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:

1 2 3 Accept: 'application/json' Content-Type: 'application/json' Authorization: 'Bearer ' + accessToken

 

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

Query params:

Parameter

type

Description

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 { "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:

1 {{baseUrl}}/api/v1/{{codename}}/lead/records?funnel={{funnel}}&funnelGroup={{funnelGroup}}&skip={{skip}}&limit={{limit}}

Method: GET

Header:

1 2 3 Accept: 'application/json' Content-Type: 'application/json' Authorization: 'Bearer ' + accessToken

 

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

skip

String

0 (Default 0)

limit

String

10 (Default and max value 100)

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.

Response:

Returns 'Leads' generated by users.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 { "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:

1 {{baseUrl}}/api/v1/{{codename}}/lead/export?funnel={{funnel}}&funnelGroup={{funnelGroup}}&exportType={{exportType}}&bot={{bot}}

Method: GET

Header:

1 2 3 Accept: 'application/json' Content-Type: 'application/json' Authorization: 'Bearer ' + accessToken

 

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

Query params:

Parameter

type

Description

Parameter

type

Description

funnel

String

Required value, funnel name.

funnelGroup

String

Required value, funnelGroup name.

exportType

String

Required value:

csv

json

xlsx

bot

String

Required value, bot name.

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.

1 2 3 { "message": "Te enviaremos un email en cuanto se termine de procesar el listado" }

 


4. Download archives

Pathname:

1 {{baseUrl}}/api/v1/{{codename}}/archive/url?token={{appToken}}&name={{name}}

Method: GET

Header:

1 2 Accept: 'application/json' Content-Type: 'application/json'

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

Query params:

Parameter

type

Description

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):

1 2 3 4 { "token": "...", "name": "funnels/account-accountPlatform-accountId/2021-05-01.zip" }

 

Name composition:

Parts

Description

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

1 2 3 4 { 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:

1 {{baseUrl}}/api/v1/{{codename}}/archive/list?format=csv&prefix=funnels%2F

Method: GET

Header:

1 2 Accept: 'application/json' Content-Type: 'application/json'

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

Query params:

Parameter

type

Description

Parameter

type

Description

format

String

csv

prefix

String

Possible example values: ““, “funnels” or “leads”.

Response:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 { "objects": [ { "prefix": "funnels", "complete": "funnels/" }, { "prefix": "leads", "complete": "leads/" }, { "prefix": "messageUsers", "complete": "messageUsers/" }, { "prefix": "messages", "complete": "messages/" } ] }