Conversations
Index
1. /messageuser
Pathname:
{{baseUrl}}/api/v1/{{codename}}/messageuser?skip=0&limit=10
{{baseUrl}}/api/v1/{{codename}}/messageuser?skip=0&limit=10&query={"account":"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 | Default 0. |
limit | String | Default and max value 100. |
query | Object | Optional value |
Sort params:
Parameter | type | Description |
---|---|---|
createdAt | Number | -1 1 |
Response:
Returns users conversations to the bot.
{
"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:
Method: GET
Header:
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
limit | String | Default and max value 100 |
query | Object | {“messageUser”:”messageUserId”} |
Sort params:
Parameter | type | Description |
---|---|---|
createdAt | Number | -1 1 |
Response:
Return messages
3. /message/query/old
Pathname:
Method: GET
Header:
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
messageUser | String | Required value, message user id. |
createdAt | String | Required value, message createdAt. |
Response:
Returns messages prior to the requested date.
4. /message/query/new
Pathname:
Method: GET
Header:
Url params:
Parameter | type | Description |
---|---|---|
codename | String | Request the Chat-Tonic team. |
Query params:
Parameter | type | Description |
---|---|---|
messageUser | String | Required value, message user id. |
createdAt | String | Required value, message createdAt. |
Response: