backup using code

Hi! I want to make a program to back up and restore the digi webapp config but I dont know how to make it programmable. I have looked for answers on here but havent been able to find any resources on it.Any help would be greatly appreciated