Legacy Dev Forum Posts

 View Only

Sign Up

Querying conversations to get "attributes"

  • 1.  Querying conversations to get "attributes"

    Posted 06-05-2025 18:06

    puneeth | 2022-04-28 07:46:41 UTC | #1

    Hi All,

    Every day our end-users log 2000 calls. So we have to hit the "/api/v2/conversations/{conversationId}" endpoint at least 2000 times and extract the "attributes" from the JSON response. This process is time and resource-consuming. Could you please let us know if any endpoints are available to query conversations that have "attributes" in their JSON response?

    Regards, Puneeth


    Eos_Rios | 2022-04-28 11:35:38 UTC | #2

    1. If you do not need them in real time you can obtain them in bulk from:

    POST /api/v2/analytics/conversations/details/jobs But they may not be available before 6 am the next day depending on processing.

    1. If you need them in real time your only options are the one you are currently using, or creating a websocket listener and subscribing to the queues you want to capture from. You will get the same conversation multiple times from that listener and require a dedicated server to be running it, so obvious drawbacks.
    2. There is a preview API for Attribute searches, that depending on your needs may or may help. It has significant limits. POST /api/v2/conversations/participants/attributes/search

    puneeth | 2022-04-28 13:23:16 UTC | #3

    Hi Eos,

    Thank you for your response.

    1. I will give this a shot

    quote="Eos_Rios, post:2, topic:14495"] If you do not need them in real time you can obtain them in bulk from: [POST /api/v2/analytics/conversations/details/jobs But they may not be available before 6 am the next day depending on processing. [/quote]

    1. We are not looking for real-time information. However, it's good to know that this option is available.

    quote="Eos_Rios, post:2, topic:14495"] There is a preview API for Attribute searches, that depending on your needs may or may help. It has significant limits. [POST /api/v2/conversations/participants/attributes/search [/quote]

    1. The preview API returns a "not.implemented" response.

    Eos_Rios, post:2, topic:14495
    If you need them in real time your only options are the one you are currently using, or creating a websocket listener and subscribing to the queues you want to capture from. You will get the same conversation multiple times from that listener and require a dedicated server to be running it, so obvious drawbacks.

    Regards, Puneeth


    tim.smith | 2022-04-28 13:24:10 UTC | #4

    puneeth, post:3, topic:14495
    The preview API returns a "not.implemented" response.

    Preview resources aren't generally available. Please open a case with Genesys Cloud Care if you'd like to request access to the beta.


    puneeth | 2022-04-28 13:32:32 UTC | #5

    Hi Tim,

    Let me confirm with my manager.

    Thanks and Regards, Puneeth


    puneeth | 2022-04-28 14:34:39 UTC | #6

    I am a bit confused. Does the analytics endpoint return the "attributes" key in the JSON?

    The JSON response from "/api/v2/conversations/{conversationId}" does contain "attributes - (Map<string, string>) Additional participant attributes."


    tim.smith | 2022-04-28 14:40:16 UTC | #7

    puneeth, post:6, topic:14495
    Does the analytics endpoint return the "attributes" key in the JSON?

    Which endpoint are you referring to? There are many analytics endpoints that return conversation data. The answer is different depending on which one you're talking about. Analytics jobs have attribute data. Non-job queries don't.

    puneeth, post:6, topic:14495
    The JSON response from "/api/v2/conversations/{conversationId}" does contain "attributes

    That resource does contain attribute data, but it is not suitable for your use case (bulk data retrieval). It also only has conversation data for 60 days; after that it's only available via analytics resources. The purpose of this endpoint is for applications to use while working with live/recent conversations on an individual basis. That usually means apps like an agent's desktop app.


    puneeth | 2022-04-28 14:51:42 UTC | #8

    Hi Tim

    tim.smith, post:7, topic:14495
    Which endpoint are you referring to? There are many analytics endpoints that return conversation data. The answer is different depending on which one you're talking about. Analytics jobs have attribute data. Non-job queries don't.

    I was referring to POST /api/v2/analytics/conversations/details/jobs endpoint. I tried the following query

    { "conversationFilters": [ { "predicates": [ { "type": "property", "operator": "matches", "value": "attributes" } ], "type": "or" } ], "interval": "2022-04-27T18:30:00.000Z/2022-04-28T18:30:00.000Z" }

    The response is as below.

    { "message": "property filters not supported", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "7f053d87-486d-454d-a129-0fea78f3cc7c", "details": [], "errors": [] }

    Please feel free to correct my query.


    tim.smith | 2022-04-28 14:55:47 UTC | #9

    As the error response says, you can't filter for properties. You may wish to try the Analytics Query Builder for a more guided experience: https://developer.genesys.cloud/developer-tools/#/analytics-query-builder


    tim.smith | 2022-04-28 14:59:59 UTC | #10

    puneeth, post:1, topic:14495
    query conversations that have "attributes" in their JSON response?

    I believe you meant you want to filter the query in this way. That's not possible. Your app must retrieve conversations via things you can filter for and then refine the results based on attribute data as post-processing within the app.


    puneeth | 2022-04-28 15:16:07 UTC | #11

    Ok, I get it. So we will implement the change to request the endpoint in a loop.

    Following is a sample, and we wanted to filter all conversations containing the "attribute" property. Note: I have removed identifiers and some data to keep the example relevant.

    { "conversatoinId": "someconverstionid", "participants": [ { "attributes": { "scriptId": "564cfed6-75ee-473c-9aa9-792a90e67a80", "abandonMilliseconds": "2000", "dialerContactId": "c436bed8fae534da1e86af6252e9fdf5", "dialerContactListId": "901a6d20-0beb-4a10-a352-ae132a973c59", "dialerCampaignId": "fde18390-86cc-453b-bc90-32d4192b1484", "dialerInteractionId": "1183ca73-b314-4257-9910-16eab39d20f1" } }, { "attributes": { "scriptId": "564cfed6-75ee-473c-9aa9-792a90e67a80", "abandonMilliseconds": "2000", "dialerContactId": "c436bed8fae534da1e86af6252e9fdf5", "dialerContactListId": "901a6d20-0beb-4a10-a352-ae132a973c59", "dialerCampaignId": "fde18390-86cc-453b-bc90-32d4192b1484", "dialerInteractionId": "1183ca73-b314-4257-9910-16eab39d20f1" } }, { "attributes": { "scriptId": "564cfed6-75ee-473c-9aa9-792a90e67a80", "abandonMilliseconds": "2000", "dialerContactId": "c436bed8fae534da1e86af6252e9fdf5", "dialerContactListId": "901a6d20-0beb-4a10-a352-ae132a973c59", "dialerCampaignId": "fde18390-86cc-453b-bc90-32d4192b1484", "dialerInteractionId": "1183ca73-b314-4257-9910-16eab39d20f1" } } ] }


    system | 2022-05-29 15:16:43 UTC | #12

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 14495