Querying conversations to get "attributes"

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

  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.

  2. 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.

  3. 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

1 Like

Hi Eos,

Thank you for your response.

  1. I will give this a shot
  1. We are not looking for real-time information. However, it's good to know that this option is available.
  1. The preview API returns a "not.implemented" response.

Regards,
Puneeth

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

Hi Tim,

Let me confirm with my manager.

Thanks and Regards,
Puneeth

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."

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.

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.

Hi Tim

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.

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

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.

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"
			}
		}
	]
}

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