Outbound Campaign Contactlist extract and export to GCP

I m new to this Forum and Genesys API
Here is my use case and have questions.

Daily basis, get specific Outbound campaign contactlist’s list as CSV from Genesys and send to Google cloud platform Big query table.

Tech platform
• Python
• Google cloud run ( where code run to make Genesys api call and get data and upload to bigquery)- which invoke by Scheduler daily once( i.e cloud run execute for that time and remove from resources)
• Genesys Outbound API

Following API are used to get URI of contact list which Id is known in advance before start getting data
api_instance.get_outbound_contactlist_export
api_instance.post_outbound_contactlist_export

Once URI is received, make normal get request with token in request header to get CSV file

Query :

  1. If URI already exist ( by calling get_outbound_contactlist_export(),does it need to explicitly call post_outbound_contactlist_export() before downlaoding contact list? What is different between them?

  2. When URI becomes not available, I see that even if contact list is active & has URI in past but get_outbound_contactlist_export() does not return it and need to call export to get URI. So under which condition this happens?
    2.1 also aft initiatating export for URI, in loop it needs to keep checking if URI is created or not ( in my case 20-30 sec). is there any notification or call back there?

  3. I do not see any option to get contact list data in past or between some date range. ? Is there any way to get data in past?

  4. How internally Contact list maintained in Genesys? That help to enhance the solution or if there is issue one can easily triage .

  5. Is there any google – Genesys integration that does provide feature to export contact list from Genesys to Google big query?

  6. Is there way to know programmatically if campaign or contact list becomes off or on (status change) -like when status change , Genesys can call web URL or API that updates Google platform ?

  7. what is relation ship between Campaign & Contact list? it is 1-1 mappng?

1 Like

The POST request initiates an export of the contact list. The GET request gets the download URL for the export. It also has a timestamp of the export to clue you in on when it's from. In terms of programmatically checking that, you'd be looking for a response that has a timestamp after you made the POST request. So if you run this task then run it again 1 minute later, the last download URL will still be valid even if you haven't called the POST request that time.

Exports are only available for a period of time. Maybe an hour? If you want an export, you should initiate one and get the URL with an appropriate timestamp for when you requested it.

Just export the contact list. It always contains all the data in it. If you're referring to conversation data, you would use the analytics API endpoints. Historical conversation data is available for 7 years.

It's part of the cloud services. Your interface is documented APIs.

You could check on the Genesys AppFoundry or contact Genesys Professional Services; I don't know of anything but I'm not familiar with their offerings.

There are several campaign related notification topics: https://developer.genesys.cloud/notificationsalerts/notifications/available-topics

I don't know off the top of my head, but I'd recommend checking out the Outbound docs (About outbound dialing - Genesys Cloud Resource Center) or just try it out in the UI.

@tim.smith , Thank you for quick reply
Here query was if there is daily download scheduled, it is good to first export the URI even URI exist to download to make sure to get latest data or if URL exist and use that also give latest data at time of downloading.?
I mean not need to always export URI and then download.

Absolutely. If a URL already exists before you request one, it was from an export that was initiated in the past. That export will not contain the activity that has happened between when it was last exported and when you're currently looking.

1 Like

@tim.smith
for us having option to get data of past or specific rang is imp. I m not sure how list will be maintained.

In our usecase , all we need from contact list , if person/Phone is contacted how many times and what was datetime of each contact and status of call. so we r expecting entry something like below in list

PhoneA - Called on B datetime Attemp =1 download csv date P
Phone A -Called on C datetime Attemp=2 download csv date Q

so for any reason ,for oneday downloading CSV file is missed. so on next day when contact list is downloaded can we get previous days data or it is already overwritten by next day data - I belive per phone it will be only one recordi in CSV file

I m not sure if contact list data can be stictch to Analtyics API which provides same data that we r getting from contact list. New to Analtyics API & did not see any clarity on that if we can get contact list via Analtyics API

That's not a contact list. The contact list is simply a list of contacts to be dialed. They may have already been dialed in the campaign or not yet dialed, but it's an active dataset; it is not a historical record.

To get historical details about conversations, you should use analytics queries: https://developer.genesys.cloud/analyticsdatamanagement/analytics/detail/conversation-query

If you're doing bulk exporting and not live querying, use analytics jobs: https://developer.genesys.cloud/analyticsdatamanagement/analytics/jobs/conversation-details-job

1 Like

@Urvish my last response was given under the assumption that you've already decided what you're looking for isn't in the call list. It does have some basic attempt information, but analytics data always provides all conversation attempts for the campaign. Make sure you've inspected the actual call list export data from a running campaign in your org before deciding it doesn't suit your needs.

@tim.smith
we recently established this process aft checking what is there in CSV file and we r getting call date, no of attempt, phone etc.

I believe analytic query is pre-defined on certain factors and more in to how long call last or which agent call or which type of call etc where we need some straight forward factor ,how many times it is called & on which date time and result of call.

Also I do not see any sample in pyton how result look like and also in order to make analytics query one need to define report in Genesys UI?

so in short my question still remain same if there is any way to see past state of contact list ? and how contactlist get updated. ( keep adding records or alwasy keep updating records ) - for one phone it will be alwasy one record with latest data vs per one phone one will have mutiple records ,past +current

Reports are unrelated to analytics queries. If you'd like to use the python sdk, you can find its documentation here: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/.

As stated previously, the contact list is not a historical record; it is a live data source. If you want to go back in history, use analytics queries/jobs to get the historical conversation data.

Either using the UI or the APIs for contact lists. How you choose to manage it is up to you and your business to determine what your processes should be.

@tim.smith
thank u for reply

Currently I m not able to see how I can use Analytics query to relate the record in contact list.
Analytics query need some matrix name as parameters and not sure how that is defined in genesys and does it help what we r trying to achieve.

we just need phone which is called, how many times it is called and which date time it its called and result call for specific contact list / campaign
So here main entities as below and trying to understand how it is managed in Genesys and relationship between them that helps me to make query to Genesys data. right now we r trying to derive from contact list CSV - which pretty much provide info to dertive this Only issue is it does not give option to get data in past.

  • Campaign Id
  • Contactlist id
  • Phone of person (part of contact list)
  • datetime when this phone become part of contact list
  • Datetime of each call made to that phone
  • result of call

so we can get final data to make report as

  • total number of persons in one contact list
  • out of that how many called and how many times and on which date time ( this help that once persone become part of contact list how soon it is contacted - within X hr or Y day first call is made)
  • final status of call aft max call attempt is made

Everything except "datetime when this phone become part of contact list" is in the conversation data from analytics. That data point is something you would maintain on your side as part of your contact list management process. Typically customers use a CRM or database to maintain their contact list to their liking and upload the records to dial to Genesys Cloud on a regular basis per your business practices.

I would encourage you to read through the documentation linked previously in this thread. This will guide you to get started making some queries. Once you are doing that and can view the conversation data, the typical approach is to look at a conversation you know was part of the campaign you're looking for and inspect the data to see what values it has. Then you can update your query filters based on that data to narrow down the result set.

The information you're looking for is in the call list export and/or analytics data. If you need someone to map this out for you, I would recommend engaging Genesys Cloud Professional Services. They can be hired for 1:1 consulting to walk you through anything you need or can be engaged to build a solution to your requirements.

@tim.smith
thank you for reply.
by doing some research and trial and error , I tried following code assuming this will give info specific contact list on past 7 days.
but I m not sure on response schema part where I can identify following...

if you have any guidance on this let me know else this thread can be concluded here.

  • total number of phones ( persons to be called- may be I can loop on response["conversations"] in contact list and may try to find on unique "outbound_contact_id" or "ani"

  • on which date time , contact is made -this can be multiple- Not sure which element provides that
    what is following fields mean?
    'segment_start'
    'segment_end'
    conversation_start
    'conversation_end'
    'participants'[N].sessions[Y].'metrics'[M].emit_date

  • final result aft last call , can check "wrap_up_code" field in response["conversations"]?

api_instance = PureCloudPlatformClientV2.ConversationsApi(gen_api_client)
    end_date =date.today()
    start_date = end_date - timedelta(7)
    interval=str(start_date)+"T00:00:00.000/"+str(end_date)+"T00:00:00.000"
    body = PureCloudPlatformClientV2.ConversationQuery() # ConversationQuery | query

    body.interval=interval
    body.order_by= "conversationStart"
    body.segment_filters=[{
           "type": "or",#and or or
           "predicates": [
            {
             "type": "dimension",
             "dimension": "outboundContactListId",
             "operator": "matches",
             #ref: https://developer.genesys.cloud/analyticsdatamanagement/analytics/dimensions
             "value”:”<contactlisIdHere>”
            }]
    }]

The query in your code example looks like it should filter the result to any conversations in your given date range that were from the given contact list. I would recommend trying out the queries live using API Explorer; that's usually a quicker way to figure out what you want your query to be rather than coding it. POST /api/v2/analytics/conversations/details/query

The set of conversations returned (after completing paging) will be the total number of attempts made. If you want to refine that number by other conditions, you would write that logic in your code. For example, counting the unique number of phone numbers called (ani).

The timestamps are contextual to the element they're on. The conversation start date is when the conversation began. The start date on a participant's segment is when that specific activity for that participant began. Which timestamps you should choose depends on exactly what you're trying to measure. You'll get different results for different calculations; all of them are "right", but have different meanings. The right calculation for you is the one that satisfies your reporting requirements. Looking at the conversation view in the UI can help you understand the various parts of a conversation better.

Yes, the conversation data contains wrap up codes, if any have been set at the time you retrieve the data.

Thank u for reply.
somehow with my act i m not able to run API directly on API explorer page.

I m trying to find mapping between the column that I see contact list & Response schema of (https://developer.genesys.cloud/devapps/api-explorer#post-api-v2-analytics-conversations-details-query)
I m trying to find which schema represent "CallRecordLastAttempt–[Phone column] " collun which is part of contact list.

Is there any doc which provide this mapping between API resulst and contact list columns which are added by Genesys.?

Are you getting an error? What behavior are you experiencing?

A campaign's contact list and conversation data are separate things; there isn't a direct mapping. The page you linked documents the columns added by Genesys Cloud. See the heading "Internally generated columns in .csv data files". In this context, "internal" means Genesys Cloud.

so in nutshell it seems contact list records are stored in way that can not be retrieved by any API?

No, I've been trying to communicate the opposite of that. I've provided several links to resources explaining how to get the conversation and call list data. If that's not clear to you from the information in this thread, engaging Genesys Professional Services for a 1:1 consulting engagement to walk you through these concepts is probably a good idea.

Thank you for reply & being patient with me as I m new to Genesys .

As my first encounter to Genesys & also requirement start with Contact list where it suffice what we need from contact list data ( export contact list in csv format and store in our database) & only part is we can not see past data of contact list.
I also tried to see response of Conversation detail query but. not able to figure out if I can map to what we r getting from contact list.
I m not familiar with how Gensys internally store all these data, under which format etc . That is how this thread started.

one query here..
I posted query on other subject . Did not see any reply. Let me know if u know on this or I have to post on diff section