Queries

Index

1. GET /query

Method: GET

Pathname:

{{baseUrl}}/api/v1/{{codename}}/query?skip=0&limit=10 {{baseUrl}}/api/v1/{{codename}}/query?skip=0&limit=10&query={"status":"pending"}

Header:

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
{“status“:”pending”}

Valid status values: [pending, progress, resolved]

Sort params:

Parameter

type

Description

Parameter

type

Description

createdAt

Number

-1

1

Note: To obtain the messages of the queries look here. You can make an api call with the messageUser and the createdAt of the query message.

 

Response:

Returns queries

{ "limit": 10, "skip": 0, "objects": [ { "_id": "5d9f4f976bc65120a93a17b0", "app": "59cbf49fd6976e583b5df5d2", "messageUser": { ... }, "message": { ... }, "account": { "_id": "5820d77d24270e7142e2da34" }, "origins": [], "status": "pending", "dates": { "pending": "2019-10-10T00:00:00.000Z" }, "search": "lautaro piacquadio lpiacquadio@mobile-tonic.com +18", "createdAt": "2019-10-10T00:00:00.000Z", "updatedAt": "2019-10-10T00:00:00.000Z" } ] }

2. POST /query

Method: POST

Pathname:

Header:

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

Request params:

Parameter

type

Description

Parameter

type

Description

messageUser

object

Required value, Chat-Tonic messageUser.

message

object

Required value, Chat-Tonic message.

account

object

Optional value, Chat-Tonic account.

origin

String

Optional value.

extra

object

Optional value.

Body:

Response:

Create a new query, return the query


3. PUT /query/take

Method: PUT

Pathname:

Header:

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

queryId

String

Query ID

Response:

Take the query and mark it as in progress for you.


4. PUT /query/assign

Method: PUT

Pathname:

Header:

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

queryId

String

Query ID

userId

String

Operator ID

Response:


5. PUT /query/resolve

Method: PUT

Pathname:

Header:

Url params:

Parameter

type

Description

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

queryId

String

Query ID

Response: