Skip to main content

Uniphore Help Center Portal

Fetch Conversations

The Fetch Conversations API retrieves conversation IDs based on filter values passed in the Request Body.

Endpoint

Method: GET

URL: https://<Hostname>/uzng-gateway/v1/conversations

curl --location '
https://<Hostname>/uzng-gateway/v1/get/conversations'
\
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer NzIjoiaHR0cHM6Ly9kZXYtZzJqNW11MnoudXMuYXV0aDAuY29tLyIsInN1YiI6InRKYXZQUlcyYWlNcVBYdlluNXhVM3VuNGh4QjhVTlVSQGNsaWVudHMiLCJhdWQiOiJhcGkudW5pcGhvcmUuY29tIiwiaWF0IjoxNzIxODcxMzgxLCJleHAiOjE3MjE5NTc3ODEsInNjb3BlIjoicmVhZDp0ZW5hbnRzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIiwiYXpwIjoidEphdlBSVzJhaU1xUFh2WW41eFUzdW40aHhCOFVOVVIiLCJwZXJtaXNzaW9ucyI6WyJyZWFkOnRlbmFudHMiXX0.W2b3dOPtp6CpsEJI_0iC607Mfd0587u3qoxZiusRtyuXg6QfCsZ91NCDe41J0Qb0pDfPcx-kI1yVHv5tbFRdblgjoJo9O8nskXjQWk2IfjRDgACldMB8x5nDtQqDX9fRgPWVZkQDl4fN63151-l-GFwwhWB76CUULbw0dACHCDe7YjGPJbGaPcC3P6aIwRoY2LWrHaIud3-0v5O1qxCAzrp5Dily7zbjXQt8lX7YyASxpRwnGyodcOHQGDM3HNd-iGvaPOGnySJFXnTU_XZWxbrI2D_3RC9qRf0O4wSNVe0VxCCl7fp4peibGU0fooiauS5GoYmYmbx8ht9A562jpg' \
--data '{
    "startDate": "2024-01-01 18:30:00",
    "endDate": "2024-08-04 18:30:00",
    "direction": "INBOUND",
    "organizationNodeId": "153",
    "agentId": "",
    "language": "en-us",
    "processingStatus": "COMPLETED",
    "pageSize": 10,
    "pageToken": "TQzZjJjMTBmIiwidG90YWxfY291bnQiOjExLCJmaWx0ZXJfdmFsdWVzIjp7IjQiOiIyMDI0LTA2LTExVDEzOjE2OjU4WiJ9fQ=="
}'
Header Parameter
Authorization - Bearer <Token>

Note

To obtain an authorization token, click here.

Request Parameter

These parameters acts as filters based on which the result is fetched.

Parameter Name

Data Type

Description

Required/ Optional

startDate

Date

Fetch conversations from this date. Format:  yyyy-MM-dd HH:mm:ss

Required

endDate

Date

Fetch conversations until this date.  Format:  yyyy-MM-dd HH:mm:ss

Required

agentId

Number

Fetch conversations for the given Agent ID.

Optional

direction

String

Fetch conversations by direction.

Example: Inbound or Outbound

Optional

organizationNodeId

String

Fetch conversations for the given Organization name.

Optional

language

String

Fetch conversations in the given language.

Optional

processingStatus

Text

Fetch conversations by Processing Status. The available processing statuses are INITIATED, IN_PROGRESS, FAILED, and COMPLETED.

Optional

pagetoken

Boolean

Token used to fetch subsequent responses.

Not required on the first request, but needed for subsequent requests.

If not passed in subsequent requests, the first 10 records are fetched.

Optional

pageSize

Number

Number of records per page, allowed up to 500. If not specified, the default is 10.

Optional

Sample Request
{

    "startDate": "2024-04-29 18:30:00",
    "endDate": "2024-06-04 18:30:00",
    "direction": "",
    "organizationNodeId": "",
    "agentId": "",
    "language": "en-us",
    "processingStatus": "",
    "pageSize": 10,
    "pageToken": ""

}
Sample Response

Response contains the conversations that match the filter condition given in the request.

{
    "code": 200,
    "message": "SUCCESS",
    "data": {
        "conversations": [
            {
                "sessionId": "504f2a53-db3a-42a9-a8f8-bf5ca4befc85",
                "conversationId": "f5f46f4f-d44a-4712-a8dd-c5e97b7dbc"
            },
            {
                "sessionId": "416b1630-fadb-4d0a-a65a-b158fd87af19",
                "conversationId": "7ca62368-eb53-41fc-9d9a-19a23d3f4f"
            },
            {
                "sessionId": "a556bf59-52e1-41fc-ad47-946675aadd54",
                "conversationId": "21da20c7-abf3-4eec-bab0-7368e8c689"
            },
            {
                "sessionId": "38abd809-dcf3-4ac5-b215-bf4e5f2b7722",
                "conversationId": "fabed474-b533-436d-acae-ddc8cfe53b"
            },
            {
                "sessionId": "b0cd7ec9-9186-443b-8d8b-1ca1767d8895",
                "conversationId": "f5b287e7-01f5-48f2-9174-66c9d0ae4e"
            },
            {
                "sessionId": "d8a45733-c972-4ec1-ad40-6fb51b831c5f",
                "conversationId": "f057748c-5e19-42f0-854b-c79cbf0fa4"
            }
        ],
        "pageSize": 10,
        "pageToken": "eyJwYWdlX3NpemUiOjEwLCJjaGVja19zdW0iOlsxMDUsMjM1J0ZW5hbnRfaWQiOiIxNWJiMTA3ZS0wYzViLTQ0YmUtODRlMS01ZjI3NjExMTU4M2EiLCJjb252ZXJzYXRpb25faWQiOiJiODIzNDA3Zi1hYmJhLTRkOGItYWFhMi04NzE5MGFiY2FhNWUiLCJ0b3RhbF9jb3VudCI6MTEyLCJmaWx0ZXJfdmFsdWVzIjp7IjQiOiIyMDI0LTA2LTI1VDA5OjQxOjA1WiJ9fQ==",
        "totalPages": 12,
        "totalRecords": 112
    }
}
Response and Error Codes

Response Code

Condition

Description

200

OK

Display the number of records based on the filter values.

400

Bad Request

Invalid Request Body. Check the Request Body parameters.

401

UnAuthorized

Invalid token or invalid signature received for JSON Web Token validation.

429

Too Many Requests

The user has sent too many requests in a given amount of time (“rate limiting”).

Check the X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.

500

Internal Server Error

The server encountered an unexpected error that prevented it from fulfilling the request.