Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{{baseUrl}}/api/v1/{{codename}}/lead/funnels?skip={{skip}}&limit={{limit}}
{{baseUrl}}/api/v1/{{codename}}/lead/funnels?skip={{skip}}&limit={{limit}}&accountaccountId={{accountId}}

Method: GET

...

Code Block
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)

account

accountId

String

Optional value, account id.

Response:

Info

Returns the funnels created for the bot with their interactions.

Code Block
{
  "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:

Code Block
{{baseUrl}}/api/v1/{{codename}}/lead/funnelInteractionsrecords?skip={{skip}}&limit={{limit}}

Method: POSTGET

Header:

Code Block
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:

Code Block
{
  "funnel": "sacarTarjeta",
  "funnelGroup": "Sacar Tarjeta"
}

...

Code Block
{
  "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:

Code Block
{{baseUrl}}/api/v1/{{codename}}/lead/generate/csvexport?funnel={{funnel}}&funnelGroup={{funnelGroup}}&exportType={{exportType}}

...

Code Block
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:

Info

Returns 'Leads' generated by users, the file is sent to the mail.

...

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

Code Block
{
  "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:

Info

Returns the url to download the file and the time remaining until it expires in seconds

...

Code Block
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:

Code Block
{
    "objects": [
        {
            "prefix": "funnels",
            "complete": "funnels/"
        }, {
            "prefix": "leads",
            "complete": "leads/"
        }, {
            "prefix": "messageUsers",
            "complete": "messageUsers/"
        }, {
            "prefix": "messages",
            "complete": "messages/"
        }
    ]
}

...