My understanding is that this line of Cisco routers is only configurable from the web browser; although it supports SNMP the MIB seems pretty restricted.
You could therefore consider automated web configuration, such as via Selenium, originally designed for automated web site testing.
In essence you write a script (in Python or many other languages including PHP) which drives the web browser: get a page, find page element, type something, click on something. Have a look at the examples at https://www.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example
Alternatively, of course, buy another router, perhaps in addition, which is configurable with remotely, such as any of Cisco's IOS routers. Then you can script it in any number of ways, including ssh remote commands or web loading.