Legacy Dev Forum Posts

 View Only

Sign Up

Async conversation details with segment End as filtering criteria FAILS

  • 1.  Async conversation details with segment End as filtering criteria FAILS

    Posted 06-05-2025 18:03

    RomanSmoll | 2022-06-13 16:03:25 UTC | #1

    Hello.

    Here are 2 more or less relevant forum questions : Question and Question it relates to

    Description we are running the query to pick up conversations SYNCHRONOUSLY and ASYNCHRONOUSLY for comparison.

    Please correct us if we're wrong,

    • With sync we can call any data in the past (apart archive limitations) and get data same quality as if we have requested it for the same day we are extracting it.
    • With Async data is more complete and with attributes (directly in a bulk) + some naming differences. Overall fuller data BUT available only 24 hours past the end of the day it requested for.

    With this in mind we thought that querries that are OK sync should be OK async. Apparently not.

    • In general conversation Details query, if requested by interval and, for example "mediatype" as segment Filter and interval being 1 day -> Sync and Async(if possible) work. both give results. Job executes fine also
    • if you add condition segmentEnd matches same day as the interval : Sync works with no problems and Async job FAILS.

    Can you please comment on how it is possible ? we ran other tests replacing segmentEnd with wrapup - exists : sync and async both OK Segment End , that we need to make do async as well does not want to provide us as it says querry has some sort of cunfusion

    Thanks in Advance Roman


    tim.smith | 2022-06-13 20:07:25 UTC | #2

    RomanSmoll, post:1, topic:15128
    we are running the query to pick up conversations SYNCHRONOUSLY and ASYNCHRONOUSLY for comparison.

    I'm not sure what you mean. All requests to the Genesys Cloud CX Public API are synchronous; we do not use long polling or other asynchronous technologies for making REST requests to the API. Can you explain what you are referring to as synchronous and asynchronous?


    RomanSmoll | 2022-06-14 07:21:54 UTC | #3

    Hello Tim I am talking about API explorer

    You have the option to use "query for conversation details" which gives you results straight and in pages and you can post a request to get a jobId and when status is Fullfilled you pull results with cursor. In Genesys it is called "post query for conversation details asynchronously"

    When you fetch results with JobId and Cursor, data is more whole (attributes etc) but the query i described with SegmentEnd works for sync and is supposed to work with JobId as well, but it Fails. it works without segmentEnd though. and it also works if I replace segmentEnd with Wrapup exist for example, but this is not the goal here.

    With best regards


    tim.smith | 2022-06-14 12:45:59 UTC | #4

    It sounds like you're referring to POST /api/v2/analytics/conversations/details/query as "synchronous" and POST /api/v2/analytics/conversations/details/jobs as "asynchronous". Correct? Those things are called Conversation Detail queries and Conversation Detail jobs, respectively.

    RomanSmoll, post:3, topic:15128
    the query i described with SegmentEnd works for sync and is supposed to work with JobId as well, but it Fails.

    Can you provide some information on this failure? What is the request body you're sending? What exactly is happening when it "fails"? Can you provide the correlation ID from the response?


    RomanSmoll | 2022-06-15 12:19:58 UTC | #5

    Hello TIm Yes, that is exactly right. thank you for correcting me, will use proper names next time :slight_smile:

    So, for the querries, consider the following :

    {
     "interval": "2022-02-01T23:00:00.000Z/2022-02-02T23:00:00.000Z",
     "order": "asc",
     "orderBy": "conversationStart",
     "paging": {
      "pageSize": 25,
      "pageNumber": 1
     },
     "segmentFilters": [
      {
       "type": "and",
       "clauses": [
    {
     "type": "or",
     "predicates": [
      {
       "type": "dimension",
       "dimension": "mediaType",
       "operator": "matches",
       "value": "email"
      },
      {
       "type": "dimension",
       "dimension": "mediaType",
       "operator": "matches",
       "value": "voice"
      }
     ]
    },
    {
     "type": "and",
     "predicates": [
      {
       "type": "dimension",
       "dimension": "segmentEnd",
       "operator": "matches",
       "value": "2022-02-01T23:00:00.000Z/2022-02-02T23:00:00.000Z"
      }
     ]
    }
       ]
      }
     ]
    }

    We have 2 conditions here in SegmentFilters:

    • Mediatype filtering
    • SegmentEnd matching full day of the end interval of the query.

    If we run it as conversation details query : Everything is OK if we run it as Conversation Detail Job : JobId is given : no problem, But when I check the status of the job, it says :

    {
      "state": "FAILED",
      "errorMessage": "The executed query encountered an unexpected error",
      "submissionDate": "2022-06-15T12:18:37.378Z"
    }

    PS if we take segmentEnd from the query or if we replace it by wrapup - exists, it works async With best regards. Roman


    tim.smith | 2022-06-15 16:01:14 UTC | #6

    segmentEnd is documented as a valid dimension for an analytics job predicate and it does expect an interval as you have in your query. Please open a case with Genesys Cloud Care to invesigate the unexpected error as your request should be valid as far as I can tell.


    RomanSmoll | 2022-06-17 08:32:02 UTC | #7

    Hello Tim Yes, indeed we were convinced that this query is valid on our side. We will raise the ticket then.

    Just to confirm a few points then in order to close this question:

    • With sync we can call any data in the past (apart archive limitations) and get data same quality as if we have requested it for the same day we are extracting it.
    • With Async data is more complete and with attributes (directly in a bulk) + some naming differences. Overall fuller data BUT available only 24 hours past the end of the day it requested for.

    This info is correct, right ? Thanks in advance


    tim.smith | 2022-06-20 10:27:57 UTC | #8

    Analytics queries and jobs offer exactly the same data, with these caveats:

    • jobs contain participant attributes but queries don't
    • jobs data is subject to the data availability timeframe, queries can return data from all time up to real-time

    See the links to queries and jobs posted above for additional information.


    RomanSmoll | 2022-06-20 10:28:53 UTC | #9

    Thank you :)

    our tests proved the same but written confirmation is always more valuable in the dev team argument :slight_smile:


    system | 2022-07-21 10:29:11 UTC | #10

    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: 15128