Comparing
version 6 and
version 5 backThe CampusWire API(Application Programming Interface) is a way to access CampusWire programatically. This makes it easy to integrate CampusWire into your own application, or even build an application around CampusWire. The API follows "REST":http://en.wikipedia.org/wiki/REST principles.
All API calls are authenticated using HTTP BasicAuth. Be sure to set your Content-Type and header to "text/xml; charset=utf-8"
There are four HTTP methods that are used when you make a call to our API. They are:
* GET -- Get information about a resource
* POST -- Create a new resource
* PUT -- Modify/update a resource
* DELETE -- Delete a resource
h3. CampusWire has four resources that you can create/edit/update/destroy.
* [[API Documentation Message|Messages]]
* [[API Documentation Users|Users]]
* [[API Documentation Groups|Groups]]
* [[API Documentation Memberships|Memberships]]
h3. Ruby library
We have written a simple API wrapper in Ruby that you can. You can view it [[Ruby CampusWire Client|here]].
h3. Using cURL
If you have access to the cURL utility, you can use that to make API calls to CampusWire. Here are a few sample calls
h5. Retrieving a list of messages
curl -u username:password -H "Content-Type:text/xml; charset=utf-8" https://thecampuswire.com/organizations/messages.xml
h5. Retreiving an individual message
curl -u username:password -H "Content-Type:text/xml; charset=utf-8" https://thecampuswire.com/messages/1.xml
h5. Deleting a user
curl -H "Content-Type:text/xml; charset=utf-8" -X DELETE -u username:password https://thecampuswire.com/users/290.xml
h5. Creating a new group
curl -u username:password -H "Content-Type:text/xml; charset=utf-8" -d "my group" https://thecampuswire.com/organizations/org_name/groups.xml
h5. Updating an existing user
curl -u ian2:ian2 -H "Content-Type:text/xml; charset=utf-8" -X PUT -d "290foo@bar.com" https://thecampuswire.com/users/290.xml
h3. Notes
The request URI should end in .xml when making calls to the API. For instance, to retrieve a list of users the request would get GET http://www.thecampuswire.com/organizations/john_doe/users.xml
If you are working with an individual resource, an example request would be GET http://www.thecampuswire.com/users/1.xml