nlabiad | 2019-10-07 18:15:41 UTC | #1
does anyone have a good example of downloading some view data to csv daily using powershell? I'm looking to create something like the Interaction Details Report but to automate it
This is what i started: { "name": "test", "timeZone": { "displayName": "", "id": "America/Phoenix", "rawOffset": 0, "dstsavings": 0 }, "exportFormat": "CSV", "interval": "", "period": "TODAY", "viewType": "AGENTINTERACTIONDETAIL_VIEW", "filter": { "mediaTypes": ["Voice"], "queueIds": [], "skillIds": [], "skillGroups": [], "languageIds": [], "languageGroups": [], "directions": [], "originatingDirections": [], "wrapUpCodes": [], "dnisList": [], "sessionDnisList": [], "filterQueuesByUserIds": [], "filterUsersByQueueIds": [], "userIds": [], "addressTos": [], "addressFroms": [], "outboundCampaignIds": [], "outboundContactListIds": [], "contactIds": [], "aniList": [], "durationsMilliseconds": [ { "gt": {}, "gte": {}, "lt": {}, "lte": {} } ], "evaluationScore": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "evaluationCriticalScore": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "evaluationFormIds": [], "evaluatedAgentIds": [], "evaluatorIds": [], "transferred": true, "abandoned": true, "messageTypes": [], "divisionIds": [], "surveyFormIds": [], "surveyTotalScore": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "surveyNpsScore": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "showSecondaryStatus": true, "agentDurationSortOrder": "", "waitingDurationSortOrder": "", "interactingDurationSortOrder": "", "agentName": "", "skillsList": [], "languageList": [], "mos": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "surveyQuestionGroupScore": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "surveyPromoterScore": { "gt": {}, "gte": {}, "lt": {}, "lte": {} }, "surveyFormContextIds": [], "conversationIds": [], "sipCallIds": [], "isEnded": true, "isSurveyed": true, "surveyScores": [ { "gt": {}, "gte": {}, "lt": {}, "lte": {} } ], "promoterScores": [ { "gt": {}, "gte": {}, "lt": {}, "lte": {} } ], "isCampaign": true, "surveyStatuses": [], "conversationProperties": { "isWaiting": true, "isActive": true, "isAcd": true, "isPreferred": true, "isScreenshare": true, "isCobrowse": true, "isVoicemail": true, "isFlagged": true, "filterWrapUpNotes": true, "matchAll": true }, "isBlindTransferred": true, "isConsulted": true, "isConsultTransferred": true, "remoteParticipants": [], "statusList": [], "flowIds": [], "flowOutcomeIds": [], "flowOutcomeValues": [], "flowDestinationTypes": [], "flowDisconnectReasons": [], "flowTypes": [], "flowEntryTypes": [], "flowEntryReasons": [], "flowVersions": [], "groupIds": [], "hasJourneyCustomerId": true, "hasJourneyActionMapId": true, "hasJourneyVisitId": true, "oauthClientIds": [], "apiOperations": [] }, "read": true, "locale": "en-us", "hasFormatDurations": true }
tim.smith | 2019-10-07 20:34:43 UTC | #2
Not powershell, but there's an open source node.js project that demonstrates this concept and could be adapted to fit your data requirements and be invoked from a powershell script. https://github.com/MyPureCloud/open-data-exporter
Maisey_Harris | 2019-10-11 02:21:13 UTC | #3
The API docs need to be updated to reflect what is actually required, but from your request, make the following changes:
- remove period, it does not apply to this export type
- add an interval
- remove all the empty filters and note that many of them like showSecondaryStatus don't apply
- remove read
I suspect interval specifically is what's causing your issue though.
nlabiad | 2019-10-18 22:40:57 UTC | #4
https://developer.mypurecloud.com/developer-tools/#/api-explorer Thank you, I changed it to:
{ "name": "test", "timeZone": { "displayName": "", "id": "America/Phoenix", "rawOffset": 0, "dstsavings": 0 }, "exportFormat": "CSV", "interval": "2019-10-17T12:00:00/2019-10-18T12:00:00", "viewType": "AGENTINTERACTIONDETAIL_VIEW", "filter": { "mediaTypes": ["Voice"],
"locale": "en-us", "hasFormatDurations": true }}
Still having same error...
tim.smith | 2019-10-22 13:43:48 UTC | #5
Please provide a correlation ID from the response.
nlabiad | 2019-10-22 14:23:53 UTC | #6
inin-correlation-id
f0bf6b96-613e-4ddc-b1e0-6b200ebabacb
tim.smith | 2019-10-22 14:48:22 UTC | #7
The error is:
Can not deserialize instance of java.util.TimeZone out of START_OBJECT token
I believe the docs are incorrect here. Try a timezone string (a TZ database name such as America/Denver) for the timeZone property instead of an object.
nlabiad | 2019-10-22 15:04:36 UTC | #8
Like this? It doesn't work for me either. Would it be possible for you to send me a working example? { "name": "test", "timeZone": { "displayName": "", "id": "America/Denver", "rawOffset": 0, "dstsavings": 0 }, "exportFormat": "CSV", "interval": "2019-10-17T12:00:00/2019-10-18T12:00:00", "viewType": "AGENTINTERACTIONDETAIL_VIEW", "filter": { "mediaTypes": ["Voice"],
"locale": "en-us", "hasFormatDurations": true }}
tim.smith | 2019-10-22 15:07:40 UTC | #9
Like this: timeZone: "America/Denver"
system | 2019-11-21 15:10:19 UTC | #10
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 6179