Inconsistent Analytics API call

I am trying to create a Genesys data action that takes in a time interval, email subject, and sender address then outputs the conversation ID(s). I thought I had it working, but in my testing with my own emails that I send to one of our business emails, I don't get any results back with my data action.

I'm using /api/v2/analytics/conversations/details/query with the following request body:

{
  "interval": "${input.INTERVAL}",
  "order": "asc",
  "orderBy": "conversationStart",
   "paging":
   {
      "pageSize": 50
   },
  "segmentFilters": [
    {
      "type": "and",
      "predicates": [
        {
          "type": "dimension",
          "dimension": "mediaType",
          "operator": "matches",
          "value": "email"
        },
        {
          "type": "dimension",
          "dimension": "subject",
          "operator": "matches",
          "value": "${input.SUBJECT}"
        },
        {
          "type": "dimension",
          "dimension": "addressFrom",
          "operator": "matches",
          "value": "${input.SENDER}"
        }
      ]
    }
  ]
}

When I try to query for an email that I know took place at our contact center, it shows up in the response, but when I send an email to our testing email address, it wont show up in my query: {"totalHits": 0}. If I look up the conversation ID it shows up, but even using the information from /api/v2/conversations/emails/${input.conversationid}, it won't show up in my query above. The weirdest thing is that if I use the same information in the Genesys developer tools IT WORKS. It seems that the only time it doesn't work is when I use the data action (not the developer tool), and I send the email myself to our test email.

Please let me know if you have any idea what the difference might be that is causing this inconsistency!

This sounds like an issue with your configuration of divisions in your org. The dev tools on the dev center are authorized by your user and the data actions are authorized by client credentials. Check the configuration of your user compared with the client credentials you're using for the data action to ensure they have the same permissions (roles) and divisions assigned.

If you're unable to resolve this discrepancy, opening a case with Genesys Cloud Care will allow them to investigate the request in context of the data in your org; we do not have access to that information via the forum.

Divisions was the issue. I assigned all divisions to the role of the OAuth configuration and it worked!

Thanks for your help!

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