Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Index

1. GET /query

Pathname:

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

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

Sort params:

Parameter

type

Description

createdAt

Number

-1

1

Response:

Returns queries

{
    "limit": 10,
    "skip": 0,
    "objects": [
        {
            "dates": {
                "pending": "2019-10-10T15:34:47.960Z"
            },
            "messageUser": {
                ...
            },
            "account": {
                "_id": "5820d77d24270e7142e2da34"
            },
            "origins": [],
            "status": "pending",
            "_id": "5d9f4f976bc65120a93a17b0",
            "resolutionSettedAt": "2019-10-10T15:34:47.960Z",
            "createdAt": "2019-10-10T15:34:47.960Z",
            "message": {
                ...
            },
            "app": "59cbf49fd6976e583b5df5d2",
            "originCodename": "nutricionista",
            "search": "lautaro piacquadio lpiacquadio@mobile-tonic.com +18",
            "updatedAt": "2019-10-10T19:49:17.691Z",
            "HSMSendedAt": null,
            "lastNotifiedAt": "2019-10-10T19:49:17.690Z"
        }
    ]
}

2. POST /query

Pathname:

{{baseUrl}}/api/v1/{{codename}}/query

Method: POST

Header:

Accept: 'application/json'
Content-Type: 'application/json'
Authorization: 'Bearer ' + accessToken

Url params:

Parameter

type

Description

codename

String

Request the Chat-Tonic team.

Request params:

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:

{
  "messageUser": {
    "_id": "5d824ee4c43bfe2439e631cb",
    "firstName": "Lautaro",
    "lastName": "Piacquadio",
    "profilePictureURL": "/api/v1/lpiacquadio/telegram/5820d77d24270e7142e2da34/getfile/AgADAQAD4KcxG1ncDwebydyIVUAQ5M79CjAABAEAAwIAA2MAA6MiAQABFgQ",
    "platform": "telegram",
    "pausedBot": false,
    "blocked": false,
    "profile": {
        "email": "lpiacquadio@mobile-tonic.com"
    }
  },
  "message": {
    "receivedAt": "2019-10-10T15:34:46.000Z",
    "type": "text",
    "text": "Hola",
    "category": "query"
  },
  "origin": "demo"
}

Response:

Create a new query, return the query

{
    "dates": {
        "pending": "2019-10-11T16:11:27.204Z"
    },
    "messageUser": {
        "pausedBot": false,
        "blocked": false,
        "_id": "5d824ee4c43bfe2439e631cb",
        "firstName": "Lautaro",
        "lastName": "Piacquadio",
        "profilePictureURL": "/api/v1/lpiacquadio/telegram/5820d77d24270e7142e2da34/getfile/AgADAQAD4KcxG1ncDwebydyIVUAQ5M79CjAABAEAAwIAA2MAA6MiAQABFgQ",
        "platform": "telegram",
        "profile": {
            "email": "lpiacquadio@mobile-tonic.com"
        }
    },
    "origins": [],
    "status": "pending",
    "_id": "5da0a9afb5509127ce79ff67",
    "resolutionSettedAt": "2019-10-11T16:11:27.204Z",
    "createdAt": "2019-10-11T16:11:27.204Z",
    "message": {
        "receivedAt": "2019-10-10T15:34:46.000Z",
        "type": "text",
        "text": "Hola",
        "category": "query"
    },
    "app": "59cbf49fd6976e583b5df5d2",
    "originCodename": "demo",
    "search": "lautaro piacquadio lpiacquadio@mobile-tonic.com  ",
    "updatedAt": "2019-10-11T16:11:27.215Z"
}

  • No labels