Recent searches
No recent searches
Tool to backup/restore triggers, automations, and macros
Posted May 11, 2021
Hello there!
I just wanted to share with you all a little tool that I made using Google Spreadsheets to backup and restore automations, macros, and triggers. This comes in handy especially if you want to save up some costs by using other platforms.
This is not 100% automated in terms that you need to run the script manually every time you want to backup/restore something, but it helps a lot.
You can find the tool with its instructions in the following link:
https://github.com/juliofslt/Zendesk-restore-and-backup-tool
I know the code can be improved a little more to be shorter/more efficient, but I haven't had the time to do it. Either way, if you have any recommendations/advice, let me know!
Hope you find it useful! :)
0
10 comments
Dave Dyson
Thanks for posting this tip, Julio!
1
Alejandro Colon
This looks incredibly useful. I am trying it out and ran across a few things I think you should add. I will submit a pr on github. The backup seems to work great so far.
The only actual issue I ran into was using the RESTORE. But, that was my own negligence.
Great tip!
1
Julio Fasolato
Hi @...!
I'll look into this and I'll get back to you about this issue on GitHub. Thanks a lot for the feedback!
1
Amie Brennan
I use this add-on to Google Sheets called API Connector:
https://mixedanalytics.com/api-connector/
Literally allows me to pull all the data from Zendesk into a nice spreadsheet. Click one button and the API call will run and update the data. Very very handy!
1
Kulin Joshi
const response = JSON.parse(UrlFetchApp.fetch(`https://${subDomain}.zendesk.com/api/v2/dynamic_content/${token}.json`, options))
Which token needs to be added here?
0
Julio Fasolato
Kulin Joshi You don't need to add any token there. In the WRITEDATA() function, you can see that the first thing to be declared/initialized is an array with 4 strings (triggers, automations, macros, items).
Later, there's a for loop that iterates over this array, and for each iteration, each of these items will be passed as an argument when we call the GETBACKUP() function, and this "token" will complete the URL to make the HTTP request.
Basically, it's what is going to allow you to make the request to the different API endpoints that are being used here to get the triggers, automations, macros, and dynamic content items.
Hope this helps!
0
Kulin Joshi
0
Julio Fasolato
Kulin Joshi Check your authentication method. If your Zendesk is using 2FA, you won't be able to authenticate just with your email and password. In this case, you would need to authenticate with an API key.
This happened to me and it's the reason the support guy at Zendesk told me.
0
Moaz Magdy
Hey Julio Fasolato Thank you for posting this. I just tried this tool and it works perfectly.
However, I ran into an issue where the maximum number of backed up items is 100 per category.
Is there a modification that needs to be made if I want to backup more than 1000 triggers and macros in Zendesk?
1
Julio Fasolato
Hello there @Moaz Magdy! Sorry for the delay. I haven’t taken a look at this in a while, but if I remember correctly, there’s a limit of 100 requests per minute or something like that. I can recall reading something about that at some point.
I’ll leave a link for you to take a deeper look: https://developer.zendesk.com/api-reference/introduction/rate-limits/
Or, if you cannot find the info, I really encourage you to file a ticket for Zendesk support. Back in the day, the were super helpful regarding these matters!
Sorry that I can’t help further on this, but if there’s anything else regarding this script in which I can help you, let me know and I’ll try to respond as quick as I can.
Cheers mate!
1