OpenDataExporter not returning any conversation data; also, Platform API Endpoint /api/v2/conversations/calls/history not returning any data

Hello,
We are trying to use OpenDataExporter to get participant data values. Similarly to the other post in the Developer forum on this topic, we are getting the error:

loading config from ./examples/call_detail_report/config.json
Initializing logger for api at level silly
Initializing logger for TemplateDefinitions at level silly
Initializing logger for executor at level silly
debug: [TemplateDefinitions] Loading standard module "dataOperations" from dataOperations.js
debug: [TemplateDefinitions] Loading standard module "datetimeOperations" from datetimeOperations.js
Initializing logger for main at level silly
verbose: [executor] Configuration successfully dereferenced
verbose: [executor] Executor initialized
info: [main] /runnow flag was used, commencing single execution of jobs...
debug: [executor] Executing job: CDR job at Thu Dec 02 2021 11:08:22 GMT-0600 (Central Standard Time)
Initializing logger for job:CDR job at level silly
debug: [TemplateDefinitions] Loading standard module "dataOperations" from dataOperations.js
debug: [TemplateDefinitions] Loading standard module "datetimeOperations" from datetimeOperations.js
debug: [TemplateDefinitions] Loading standard module "dataOperations" from dataOperations.js
debug: [TemplateDefinitions] Loading standard module "datetimeOperations" from datetimeOperations.js
debug: [job:CDR job] Loading module to def.cdr_module from ./examples/call_detail_report/extensions.js
verbose: [job:CDR job] Processing execution plan for CDR Configuration
debug: [job:CDR job] singlecdr_request strategy:
debug: [job:CDR job] request done
verbose: [job:CDR job] Executing transform: {{#def.cdr_module.addSegmentsToParticipant(def.data.cdr_request)}}
verbose: [job:CDR job] Executing transform: {{#def.vars.conversationIds=def.cdr_module.coalesceConversationIds(def.data.cdr_request)}}
debug: [job:CDR job] repeatcdr_conversation_details_request strategy:
verbose: [executor] getconversations complete
debug: [job:CDR job] request done
verbose: [job:CDR job] Executing transform: {{#def.cdr_module.aggregateParticipantAttributes(def.data)}}
verbose: [job:CDR job] Executing transform: {{#def.cdr_module.ensureAttributes(def.data.cdr_request)}}
verbose: [job:CDR job] Executing transform: {{#def.dataOperations.writeData(def.data, '../local/call_detail_report/data.json')}}
debug: [job:CDR job] Execution plan complete
verbose: [job:CDR job] Executing templates...
verbose: [job:CDR job] Executing template: CDR template
verbose: [executor] ./examples/call_detail_report/cdr_template.htmlLoading template from
error: [job:CDR job] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)
error: [executor] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)
error: [executor] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)
error: [main] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)

data.json says:
{
"cdr_request": {
"totalHits": 0
}
}
despite there being calls made into the system.
In trying to troubleshoot this issue, we tried to use the API explorer to get the calls history, with this result for interval 2021-11-30/2021-12-02:
{
"entities": [],
"pageSize": 0,
"pageNumber": 1,
"total": 0,
"firstUri": "/api/v2/conversations/calls/history?pageSize=0&pageNumber=1",
"selfUri": "/api/v2/conversations/calls/history?pageSize=0&pageNumber=1",
"lastUri": "/api/v2/conversations/calls/history?pageSize=0&pageNumber=1",
"pageCount": 0
}

There is no data returned for calls history, despite a call just being made on 2021-12-02. The call made on 2021-12-02 is returned with the API call GET/api/v2/conversations/calls/453da577-0034-4eee-8556-9abaa4621fb6

Thanks for any suggestions on this topic.

1 Like

Hello,

The API request (GET/api/v2/conversations/calls/history) is only to get the calls for the authenticated user.
If you want different set of calls in the system (received by other users), or make a query with a Client Credentials grant (as you are not using a user account to authenticate in this case), you would need to submit a query for conversation details (POST /api/v2/analytics/conversations/details/query).

Regards,

Hello,
Thanks. I used POST /api/v2/analytics/conversations/details/query
with json:
{ "interval": "2021-11-30/2021-12-02",
"paging": {
"pageSize": 25,
"pageNumber": 1
}
}
and this resulted in 200 OK with results beginning with:
{
"conversations": [
{
"conversationEnd": "2021-11-30T13:48:29.674Z",
"conversationId": "9a2ffbd0-dd9e-4823-b539-dbd1a165a8b1",
"conversationStart": "2021-11-30T13:46:50.285Z",
"divisionIds": [

However, the OpenDataExporter is still not returning any conversations. Since the conversations details query is returning results with a direct API query, I checked if the conversations detail query in api.js (part of OpenDataExporter) is working, and it is not returning any results:

loading config from ./examples/cdr_report/config.json
Initializing logger for api at level silly
Initializing logger for TemplateDefinitions at level silly
Initializing logger for executor at level silly
debug: [TemplateDefinitions] Loading standard module "dataOperations" from dataOperations.js
debug: [TemplateDefinitions] Loading standard module "datetimeOperations" from datetimeOperations.js
Initializing logger for main at level silly
verbose: [executor] Configuration successfully dereferenced
verbose: [executor] Executor initialized
info: [main] /runnow flag was used, commencing single execution of jobs...
debug: [executor] Executing job: CDR job at Fri Dec 03 2021 11:58:30 GMT-0600 (Central Standard Time)
Initializing logger for job:CDR job at level silly
debug: [TemplateDefinitions] Loading standard module "dataOperations" from dataOperations.js
debug: [TemplateDefinitions] Loading standard module "datetimeOperations" from datetimeOperations.js
debug: [TemplateDefinitions] Loading standard module "dataOperations" from dataOperations.js
debug: [TemplateDefinitions] Loading standard module "datetimeOperations" from datetimeOperations.js
debug: [job:CDR job] Loading module to def.cdr_module from ./examples/call_detail_report/extensions.js
verbose: [job:CDR job] Processing execution plan for CDR Configuration
debug: [job:CDR job] singlecdr_request strategy:
!result
debug: [job:CDR job] request done
verbose: [job:CDR job] Executing transform: {{#def.cdr_module.addSegmentsToParticipant(def.data.cdr_request)}}
verbose: [job:CDR job] Executing transform: {{#def.vars.conversationIds=def.cdr_module.coalesceConversationIds(def.data.cdr_request)}}
debug: [job:CDR job] repeatcdr_conversation_details_request strategy:
verbose: [executor] getconversations complete
debug: [job:CDR job] request done
verbose: [job:CDR job] Executing transform: {{#def.cdr_module.aggregateParticipantAttributes(def.data)}}
verbose: [job:CDR job] Executing transform: {{#def.cdr_module.ensureAttributes(def.data.cdr_request)}}
verbose: [job:CDR job] Executing transform: {{#def.dataOperations.writeData(def.data, '../local/call_detail_report/data.json')}}
debug: [job:CDR job] Execution plan complete
verbose: [job:CDR job] Executing templates...
verbose: [job:CDR job] Executing template: CDR template
verbose: [executor] ./examples/call_detail_report/cdr_template.htmlLoading template from
error: [job:CDR job] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)
error: [executor] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)
error: [executor] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)
error: [main] TypeError: Cannot read property 'length' of undefined
at CDR.countArray (C:\SurveyToArchitect\open-data-exporter-master\src\examples\call_detail_report\extensions.js:23:13)
at eval (eval at (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:12), :3:23)
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:83:49
at String.replace ()
at resolveDefs (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:74:4)
at Object.doT.template (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\dot\doT.js:95:33)
at executeTemplate (C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:269:21)
at C:\SurveyToArchitect\open-data-exporter-master\src\executor.js:206:18
at C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:4967:15
at baseForOwn (C:\SurveyToArchitect\open-data-exporter-master\src\node_modules\lodash\lodash.js:3032:24)

As you can see, the console.log("!result") I put in api.js is printing on the console.

from api.js:

let startTime = new moment();

    _this.analyticsApi.postAnalyticsConversationsDetailsQuery(JSON.stringify(request.body))

        .then(function(result){

            if (config.args.debugapi === true) {

                log.verbose('Request "postConversationsDetailsQuery" completed in ' + moment().diff(startTime, new moment()) + ' ms');

                console.log("config.args.debugapi===true");

            }

            if (!results) {

                results = result;

                console.log("!result");

            } else {

                if (result.conversations)

                    results.conversations = results.conversations.concat(result.conversations);

            }

            if (request.getAllPages === true && result.conversations) {

                request.body.paging.pageNumber++;

                log.verbose('Getting more data from postConversationsDetailsQuery page ' + request.body.paging.pageNumber + ' (current conversation count: ' + results.conversations.length + ')');

                _this.postConversationsDetailsQuery(request, _this, deferred, results);

                //console.log(result.conversations)

            } else {

                deferred.resolve(results);

            }

        })

        .catch(function(error){

            log.debug(error.status, 'status: ');

            try {

                if (retryOnError(error,

                    function(){_this.postConversationsDetailsQuery(request, _this, deferred, results);}))

                    return;

                log.error(error);

                deferred.reject(error);

            } catch(e) {

                log.error(e.stack);

                deferred.reject(e);

            }

        });

    return deferred.promise;

};

Thanks in advance for any suggestions.

Hello,

I have not used the Open Data Exporter myself.

But not knowing what you have configured in your ./examples/cdr_report/config.json does not allow to say much.
Or what roles/permissions you have assigned to your OAuth Client, and if these roles are enabled for the divisions in which the calls took place.

Regards,

hello,
all available roles have been assigned to the OAuth client, including communicate-admin, admin, and Developer. What do you mean by permissions for the OAuth client? The roles are enabled for the Home division, and the architect flows of interest with the conversations of interest are in the Home division.

here is ./examples/call_detail_report/config.json
{

  "pureCloud": {

    "clientId": "",

    "clientSecret": "",

    "timeout": 10000,

    "environment": "https://api.mypurecloud.com"

  },

  "requests": {

    "cdr_request": {

      "name": "calls request",

      "type": "conversationDetail,

      "strategy": "single",

      "getAllPages": true,

      "body": {

        "interval": "{{#def.vars.previousInterval}}",

        "order": "asc",

        "orderBy": "conversationStart",

        "paging": {

          "pageSize": 100,

          "pageNumber": 1

        },

        "segmentFilters": [

          {

            "type": "or",

            "clauses": [

              {

                "type": "and",

                "predicates": [

                  {

                    "type": "dimension",

                    "dimension": "purpose",

                    "operator": "matches",

                    "value": "acd"

                  },

                  {

                    "type": "dimension",

                    "dimension": "mediaType",

                    "operator": "matches",

                    "value": "voice"

                  }

                ]

              }

            ]

          }

        ]

      }

    },

    "cdr_conversation_details_request": {

      "name": "Conversation details request",

      "type": "getConversation",

      "strategy": "repeat",

      "collection": "def.vars.conversationIds"

    }

  },

  "transforms": {

    "cdr_segment_data_transform": {

      "name": "CDR Segment Data transform",

      "type": "transform",

      "expressions": [

        "{{#def.cdr_module.addSegmentsToParticipant(def.data.cdr_request)}}"

      ]

    },

    "cdr_coalesce_conversation_ids_transform": {

      "name": "CDR coalesce conversation IDs",

      "type": "transform",

      "expressions": [

        "{{#def.vars.conversationIds=def.cdr_module.coalesceConversationIds(def.data.cdr_request)}}"

      ]

    },

    "cdr_aggregate_participant_attributes_transform": {

      "name": "CDR aggregate participant attributes",

      "type": "transform",

      "expressions": [

        "{{#def.cdr_module.aggregateParticipantAttributes(def.data)}}"

      ]

    },

    "cdr_ensure_attributes_transform": {

      "name": "CDR ensure attributes",

      "type": "transform",

      "expressions": [

        "{{#def.cdr_module.ensureAttributes(def.data.cdr_request)}}"

      ]

    },

    "write_data": {

      "name": "write_data",

      "type": "transform",

      "expressions": [

        "{{#def.dataOperations.writeData(def.data, '../local/call_detail_report/data.json')}}"

      ]

    }

  },

  "templates": {

    "cdr_template": {

      "name": "CDR template",

      "templateFile": "./examples/call_detail_report/cdr_template.html",

      "fileName": "cdr_{{#def.datetimeOperations.formatDate(def.vars.date,'YYYY_MM_DD_HH.mm.SSS')}}.html"

    }

  },

  "exports": {

    "cdr_export": {

      "name": "CDR file export",

      "type": "file",

      "destination": "../local/call_detail_report/"

    }

  },

  "configurations": {

    "cdr_config": {

      "name": "CDR Configuration",

      "externalModules": {

        "cdr_module": "./examples/call_detail_report/extensions.js"

      },

      "executionPlan": {

        "cdr_request": {

          "$ref": "#/requests/cdr_request"

        },

        "cdr_segment_data_transform": {

          "$ref": "#/transforms/cdr_segment_data_transform"

        },

        "cdr_coalesce_conversation_ids_transform": {

          "$ref": "#/transforms/cdr_coalesce_conversation_ids_transform"

        },

        "cdr_conversation_details_request": {

          "$ref": "#/requests/cdr_conversation_details_request"

        },

        "cdr_aggregate_participant_attributes_transform": {

          "$ref": "#/transforms/cdr_aggregate_participant_attributes_transform"

        },

        "cdr_ensure_attributes_transform": {

          "$ref": "#/transforms/cdr_ensure_attributes_transform"

        },

        "write_data": {

          "$ref": "#/transforms/write_data"

        }

      },

      "templates": {

        "cdr_template": {

          "$ref": "#/templates/cdr_template"

        }

      },

      "exports": {

        "cdr_export": {

          "$ref": "#/exports/cdr_export"

        }

      },

      "customData": {

        "interval": "PT1H"

      }

    }

  },

  "jobs": {

    "cdr_job": {

      "name": "CDR job",

      "configurations": {

        "cdr_config": {

          "$ref": "#/configurations/cdr_config"

        }

      },

      "cron": "* * * * * *",

      "customData": {}

    }

  },

  "customData": {

    "company": "Genesys"

  }

}

except that clientId and clientSecret are populated. thanks and regards.

Hello,

I've just run the Open Data Exporter Call Detail Report and it is working fine for me.
With one exception - there seems to be an issue, if there is only one conversation returned by the conversation details query.

It should not change anything but before running my test and doing an npm install, I have updated the "purecloud-platform-client-v2" to "*" in scr/package.json (to use latest version of the Platform API Node/Javascript SDK).

Two things that may be useful to clarify on the Exporter tool.

Based on your config.json (and the one I also used in src/examples/call_detail_report/config.json), the script will perform a conversation details query with some segment filters set.
It will look for conversations of voice media type (mediaType = voice) where an ACD Queue was involved at some stage of this call (purpose = acd) - i.e. ACD calls (voice conversations)
That's the query body that the script is sending:

{
 "interval": "THE INTERVAL VALUE",
 "order": "asc",
 "orderBy": "conversationStart",
 "paging": {
  "pageSize": 25,
  "pageNumber": 1
 },
 "segmentFilters": [
  {
   "type": "or",
   "clauses": [
    {
     "type": "and",
     "predicates": [
      {
       "type": "dimension",
       "dimension": "mediaType",
       "operator": "matches",
       "value": "voice"
      },
      {
       "type": "dimension",
       "dimension": "purpose",
       "operator": "matches",
       "value": "acd"
      }
     ]
    }
   ]
  }
 ]
}

The second thing relates to the requested interval.
I am not familiar with the Open Data Exporter - first time I use it - but with the interval you have configured in your config.json file ("interval": "{{#def.vars.previousInterval}}"), I believe that the interval used for the query for Conversation Details will just correspond to the previous hour (I mean that if you run the script when it is 10:15, it will query ACD calls that happened between 9:00 and 10:00).

So there are different things you can do to troubleshoot and find if your issue is with the OAuth Client assigned roles, or if it is with the conversation details query interval and segment filters.

You can run the script with debugapi argument/parameter, and it will display the HTTP Request Body and Response Body.
e.g.: node ./index.js /debugapi=true /config=./examples/call_detail_report/config.json /jobs=cdr_job /RunNow
This will help you check what the requested query interval is - and perform the same query with your user account using the API Explorer (using the same interval and the same segment filters).
You can modify or remove the segment filters as you need (in src/examples/call_detail_report/config.json) - e.g. remove the purpose = acd filter if you want to see ACD and non-ACD calls.

As I didn't have time to explore the tool and check how I could control the interval, I have just put a static value in my src/examples/call_detail_report/config.json (in requests.cdr_request.body.interval).

The different filters and interval than the one you used in your API Explorer might explain why the script was not retrieving these conversations.

If, after using the same interval and segment filters, your API Explorer returns conversations when the script doesn't, you might want to check roles assigned to the OAuth Client.
I usually use Postman for this - so I can request an OAuth Client Credentials Grant access token and test the API request with the roles of my OAuth Client.

Regards,

Thank you so much!! The e.g. command:
node ./index.js /debugapi=true /config=./examples/call_detail_report/config.json /jobs=cdr_job /RunNow
you gave was perfect to figure out exactly what the previous interval is. There were two reasons I wasn't getting any conversations:

  1. I didn't realize that that the interval ended at the top of the previous hour, and if fact was running the tool just after I made calls (which was usually not immediately after an hour ended).

  2. The segment filter "purpose" matches "ACD" with type "and" was preventing conversations from being retrieved because the test calls I made are not going to queue.
    I changed the segment filters to type "or" and interval to 15 minutes as follows:
    "customData": {

        "interval": "PT15M"
    
      }
    

    "segmentFilters": [

          {
    
            "type": "or",
    
            "clauses": [
    
              {
    
                "type": "or",
    
                "predicates": [
    
                  {
    
                    "type": "dimension",
    
                    "dimension": "purpose",
    
                    "operator": "matches",
    
                    "value": "acd"
    
                  },
    
                  {
    
                    "type": "dimension",
    
                    "dimension": "mediaType",
    
                    "operator": "matches",
    
                    "value": "voice"
    
                  }
    
                ]
    
              }
    
            ]
    

and the response gives back conversations.

Again, thank you so much for all your help and guidance.

Regards,

1 Like

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