How to Export Zendesk Guide Data as CSV



Posted Aug 23, 2018

 Here is a script that exports Zendesk Guide Article information as a CSV:

https://github.com/scotthavard92/Zendesk-Help-Center-Export-Scripts

This tool uses the Zendesk Help Center API(https://developer.zendesk.com/rest_api/docs/help_center/introduction) to pull Guide Information and populate it in a csv file. This will output values such as Article Id, Article Title, and Vote Count.

The output looks like:

Here is a nifty video overview and instructional:

https://youtu.be/nGYQwV-kpyE

Let me know if you have any questions!

 


1

41

41 comments

Hi Scott,

Is it also possible to extract the body of an written article? We need a .CSV file so our translation agency can make the translations into foreign languages.

 

Please let me know if you (or any of you) have any tips on this!

Thanks in advance,

Ron

0


Thanks, Scott! It worked like a charm. Really appreciate your assistance. 

0


Thanks, Scott!

0


Hey Kurt!

I just added the "updated_at" code in the GitHub repository.

https://github.com/scotthavard92/Zendesk-Help-Center-Export-Scripts/blob/master/Article_Information_Export/Zendesk_Guide_Article_Export.py

In short I added the "updated_at" as a string type. Hopefully that will do it for you! I had trouble storing it as a different data type.  

It looks like the YouTube commenter was able to do it! It might be worth asking how Apathia did it in case you need a different data type.

Keep me posted!

 

0


Hi Scott,

great work on the script and the video. Super helpful! I was just curious how I can add the timestamp (updated_at) to the script and kept getting one error after another. I would appreciate some pointers on how to achieve this as adding this

didn't work for me. 

It also looks like somebody else had the same question on the YT video.

 

Thanks for any input on this. 

0


Yes. The code ran fine and produced the draft column. Then I added a new column to represent the Author Name.  In Agent UI, I exported the list of Agent ids and names.  Then, pasted into the spreadsheet (as a table).  I used the Vlookup function in Excel to add the correct Author name next to the article they authored.  Then, when done I added the ss to Google sheets so Agents can run their own reports at the end of month (I will update once per month)

 

0


This is great Mary!

I am so happy to see that you got it to work, and also thank you for sharing information about the "The Unarchiver". 

Did your code work? (Nice work on adding stuff!)

One comment is that you may want to change int(draft) to bool(draft). If it runs either way, then it is probably fine either way. 

I updated the code in the repository to add a "draft" row as well. 

 

0


Hi We figured it out.  RUN SUCCESSFULLY!!!! When a file is downloaded to Mac, it is changed to a different format.  So, we had to install "The Unarchiver" from the Mac App Store to open the zip file (rar).  I had to also use IDLE to open/edit the script.

 

I added in the draft field to the output

 

I have a list of the agent ids (we have over 100+) and their names so I can map within the spreadsheet.  Once I extract the Agent Ids and name mapping, I can create an Excel formula to add a new column with the Agent name to each row.  Then, I can filter by that agent to get their individual report.

Thank you so much, Scott.  This is very, very helpful.

0


Hey Mary!

Thank you for the kind words.

I am glad to hear that you were able to successfully get the requests library using pip. This suggests that python is installed correctly, and requests is now installed on your machine.

I want to give you a big thanks for providing feedback so quickly, I imagine your issue is one that will arise on many occasions. 

To address your questions:

  • My main suspicion with your error is that the file was saved incorrectly. Sometimes adding the “.py” at the end of the file isn’t enough to save it correctly. What program did you use to copy and paste the script? I have had this issue with Microsoft Word before. One solution is to download the full repository from GitHub (as described in the video I posted above), and move Zendesk_Guide_Article_Export.py to where you want to run it from (i.e. your Desktop). Let me know if this works
  • You asked about extracting all article links owned by a particular author. Once you get my script working, I strongly suggest you do this from a spreadsheet (such as in Google Sheets or Excel). If you “Sort By” to organize the data, sort the sheet by author id. It will list all articles, article URLs, etc. by author id. This will work similarly in most spreadsheet software, but here is some information if using Google Sheets (which is free): https://support.google.com/docs/answer/3540681?co=GENIE.Platform%3DDesktop&hl=en
  • I am not certain how to connect the author id to an authors name, however (our team is small, so I just dive back into Guide and can link author id with a name). We can brainstorm on this one if you have a giant team.
  • Lastly, you asked about extracting all Draft articles owned by a particular author. Draft can be exported as TRUE/FALSE as written in the API documentation (true means the article is currently a draft).
  • If that value is exported, I would suggest doing the organization from a spreadsheet (such as in Google Sheets or Excel). If this sounds reasonable, then I can add the code to export this value and update you when it is done.

Best,

Scott

0


Scott,

This is great and super useful!

I ran pip3 install requests.  That seemed to work ok.

Also, I wanted to check my subdomain name.  How can I do that?

 

When I run the script I get this error message:

-----------------------------

File "Zendesk_Guide_Article_Export.py", line 1

SyntaxError: Non-ASCII character '\xff' in file Zendesk_Guide_Article_Export.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

mary-paez-mbp

-------------------------

 

We need a way to do the following:

  • extract all article links owned by a particular author or 
  • extract all Draft articles owned by a particular author

As I am not a programmer, do you have ideas on how I can do this?

 

I just downloaded Python and am going thru the documentation.

Thank you

0


Sign in to leave a comment.

Didn't find what you're looking for?

New post