Index
Table of Contents | ||
---|---|---|
|
1. GET /query
Pathname:
Code Block |
---|
{{baseUrl}}/api/v1/{{codename}}/query?skip=0&limit=10 {{baseUrl}}/api/v1/{{codename}}/query?skip=0&limit=10&query={"status":"pending"} |
...
Code Block |
---|
{ "limit": 10, "skip": 0, "objects": [ { "dates_id": { "5d9f4f976bc65120a93a17b0", "pendingapp": "2019-10-10T15:34:47.960Z" }59cbf49fd6976e583b5df5d2", "messageUser": { ... }, "accountmessage": { "_id": "5820d77d24270e7142e2da34"... }, "originsaccount": [], { "status_id": "pending5820d77d24270e7142e2da34", "_id": "5d9f4f976bc65120a93a17b0"}, "resolutionSettedAtorigins": "2019-10-10T15:34:47.960Z"[], "createdAtstatus": "2019-10-10T15:34:47.960Zpending", "messagedates": { ... }, "app"pending": "59cbf49fd6976e583b5df5d2",2019-10-10T00:00:00.000Z" "originCodename": "nutricionista"}, "search": "lautaro piacquadio lpiacquadio@mobile-tonic.com +18", "updatedAtcreatedAt": "2019-10-10T1910T00:4900:1700.691Z000Z", "HSMSendedAt": null, "lastNotifiedAtupdatedAt": "2019-10-10T1910T00:4900:1700.690Z000Z" } ] } |
...
2. POST /query
Pathname:
...
Code Block |
---|
{ "messageUser": { "_id": "5d824ee4c43bfe2439e631cb", "firstName": "Lautaro", "lastName": "Piacquadio", "profilePictureURL": "/api/v1/lpiacquadio/telegram/5820d77d24270e7142e2da34/getfile/AgADAQAD4KcxG1ncDwebydyIVUAQ5M79CjAABAEAAwIAA2MAA6MiAQABFgQ", "platform": "telegram", "pausedBot": false, "blocked": false, "profile": { "email": "lpiacquadio@mobilelpiacquadio@chat-tonic.com" } }, "message": { "receivedAt": "2019-10-10T1510T00:3400:4600.000Z", "type": "text", "text": "HolaHi", "category": "query" }, "origin": "demo" } |
...
Info |
---|
Create a new query, return the query |
Code Block |
---|
{ "dates_id": {"5da0a9afb5509127ce79ff67", "pendingapp": "2019-10-11T16:11:27.204Z" }59cbf49fd6976e583b5df5d2", "messageUser": { "pausedBot": false, "blocked": false, "_id": "5d824ee4c43bfe2439e631cb", "firstName": "Lautaro", "lastName": "Piacquadio", "profilePictureURL": "/api/v1/lpiacquadio/telegram/5820d77d24270e7142e2da34/getfile/AgADAQAD4KcxG1ncDwebydyIVUAQ5M79CjAABAEAAwIAA2MAA6MiAQABFgQ", "platform": "telegram", "profile": { "email": "lpiacquadio@mobilelpiacquadio@chat-tonic.com" } }, "message": { "receivedAt": "2019-10-10T00:00:00.000Z", "type": "text", "text": "Hi", "category": "query" }, "origins": [], "status": "pending", "_iddates": "5da0a9afb5509127ce79ff67", { "resolutionSettedAtpending": "2019-10-11T16:11:27.204Z" }, "search": "lautaro piacquadio lpiacquadio@mobile-tonic.com ", "createdAt": "2019-10-11T1611T00:1100:2700.204Z000Z", "updatedAt"message": { "receivedAt": "2019-10-10T15:34:46.000Z: "2019-10-11T00:00:00.000Z" } |
...
3. PUT /query/take
Pathname:
Code Block |
---|
{{baseUrl}}/api/v1/{{codename}}/query/take/:queryId |
Method: POST
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. |
queryId | String | Query ID |
Response:
Info |
---|
Take the query and mark it as in progress for you. |
Code Block |
---|
{ "ok": true, "query": "5da0a9afb5509127ce79ff67", "operator": { "_id": "59db8ee6127acf48c5c737b4", "typedisplayName": "text",Me Operator", "name": { "textfamilyName": "HolaOperator", "categorygivenName": "queryMe" } } } |
...
4. PUT /query/assign
Pathname:
Code Block |
---|
{{baseUrl}}/api/v1/{{codename}}/query/assign/:queryId/to/:userId |
Method: POST
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. |
queryId | String | Query ID |
userId | String | Operator ID |
Response:
Info |
---|
Assign the query to the operator and mark it as in progress. |
Code Block |
---|
{ "ok": true, "appquery": "59cbf49fd6976e583b5df5d25da0a9afb5509127ce79ff67", "originCodename"operator": { "_id": "demo59db8ee6127acf48c5c737b4", "searchdisplayName": "lautaro piacquadio lpiacquadio@mobile-tonic.com ",Other Operator", "name": { "familyName": "Operator", "updatedAtgivenName": "2019-10-11T16:11:27.215Z"Other" } } } |
...
5. PUT /query/resolve
Pathname:
Code Block |
---|
{{baseUrl}}/api/v1/{{codename}}/query/resolve/:queryId |
Method: POST
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. |
queryId | String | Query ID |
Response:
Info |
---|
Mark the query as resolved. |
Code Block |
---|
{
"ok": true,
"query": "5da0a9afb5509127ce79ff67"
} |