Download articles with python



2024년 2월 27일에 게시됨

Hello, I would like to use python script to download articles that are located on address such as.

https://support.example.com/hc/en-us/sections/224112129274-Knowledge-base.

U used following tutorial but it did not work for those articles I need it downloaded whatever was available at 

Endpoint = zendesk + '/api/v2/help_center/{locale}/articles.json'

 


0

2

댓글 2개

Hey starskiin3d, you can download ALL articles using this script that creates a csv file with them:

import requests
import pandas as pd

email = "name.surname@mycompany.com/token"
token = "XXX"
zendesk = "mycompany"

credentials = (email,token)

url = f"https://{zendesk}.zendesk.com/api/v2/help_center/articles"

articles = []

while url:
    response = requests.get(url,auth=credentials)
    data = response.json()
    df = pd.DataFrame(data['articles'])
    articles.append(df)
    url = data['next_page']
    
all_articles = pd.concat(articles)

all_articles.to_csv('all_articles.csv')

 

To download only the articles in section number 224112129274 you can use the same script but modifying the url:

url = f"https://{zendesk}.zendesk.com/api/v2/help_center/sections/224112129274/articles"

 

 

 

0


Hello!
 
I'm sorry to hear that you had issues while following our tutorial. Let me go ahead and pull you into a ticket to get a better idea of your use case and review some code samples. 
 
 

1


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물