Legacy Dev Forum Posts

 View Only

Sign Up

Outbound campaign detail of hang up

  • 1.  Outbound campaign detail of hang up

    Posted 06-05-2025 18:12

    gpinilla | 2017-06-27 23:14:59 UTC | #1

    Hello friends, I need your help to identify if there is a better way to know who I put (agent or client) in an outbound campaign. I've tried it with / api / v2 / analytics / conversations / details / query but in some conversations the information is incomplete. I have also tried it with / api / v2 / outbound / campaigns / {campaignId} / interactions but the answer is the campaign information. Thank you for your future help.


    tim.smith | 2017-06-28 13:19:55 UTC | #2

    I'm not sure what you mean by "know who I put in an outbound campaign". If you're looking for the call list records, you can export the call list using POST /api/v2/outbound/contactlists/{contactListId}/export and GET /api/v2/outbound/contactlists/{contactListId}/export. If that's not what you're looking for, can you clarify what sort of data you need or what your use case is?


    gpinilla | 2017-06-28 14:24:26 UTC | #3

    tim.smith, post:2, topic:1478, full:true
    I'm not sure what you mean by "know who I put in an outbound campaign". If you're looking for the call list records, you can export the call list using POST /api/v2/outbound/contactlists/{contactListId}/export and GET /api/v2/outbound/contactlists/{contactListId}/export. If that's not what you're looking for, can you clarify what sort of data you need or what your use case is?

    Thanks for your help. I need to get the information on the interactions of an outbound campaign, especially the one who hangs up the call.


    tim.smith | 2017-06-28 14:29:40 UTC | #4

    You can use POST /api/v2/analytics/conversations/details/query to get the details of conversations. Here's an example of how to filter by campaign:

    {
     "interval": "2017-03-01T07:00:00.000Z/2017-04-01T06:00:00.000Z",
     "order": "asc",
     "orderBy": "conversationStart",
     "paging": {
      "pageSize": 25,
      "pageNumber": 1
     },
     "segmentFilters": [
      {
       "type": "or",
       "predicates": [
        {
         "type": "dimension",
         "dimension": "outboundCampaignId",
         "operator": "matches",
         "value": "7fc6b00a-f2f5-44d2-9fc5-169f339f6c4b"
        }
       ]
      }
     ]
    }

    gpinilla | 2017-06-28 15:02:20 UTC | #5

    |I've used that option, but I'm not sure what data should be taken into account. For example with this result:

    {
      "conversations": [
        {
          "conversationId": "3d1db849-5470-416d-9a24-2fba1d615df6",
          "conversationStart": "2017-06-23T00:18:35.534Z",
          "conversationEnd": "2017-06-23T00:20:34.743Z",
          "participants": [
            {
              "participantId": "fcdf6332-69d1-4a1b-9cdd-a04f4e8af4ba",
              "participantName": "National",
              "purpose": "customer",
              "sessions": [
                {
                  "mediaType": "voice",
                  "sessionId": "7d104ee9-7f38-442d-aa07-ac93bdcf4bc1",
                  "ani": "sip:+5935551234@172.40.252.44;user=phone",
                  "direction": "outbound",
                  "dnis": "tel:0984535613",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "edgeId": "4120a651-9ce3-4f5a-b6ef-b16ca50eb8df",
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T00:17:43.187Z",
                      "segmentEnd": "2017-06-23T00:17:43.207Z",
                      "segmentType": "dialing",
                      "conference": false
                    },
                    {
                      "segmentStart": "2017-06-23T00:17:43.207Z",
                      "segmentEnd": "2017-06-23T00:18:30.510Z",
                      "segmentType": "interact",
                      "conference": false
                    }
                  ]
                },
                {
                  "mediaType": "callback",
                  "sessionId": "042a1bef-7012-4b9c-8263-07273a27a174",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "callbackUserName": "National",
                  "callbackNumbers": [
                    "+593984535613"
                  ],
                  "callbackScheduledTime": "2017-06-23T21:48:00Z",
                  "scriptId": "9d8b3790-5382-11e7-9e91-311d0f07bf80",
                  "skipEnabled": true,
                  "timeoutSeconds": 0,
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T00:20:27.950Z",
                      "segmentEnd": "2017-06-23T21:47:59.967Z",
                      "segmentType": "scheduled"
                    },
                    {
                      "segmentStart": "2017-06-23T21:47:59.967Z",
                      "segmentEnd": "2017-06-23T21:48:22.128Z",
                      "disconnectType": "peer",
                      "segmentType": "interact"
                    }
                  ]
                }
              ]
            },
            {
              "participantId": "2131d345-897d-4049-9ae0-26b419f791a9",
              "participantName": "5551234",
              "purpose": "outbound",
              "sessions": [
                {
                  "mediaType": "voice",
                  "sessionId": "a852c33f-336f-4105-a297-2938df80f8cf",
                  "ani": "tel:+5935551234",
                  "direction": "outbound",
                  "dnis": "tel:0984535613;tgrp=6ac7d060-729f-44a6-8ee4-85f2537ddc7b;trunk-context=prich",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "dispositionAnalyzer": "speech.person",
                  "dispositionName": "disposition.classification.callable.person",
                  "edgeId": "4120a651-9ce3-4f5a-b6ef-b16ca50eb8df",
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T00:18:02.623Z",
                      "segmentEnd": "2017-06-23T00:18:02.623Z",
                      "segmentType": "system",
                      "conference": false
                    },
                    {
                      "segmentStart": "2017-06-23T00:18:56.208Z",
                      "segmentEnd": "2017-06-23T00:18:56.208Z",
                      "wrapUpCode": "ININ-OUTBOUND-TRANSFERRED-TO-QUEUE",
                      "segmentType": "wrapup",
                      "conference": false
                    }
                  ]
                }
              ]
            },
            {
              "participantId": "2b0eb581-daa8-4707-8ab0-93b1f323191c",
              "participantName": "PrichUrbano",
              "purpose": "acd",
              "sessions": [
                {
                  "mediaType": "voice",
                  "sessionId": "897e2779-b379-4fe2-8b8d-855ce032f780",
                  "ani": "tel:0984535613",
                  "direction": "outbound",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "edgeId": "4120a651-9ce3-4f5a-b6ef-b16ca50eb8df",
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T00:18:02.639Z",
                      "segmentEnd": "2017-06-23T00:18:02.643Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "segmentType": "delay",
                      "conference": false
                    },
                    {
                      "segmentStart": "2017-06-23T00:18:02.643Z",
                      "segmentEnd": "2017-06-23T00:18:03.491Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "disconnectType": "transfer",
                      "segmentType": "interact",
                      "sipResponseCodes": [
                        410
                      ],
                      "conference": false
                    }
                  ]
                }
              ]
            },
            {
              "participantId": "f53fb281-faa5-4aaf-8ecf-dc5292b86b15",
              "userId": "5073daec-0559-41e8-bac2-0b32b71502b2",
              "purpose": "agent",
              "sessions": [
                {
                  "mediaType": "voice",
                  "sessionId": "24bb07ed-3613-429a-82be-8981888b08e8",
                  "ani": "sip:0984535613@172.40.252.44;user=phone",
                  "direction": "outbound",
                  "dnis": "sip:PCABTURBUIO027_1@172.40.252.44",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "edgeId": "4120a651-9ce3-4f5a-b6ef-b16ca50eb8df",
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T00:18:03.295Z",
                      "segmentEnd": "2017-06-23T00:18:03.483Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "segmentType": "alert",
                      "conference": false
                    },
                    {
                      "segmentStart": "2017-06-23T00:18:03.483Z",
                      "segmentEnd": "2017-06-23T00:18:30.518Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "disconnectType": "peer",
                      "segmentType": "interact",
                      "conference": false
                    },
                    {
                      "segmentStart": "2017-06-23T00:19:23.743Z",
                      "segmentEnd": "2017-06-23T00:20:34.743Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "wrapUpCode": "2a4c6653-d6aa-4ba5-b77e-df940db4a56b",
                      "wrapUpNote": "",
                      "disconnectType": "peer",
                      "segmentType": "wrapup",
                      "conference": false
                    }
                  ]
                }
              ]
            },
            {
              "participantId": "0615f8ef-c361-403b-aac4-cfe6e78658ca",
              "purpose": "acd",
              "sessions": [
                {
                  "mediaType": "callback",
                  "sessionId": "684bd430-b01b-4ea2-9960-7140a43d3a2f",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "callbackUserName": "National",
                  "callbackNumbers": [
                    "+593984535613"
                  ],
                  "callbackScheduledTime": "2017-06-23T21:48:00Z",
                  "scriptId": "9d8b3790-5382-11e7-9e91-311d0f07bf80",
                  "skipEnabled": true,
                  "timeoutSeconds": 0,
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T00:20:27.952Z",
                      "segmentEnd": "2017-06-23T21:47:59.969Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "segmentType": "scheduled"
                    },
                    {
                      "segmentStart": "2017-06-23T21:47:59.969Z",
                      "segmentEnd": "2017-06-23T21:48:14.656Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "disconnectType": "transfer",
                      "segmentType": "interact"
                    }
                  ]
                }
              ]
            },
            {
              "participantId": "be826ba7-9c78-42d5-97c2-3efabbce13c5",
              "userId": "b07f8b40-4c73-4dbe-a8de-45cc36163042",
              "purpose": "agent",
              "sessions": [
                {
                  "mediaType": "callback",
                  "sessionId": "109558b2-1f7d-4867-b3fe-14b49126f84f",
                  "outboundCampaignId": "95efa81d-4767-4ed6-81bc-7407e09c7c4c",
                  "outboundContactId": "a309e26f6382a314ae6640d1c7755b43",
                  "outboundContactListId": "35c1e239-8105-4af0-bc91-4fda16d165e6",
                  "callbackUserName": "National",
                  "callbackNumbers": [
                    "+593984535613"
                  ],
                  "callbackScheduledTime": "2017-06-23T21:48:00Z",
                  "scriptId": "9d8b3790-5382-11e7-9e91-311d0f07bf80",
                  "skipEnabled": true,
                  "timeoutSeconds": 0,
                  "segments": [
                    {
                      "segmentStart": "2017-06-23T21:48:00.077Z",
                      "segmentEnd": "2017-06-23T21:48:14.659Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "segmentType": "alert"
                    },
                    {
                      "segmentStart": "2017-06-23T21:48:14.659Z",
                      "segmentEnd": "2017-06-23T21:48:22.116Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "disconnectType": "client",
                      "segmentType": "interact"
                    },
                    {
                      "segmentStart": "2017-06-23T21:48:21.860Z",
                      "segmentEnd": "2017-06-23T21:48:21.860Z",
                      "queueId": "03c5d6b4-b5d3-4179-9d6f-5e363761f810",
                      "wrapUpCode": "ININ-OUTBOUND-PREVIEW-SKIPPED",
                      "wrapUpNote": "",
                      "disconnectType": "client",
                      "segmentType": "wrapup"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }

    Participants have sessions and segments. I think that for what want to show I only have to take into account the interactions (segmentType: interact) but my doubt is in the number of participants and if it is possible to debug this information (in this example there are 6 participants)

    Something I've detected is that there is a difference in hours between what the report shows in PureCloud and what I download in the API. Is it necessary to indicate in the query something related to the time zone? I am in Colombia, the information I download is from Ecuador


    tim.smith | 2017-06-28 15:14:53 UTC | #6

    gpinilla, post:5, topic:1478
    I think that for what want to show I only have to take into account the interactions (segmentType: interact)

    What do you want to show that you need help determining?

    my doubt is in the number of participants and if it is possible to debug this information (in this example there are 6 participants)

    I don't see anything in that conversation object that looks out of place. It appears to be a conversation that had an outbound dialer call and then a scheduled callback, both of which were ACD routed.

    Something I've detected is that there is a difference in hours between what the report shows in PureCloud and what I download in the API.

    The general approach to reconciling differences between a report and your analytics queries is to find an interval with a small dataset and reconcile the detail data from the analytics query with the data in the report. You would need to determine if something is being filtered out, or not filtered out, in one place or the other. The important thing isn't so much that your queries match the OOTB reports, but that you understand what the data you're getting means and to interpret it in that context.

    Is it necessary to indicate in the query something related to the time zone?

    When working with analytics, all timestamps are ISO-8601 formatted and include timezone information. You should take this into account when analyzing the timestamps in the response as well as when determining the interval to use in the request.


    gpinilla | 2017-06-28 15:39:40 UTC | #7

    tim.smith, post:6, topic:1478
    I don't see anything in that conversation object that looks out of place. It appears to be a conversation that had an outbound dialer call and then a scheduled callback, both of which were ACD routed.

    For that example, it is the moment in which the agent and the client end the call and who of them hung up.

    Is there any way to remove information I do not need? This data is being processed with Javascript in a browser

    I only need to know in an interaction between the agent and the client, who terminated the call


    tim.smith | 2017-06-28 15:48:57 UTC | #8

    You can determine the reason for a segment's termination by looking at the disconnectType property. There's an explanation of the values here: https://developer.mypurecloud.com/forum/t/disconnecttype-of-outdatedsdkversion/469/7

    Is there any way to remove information I do not need?

    No. The full conversation object is always returned.


    gpinilla | 2017-06-28 16:09:36 UTC | #9

    Thanks Tim for your help, with your information I have clearer to do. A final query is a way to know the total number of conversations, or some way to get the total number of conversations (the api limits the number of records)


    tim.smith | 2017-06-29 13:09:33 UTC | #10

    some way to get the total number of conversations

    Keep making additional requests with the same conversation detail query and increment the page number each time. When you receive an empty result set, you've reached the end of the results for the given filter. Count the conversations in all of your responses and you'll have the total conversation count.


    system | 2017-07-30 13:09:37 UTC | #11

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