How to Export Zendesk Guide Data as CSV



投稿日時:2018年8月23日

 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件のコメント

Thanks 366290875688 that did the trick! Greatly appreciate you responding and creating this script.

0


Hi 366251110588,

Sorry for the delayed response.

I am assuming aren't successfully exporting your "internal" articles, or those not viewable to everyone, when you run the script. Is that true?

If you haven't tried already, give the Oauth script a shot:
https://github.com/scotthavard92/Zendesk-Help-Center-Export-Scripts/tree/master/Article_Information_Export#exporting-internal-articles-using-oauth

When I run the script not using Oauth it doesn't return any of our "internal" articles.

When I do use the Oauth script it dumps everything other than archived articles.

Let us know if that helps solve it!

0


Hi Devan,

The only solution for a list of IDs is Scott's script. I had to send this post and Scott's links to someone else in my org, because I don't have API access. But I had to get all the Section IDs (which actually would work, with a "Remove Duplicates" in the output file, which is now on Google Sheets) to integrate Pendo with Zendesk on our product.

Pendo is becoming really big. To allow for easier integration, Zendesk really should offer an export of article and section data, natively. For your Feature Request list.

0


Hello 366251110588,

Hopefully, 366290875688 will be able to come back and respond to your request. In the meantime, this article on Creating and Editing Articles might have some helpful information. 

Best regards. 

0


Hi Scott...Thanks for publishing this. I was able to successfully run the python script and pull articles from our instance. However, it only found 106 articles and I have 372 published articles. I am an admin within the ZD environment and I verified that it was pulling articles that I wasn't an author of, but not sure what I am missing to pull the other articles. I appreciate your assistance!

0


@Jeff Callahan, getting posts would be a different API endpoint, and posts don't have all the same properties that articles do. I think it would not be a difficult modification of the script, to change the API endpoint and change some of the properties being exported. Information on the post API and properties is at  https://developer.zendesk.com/rest_api/docs/help_center/posts/. I guess you would need to change this:

 url = 'https://' + subdomain +'.zendesk.com/api/v2/help_center/en-us/articles.json?sort_by=title&sort_order=asc'

to something like this:

 url = 'https://' + subdomain +'.zendesk.com/api/v2/help_center/community/posts.json'

(adding sorting if you didn't want the default order of sorted by created_at)

And you would need to remove the code that gets article properties that don't exist in posts (section_id, draft), then if you want the post details, add code to get the details property, and you'd probably want to change some of the column names.

@Diogenez, yes, I'm using Excel, so I formatted the columns to numbers with no decimal places. I just thought it was interesting that in the YouTube video that showed this export being done, his resulting CSV file didn't need to have the formatting changed, and didn't have empty rows.

 

 

 

 

 

0


Karen D Snyder, that great that worked, in my file is also unconfigured, are you using Excel? just format the column to number without decimal places that will keep the correct code

0


Would it be possible to use these scripts to output Community posts?

0


Hi Diogenes, I tried with 'NFKC', 'NFD', 'NFC', and 'NFKD', and each time got the same error. I guess I have some articles with the '​' character, and maybe none of your articles have it. Then I had the idea of just stripping that character out. It is a zero-width space, so it is not needed in the final output (https://www.fileformat.info/info/unicode/char/200B/index.htm). I modified the code that gets the article body to replace the character with an empty string:

        for article in data['articles']:
body = article['body']
decode_10 = unicodedata.normalize('NFKD', body)
decode_10_nozwsp = decode_10.replace(u'​', '')
output_10.append(decode_10_nozwsp)

After modifying the code to remove the '​', the script worked and I was able to export the data with the article body!

I did notice that my exported CSV file has an empty row after each row, and the numbers such as article IDs appear as 3.60023E+11 instead of 360022658132. I wonder if this is because I'm working on a PC, and in the video he is working on a Mac? These are of course minor issues that can be fixed manually.

 

0


Hi, Karen, how are you? I used Scott's tip and it worked perfectly, If you want to test your script: "Maybe try replacing the 'NFKC' in lines 47, 51 and 75 with either 'NFD' or 'NFC' and see if that solves the problem"

0


サインインしてコメントを残します。

お探しのものが見つかりませんか?

新規投稿