So, did you make a big mistake like me when first deploying Guide by not setting the correct source locale out of the gate, then started writing or importing your articles?
And then you went to try and fix it by setting the correct locale as the primary, only to find that customers were now getting directed to a Help Centre page based on their browser language settings that displayed no content?
And then, as an attempted quick fix to try and stop managers going grey - you then attempted to use the localisation methods to make it available in the primarily language - only to find the translation workflow creates a blank document and doesn't bring the content over?
Congratulations, you've made the same mistake I have. You've also run into one of the deficiencies of the Guide product which a Zendesk support agent was apologising to me for during a call today, because it wasn't the first call where they'd seen this happen.
But don't despair fellow Guide users. With a little patience, you can get your guide back on track, with these (hopefully) simple steps.
a) Initial steps to enable use of the Zendesk API's
- Login to your Zendesk instance
- Go to the Support application
- Navigate to Admin > Channels > API > Settings
- Set Password Access to Enabled (the reason for this becomes apparent in the next step - if you miss this, none of the examples provided by Zendesk will work)
b) Check your machine has cURL enabled
- Follow the article Installing and using cURL, to make sure you've got cURL ready to go on your operating system
c) Get to know the Zendesk API
- Read the Beginner's Guide to the Zendesk API, and try out some of the examples in the article to make sure things work as intended.
- Perform some initial tests of the output from the Help Centre API, to make sure that it is returning the article list you're expecting. The curl string you'll want to use looks a little something like this:
Note 1: the | json_pp at the end of the command is for *nix operating systems, and neatly formats the output on screen.curl https://yourinstancename.zendesk.com/api/v2/help_center/en-us/articles.json?sort_by=title \
-v -u yourusername:yourpassword | json_pp
Note 2: The result returned will only give you 30 responses at a time. More information on that later.
d) Extract your article numbers
- Run that earlier query in terminal, and copy the JSON result it outputs.
- Open this website:
http://jsonpath.com - Paste your JSON result into the box on the left hand side.
- In the JSONPath Syntax field, type the following:
$..id - Open a Notepad or similar window, and copy in your article numbers.
- Remember to check that you've got all your article numbers, as it will only return 30 at a time. For example, if you see the following at the end of your result:
"page" : 1,
"next_page" : "https://wafreshdelivered.zendesk.com/api/v2/help_center/en-us/articles.json?page=2&per_page=30",
"page_count" : 2,
"previous_page" : null
Then you'll need to re-run the query to get the remaining article ID's. The clue on how to do it, or how to get more records is made obvious in the code block above.
e) Update the source locale for each article
- Pass the following cURL command for each of your article ID's. Make sure to replace XX for article_locale with the correct language locale you want them in, such as en-us, en-au, etc.
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/{id}/source_locale.json \
-d '{"article_locale": "XX"}' -v -u {email_address}:{password} -X PUT \
-H "Content-Type: application/json"
f) Go and do the whole process above, for both your categories and your sections
Now go back, and repeat steps D & E for both your categories and sections - because chances are they were created in the same wrong source language.
Having come this far, getting this information through JSON should be a breeze, once you've figured out the correct variables from the Help Centre API for Categories and making the changes you need.
Best of luck.