Our API
APIs are the new default according to the 2012 strategy document from the US government "Digital Government: Building a 21st century platform to better serve the American people": http://www.whitehouse.gov/sites/default/files/omb/egov/digital-government/digital-government.html
"Make Open Data, Content, and Web APIs the New Default: To lay the foundation for opening data and content efficiently, effectively and accessibly, OMB will work with representatives from across government to develop and publish an open data, content, and web API policy for the Federal Government. This policy will leverage central coordination and leadership to develop guidelines, standards, and best practices for improved interoperability. To establish a “new default,” the policy will require that newly developed IT systems are architected for openness and expose high-value data and content as web APIs at a discrete and digestible level of granularity with metadata tags."
We in MAGIC support this strategy wholeheartedly, and will do our best to help organizations achieve these goals. We have set up an API for our MAGICapp and are currently working with other softwares to ensure proper flow of data and knowledge.
Application API
Authentication is done by passing a X-Auth-Token and a X-XSRF-TOKEN in the header. Token is got from posting username and password as form params to /api/authenication. Tokens are good for 1 hour.
The example below uses the example: Username: 'name@emailprovider.com', with the password '*****'
To get an X-Auth-Token you first must get a CSRF token. The server sends them as the XSRF-TOKEN cookie. $ curl -X OPTIONS "https://api.magicapp.org/authenticate" --cookie-jar cookies.txt $ curl -X POST -H "X-XSRF-TOKEN: 6ceb1009-c97d-48b6-9214-8fc1fbc8bb59" -d "username=name@emailprovider.com&password=*****" https://api.magicapp.org/authenticate $ curl -H "X-XSRF-TOKEN: 6ceb1009-c97d-48b6-9214-8fc1fbc8bb59" -H "X-Auth-Token: name@emailprovider.com:1426228348180:c6f2eecae71937a155d836a9330bf397" https://api.magicapp.org/api/guideline/2
UI API
This API is to control the client web app. It does things like open, close, toggle and is NOT for getting and updating data. You need to use the App API to get and update data.
Documentation can be shown by running magicApp.apiDoc .
More
If you are a developer and wants to collaborate or use our API - get in touch, we would love to talk to you.