Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
excludeIndex

1. GET /query

Method: GET

Pathname:

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

...

Header:

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

...

Code Block
{
    "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:

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

...

Header:

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

...

Code Block
{
    "_id": "5da0a9afb5509127ce79ff67",
    "app": "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@chat-tonic.com"
        }
    },
    "message": {
        "receivedAt": "2019-10-10T00:00:00.000Z",
        "type": "text",
        "text": "Hi",
        "category": "query"
    },
    "origins": [],
    "status": "pending",
     "dates": {
        "pending": "2019-10-11T16:11:27.204Z"
    },
    "search": "lautaro piacquadio lpiacquadio@mobile-tonic.com  ",
    "createdAt": "2019-10-11T00:00:00.000Z",
    "updatedAt": "2019-10-11T00:00:00.000Z"
}

...

3. PUT /query/take

Method: PUT

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

...

Code Block
{
    "ok": true,
    "query": "5da0a9afb5509127ce79ff67",
    "operator": {
        "_id": "59db8ee6127acf48c5c737b4",
        "displayName": "Me Operator",
        "name": {
            "familyName": "Operator",
            "givenName": "Me"
        }
    }
}

...

4. PUT /query/assign

Method: PUT

Pathname:

Code Block
{{baseUrl}}/api/v1/{{codename}}/query/assign/:queryId/to/:userId

...

Header:

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

...

Code Block
{
    "ok": true,
    "query": "5da0a9afb5509127ce79ff67",
    "operator": {
        "_id": "59db8ee6127acf48c5c737b4",
        "displayName": "Other Operator",
        "name": {
            "familyName": "Operator",
            "givenName": "Other"
        }
    }
}

...

5. PUT /query/resolve

Method: PUT

Pathname:

Code Block
{{baseUrl}}/api/v1/{{codename}}/query/resolve/:queryId

...

Header:

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

...