Wie exportiere ich eine Liste von Benutzern?



image avatar

Katie Dougherty

Zendesk Digital Resources Team

Bearbeitet 24. Apr. 2023


-8

0

14 Kommentare

I used the following python script with my API credentials to export all end-users:

import requests, csv
from requests.auth import HTTPBasicAuth

url = 'https://YOUR_ZENDESK_SUBDOMAIN.zendesk.com/api/v2/search/export.json?query=role%3Aend-user&filter[type]=user'
zd_auth = HTTPBasicAuth('ZENDESK_USER@YOUR_COMPANY.COM/token', 'YOUR_ZENDESK_API_TOKEN')
response = requests.get(url, auth = zd_auth)
data = response.json()
results = data['results']

# Open a file for writing and create csv writer
csv_file = open('zendesk_users.csv', 'w')
csv_writer = csv.writer(csv_file)

# Write headers to the CSV file
header_line = results[0]
header = header_line.keys()
csv_writer.writerow(header)

for user in results:
    csv_writer.writerow(user.values())

while data['meta']['has_more']:
    url = data['links']['next']
    response = requests.get(url, auth = zd_auth)
    data = response.json()
    results = data['results']
    for user in results:
        csv_writer.writerow(user.values())

csv_file.close()

1


Really need to re-evaluate Zendesk as a product, If  I can't do a simple tasks as export users.

11


Hi Tom,
 
You can use the Full XML export option for users.

0


Seriously - there is no way to get a report of customers (end users and their attributes) or organizations (customers and their attributes like external id, tags, etc) ?  

 

There must be in Explore or worst case - a simple CSV dump ?

1


Hi Andrea,

 

CSV export is only applicable to tickets. Tested this out just now and I can confirm that only tickets are exported. Although, if you open the CSV file in a spreadsheet app, it could look like you are exporting a "Users" report because it lists ticket details including the ticket requesters. If you double-check the headers, it should look something like this:

The 'Id' in this case refers to the ticket ID.

More information about CSV Export:

  • CSV export: Exports ticket data in CSV format. Does not include deleted tickets, ticket comments, or ticket descriptions.

    With CSV export, if the amount of data being exported from a ticket is more than 1 MB, the ticket doesn’t export. It isn’t included in the resulting CSV file. However, typically, this never happens since CSV exports do not include ticket comments, which are usually the largest data component in a ticket.

    See Understanding which ticket data is in the CSV export for the ticket data included in CSV exports.

Reference: Understanding the data export options

 

0


It seems possible to export users in a CSV file; when requested, it is sent to your email address:

However, it doesn't seem to include all the users... in my case it's listing only 492 users out of 46633... 

 

1


1902165793204 Agreed. Ideally, you should just be able to run a report and export. I usually recommend our clients to export from their reporting tool (Looker, Tableau, PowerBI, etc.) if they have access to one. That's probably the easiest and most robust workaround.

0


Exactly. I have no idea why I have to be some sort of programmer just to export a list of emails for my customers who have booked tickets.  Its honestly ridiculous.

7


Seriously there is no download to CSV in Zendesk?   We have to mess with add ons, or JSON files and convert?  I see you have bulk import options.   The cynic in me would say exporting users (key activity in truing up user counts) is made hard to make it harder for admins to ensure licences are recovered.

Is an export to CSV on the roadmap? if so when is it due?   if not - why not?

9


Melden Sie sich an, um einen Kommentar zu hinterlassen.