Accessing Microtronics REST API with curl

To access the Microtronics REST API with curl just see following examples. Just insert your username and password (and change Server URI if you like to access a different server).

Example: read out your userdata based on the user provided for authentication
curl --user YourUsernameHere:YourPasswordHere -H “Accept: application/json” https://cloud.microtronics.com/api/1/me

Example: read out the sites accessible for your account
curl --user YourUsernameHere:YourPasswordHere -H “Accept: application/json” https://cloud.microtronics.com/api/1/sites

Example: change the configuration of a site configuration
curl --user YourUsernameHere:YourPasswordHere -H “Accept: application/json” https://cloud.microtronics.com/api/1/sites

Example: Upload a new file for a given site
curl -i --user YourUsernameHere:YourPasswordHere -H ‘Content-Type: multipart/form-data’ -F ‘img_avatar=@C:\temp\myFile.jpg’ https://cloud.microtronics.com/api/1/customers/YourCustomernameHere/sites/YourSitenameHere/files

Of course all other endpoints mentioned in the Playground Documentation are accessible like in the example mentioned here too.

Info: YourCustomernameHere and YourSitenameHere properties need to be encoded with encodeURIComponent (javascript; also available in other programming languages)