A couple of month ago I started exploring Synologys so far very undocumented WEB API. I basically started with the authentication and from there experimenting and researching on my own Synology DSM Webinterface. I found out, that a lot of the terminology and paths used in the WEB API are exactly the same as used when you normally browse, call and do stuff on the Synology DSM Webinterface.
So form there I started a first working php prototype for my MagicMirror witch I build in a different project.
If you want to try it yourself or/and extend the actual code just fell free to download it from my git here:
WARNING: this is a tinkering exploration of the API and SHOULD NOT BE USED FOR PRODUCTIVE PURPOSES. Code is functional and experimental!
After you downloaded the code run it on a php capable environment or webservice. I normally use my local php on the MAC terminal. If you want to run php code directly on your MAC terminal follow these steps:
Steps for running a PHP Server on a Mac via the Terminal
- cd to project directory
- run the following command php -S 127.0.0.1:8080
- Go to your web browser and open http://127.0.0.1:8080/ or http://localhost:8080/
Before you can run my Synology example, you need to edit the file "config.sample.php", enter your credentials and IP and rename it to "config.php".