Conversations

Index

1. /messageuser

Pathname:

1 2 {{baseUrl}}/api/v1/{{codename}}/messageuser?skip=0&limit=10 {{baseUrl}}/api/v1/{{codename}}/messageuser?skip=0&limit=10&query={"account":"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

Default 0.

limit

String

Default and max value 100.

query

Object

Optional value
{“account“:”accountId”}

Sort params:

Parameter

type

Description

Parameter

type

Description

createdAt

Number

-1

1

Response:

Returns users conversations to the bot.

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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 { "limit": 10, "skip": 0, "objects": [ { "allowedBroadcast": true, "_id": "5d7aa7b9a2b64670f6653afe", "firstName": "Fernando", "lastName": "Chamorro", "profilePictureURL": "https://platform-lookaside.fbsbx.com/platform/profilepic/?psid=2325865257505792&width=1024&ext=1570911417&hash=AeTl15Z4vRPvcnGr", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "real": true, "pointers": [], "createdAt": "2019-09-12T20:16:57.907Z", "updatedAt": "2019-09-13T20:31:05.107Z", "blockedAt": null, "context": { "ingreso": "1000", "documentosLead": { "dni_front": null, "dni_back": null }, "provincia": null, "localidad": null, "direccion": null, "horario": null }, "inFlow": "askDniFrente", "lastMessageIn": { "flows": [ "saveIngreso", "validateIngresoSuccess", "endIngreso", "interactionIngreso", "nextIngreso", "tryAskDniFrente", "askDniFrente" ], "_id": "5d7bfc8998317f98fa111fbb", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "id": "7sPvpxGwZvuXiOtlBjtSgW3votOjoe8TdkGtkIrM12JzgwsuR7jo6e64sd0P35XPc_446gygt16Nyf0xlWRLYA", "receivedAt": "2019-09-13T20:31:04.287Z", "to": "self", "from": "2325865257505792", "entities": [], "type": "text", "text": "1000", "handledByBot": true, "inFlow": "saveIngreso", "messageUser": "5d7aa7b9a2b64670f6653afe", "createdAt": "2019-09-13T20:31:05.062Z", "updatedAt": "2019-09-13T20:31:05.062Z" }, "lastMessageInAt": "2019-09-13T20:31:05.062Z", "lastMessageInByUser": { "flows": [ "saveIngreso", "validateIngresoSuccess", "endIngreso", "interactionIngreso", "nextIngreso", "tryAskDniFrente", "askDniFrente" ], "_id": "5d7bfc8998317f98fa111fbb", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "id": "7sPvpxGwZvuXiOtlBjtSgW3votOjoe8TdkGtkIrM12JzgwsuR7jo6e64sd0P35XPc_446gygt16Nyf0xlWRLYA", "receivedAt": "2019-09-13T20:31:04.287Z", "to": "self", "from": "2325865257505792", "entities": [], "type": "text", "text": "1000", "handledByBot": true, "inFlow": "saveIngreso", "messageUser": "5d7aa7b9a2b64670f6653afe", "createdAt": "2019-09-13T20:31:05.062Z", "updatedAt": "2019-09-13T20:31:05.062Z" }, "lastMessageInByUserAt": "2019-09-13T20:31:05.062Z", "localeSelected": "es-AR", "profile": { "dni": "12345678", "celular": "1412345678", "email": "fer@gmail.com" }, "lastMessageOut": { "flows": [], "_id": "5d7bfc8998317f98fa111fbe", "text": "Hacé todo lo que puedas para que la foto sea buena calidad.", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "from": "self", "messageUser": "5d7aa7b9a2b64670f6653afe", "type": "text", "inFlow": "askDniFrente", "to": "2325865257505792", "createdAt": "2019-09-13T20:31:05.107Z", "updatedAt": "2019-09-13T20:31:05.107Z" }, "lastMessageOutAt": "2019-09-13T20:31:05.107Z" } ] }

 


2. /message

Pathname:

1 2 3 {{baseUrl}}/api/v1/{{codename}}/message?limit=10&sort={"createdAt":-1} {{baseUrl}}/api/v1/{{codename}}/message?query={"messageUser":"messageUserId"} &limit=10&sort={"createdAt":-1}

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

limit

String

Default and max value 100

query

Object

{“messageUser”:”messageUserId”}

Sort params:

Parameter

type

Description

Parameter

type

Description

createdAt

Number

-1

1

Response:

Return messages

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 45 46 { "limit": 100, "skip": 0, "objects": [ { "flows": [], "_id": "5d9ddb8f25e83cf49b8d6051", "text": "Thank you for feedback. Have a great day further.", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "from": "self", "messageUser": "5d960bfa732ae478e6ca36e3", "type": "text", "inFlow": "finishLeadRoadside", "to": "2325865257505792", "createdAt": "2019-10-09T13:07:27.545Z", "updatedAt": "2019-10-09T13:07:29.050Z", "deliveredAt": "2019-10-09T13:07:28.364Z", "readAt": "2019-10-09T13:07:28.364Z" }, { "flows": [ "interactionFeedbackRoadside", "finishLeadRoadside" ], "_id": "5d9ddb8f25e83cf49b8d6050", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "id": "2325865257505792-5d9ddb8a25e83cf49b8d604b-postback", "receivedAt": "2019-10-09T13:07:26.547Z", "to": "self", "from": "2325865257505792", "entities": [], "type": "text", "text": "Poor", "handledByBot": true, "selectedOption": "Poor", "inFlow": "interactionFeedbackRoadside", "messageUser": "5d960bfa732ae478e6ca36e3", "createdAt": "2019-10-09T13:07:27.537Z", "updatedAt": "2019-10-09T13:07:27.538Z" }, ... }

 


3. /message/query/old

Pathname:

1 2 {{baseUrl}}/api/v1/{{codename}}/message/query/old?messageUser=5d960bfa732ae478e6ca36e3 &createdAt:2019-10-04T19:44:55.409Z

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

messageUser

String

Required value, message user id.

createdAt

String

Required value, message createdAt.

Response:

Returns messages prior to the requested date.

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 { "objects": [ { "flows": [], "_id": "5d979ccbe4ca0d9e8f2e76bc", "text": "Hello", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "from": "self", "messageUser": "5d960bfa732ae478e6ca36e3", "type": "text", "inFlow": "menuRoadside", "to": "2325865257505792", "createdAt": "2019-10-04T19:26:03.908Z", "updatedAt": "2019-10-04T19:26:14.382Z", "deliveredAt": "2019-10-04T19:26:13.763Z", "readAt": "2019-10-04T19:26:13.763Z" }, { "flows": [], "_id": "5d979ccbe4ca0d9e8f2e76bd", "text": "I am Thabo your Digital Assistant", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "from": "self", "messageUser": "5d960bfa732ae478e6ca36e3", "type": "text", "inFlow": "menuRoadside", "to": "2325865257505792", "createdAt": "2019-10-04T19:26:03.935Z", "updatedAt": "2019-10-04T19:26:14.389Z", "deliveredAt": "2019-10-04T19:26:13.763Z", "readAt": "2019-10-04T19:26:13.763Z" }, ... }

 


4. /message/query/new

Pathname:

1 2 {{baseUrl}}/api/v1/{{codename}}/message/query/new?messageUser=5d960bfa732ae478e6ca36e3 &createdAt=2019-10-04T19:44:55.409Z

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

messageUser

String

Required value, message user id.

createdAt

String

Required value, message createdAt.

Response:

Returns messages after the requested date.

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 { "objects": [ { "flows": [], "_id": "5d979ccbe4ca0d9e8f2e76bc", "text": "Hello", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "from": "self", "messageUser": "5d960bfa732ae478e6ca36e3", "type": "text", "inFlow": "menuRoadside", "to": "2325865257505792", "createdAt": "2019-10-04T19:26:03.908Z", "updatedAt": "2019-10-04T19:26:14.382Z", "deliveredAt": "2019-10-04T19:26:13.763Z", "readAt": "2019-10-04T19:26:13.763Z" }, { "flows": [], "_id": "5d979ccbe4ca0d9e8f2e76bd", "text": "I am Thabo your Digital Assistant", "app": "57add9d952a84d940c9194a6", "account": "5970d180adf62b28c8630566", "platform": "messenger", "from": "self", "messageUser": "5d960bfa732ae478e6ca36e3", "type": "text", "inFlow": "menuRoadside", "to": "2325865257505792", "createdAt": "2019-10-04T19:26:03.935Z", "updatedAt": "2019-10-04T19:26:14.389Z", "deliveredAt": "2019-10-04T19:26:13.763Z", "readAt": "2019-10-04T19:26:13.763Z" }, ... }