최근 검색


최근 검색 없음

Changing Article Default Language in Zendesk.



2024년 7월 04일에 게시됨

 

Hello All,
 

We recently migrated our old Zendesk article system to the new Zendesk platform. During the migration, the article default language was set to “en-am,” whereas the default language in the old system was “en-us.” We now need to change all articles from “en-am” to “en-us.”
 

I have tried the following API methods, but have not been successful. Can anyone help me fix this issue?

Thanks!

https://developer.zendesk.com/api-reference/help_center/help-center-api/translations/#update-translation



https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#update-article-source-locale
import requests
from requests.auth import HTTPBasicAuth

url = "https://support.zendesk.com/api/v2/help_center/en-us/articles/25742539190801/en-us"
headers = {
    "Content-Type": "application/json",
}
email_address = 'email id'
password = 'password'
# Use basic authentication
auth = HTTPBasicAuth(email_address, password)

# Construct the data payload as JSON
data = {
   "article": {
       "locale": "en-us",  # Specify the locale you want to update
       # Add other fields you want to update in the article
   }
}

response = requests.request(
    "PUT",
    url,
   json = data,
    auth=auth,
    headers=headers
)

print(response.text)
 


0

1

댓글 1개

Hi PR,

 

I'm unable to figure out how the “Update Translation” endpoints should be used. Maybe someone else can explain.

 

What I can suggest is to go over all articles with the API and create a new article with the correct locale for each one, and then delete the one with the wrong locale.

 

Ned

0


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

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

새 게시물