Vanilla is a product of Lussumo. More Information: Documentation, Community Support.
curl -H 'Accept: application/xml' -u jreevius:wh4t1tb3l1k3 http://url
<?xml version="1.0" encoding="utf-8"?>
<item>
<key>value</key>
<key>value</key>
</item>
As mentioned in the intro, resources follow RESTful principles. Each resource has two parts: a collection (e.g. a task list) and a member (e.g. an individual task). How you interact with these resources depends on which HTTP method you use and whether you are addressing a member or a collection.
The API root URL is located at https://api.myintervals.com/
Here are some examples of accessing resources:
Accessing information about a task
GET https://api.myintervals.com/task/13/
Getting a full task list
GET https://api.myintervals.com/task/
Getting a filtered task list
GET https://api.myintervals.com/task/?clientid=5443&personid=2344
Creating a task
POST https://api.myintervals.com/task/
<task>...</task>
Editing a task
PUT https://api.myintervals.com/task/13/
<task>...</task>
Deleting a task
DELETE https://api.myintervals.com/task/13/
PUT/POST Interchangeability
Though RESTful principles describe separate HTTP methods for creating and updating resources, we understand that there is limited support for PUT in certain development platforms. Consequently, you may use PUT and POST interchangeably; the system will determine whether a member is being created or updated based on whether or not a resource id is passed in the parameters.
A simple example of how to request a task list using a formed HTTP request:
<strong>GET</strong> https://api.myintervals.com/task/
Accept: application/xml
Authorization: Basic MTIzNDU6QUJDREU= For more complicated requests post your XML or JSON directly.
The Content-type Header
The Intervals API supports both XML and JSON as forms of input for PUT and POST requests, but you must specify which type you are using by including either application/xml or application/json in a Content-Type HTTP header sent with your request.
An example of updating the description on a timer using XML.
<strong>PUT</strong> https://api.myintervals.com/timer/9282/
Accept: application/xml
Content-type: application/xml
Authorization: Basic MTIzNDU6QUJDREU= <?xml version="1.0" encoding="UTF-8"?>
<timer>
<name>Client X homepage redesign</name>
</timer>
An example of creating a new timer JSON.
<strong>POST</strong> https://api.myintervals.com/timer/
Accept: application/json
Content-type: application/json
Authorization: Basic MTIzNDU6QUJDREU= {
"timer":{
"personid":2051,
"starttime":"2009-06-19 10:06:36",
"name":"Meeting with Client Y"
}
}
A more detailed description of each type of request, including required fields and the expected response, can be found in each individual resource page.
An example of a XML response. Please note that values containing reserved XML characters are embedded with CDATA tags to allow for proper XML parsing.
<?xml version="1.0" encoding="UTF-8"?>
<intervals status="OK" code="200">
<client>
<id>4561</id>
<name>My Italian client</name>
<datecreated>2007-09-04</datecreated>
<description/>
<firstname>Molto</firstname>
<lastname>Bene</lastname>
<email>whatever@blah.com</email>
<website/>
<phone>+44 01223 123456</phone>
<cell>+44 01223 123456</cell>
<fax>+44 01223 123456</fax>
<address>810 Montecito St</address>
<aptsuite>C</aptsuite>
<city>Santa Barbara</city>
<state>CA</state>
<zip>93103</zip>
<country>US</country>
<active>t</active>
</client>
</intervals>
An example of a JSON response:
{
"status":"OK",
"code":200,
"client":{
"id":"4561",
"name":"My Italian client",
"datecreated":"2007-09-04",
"description":null,
"firstname":"Molto",
"lastname":"Bene",
"email":"info@myintervals.com",
"website":null,
"phone":"+44 01223 123456",
"cell":"+44 01223 123456",
"fax":"+44 01223 123456",
"address":"810 Montecito St",
"aptsuite":"C",
"city":"Santa Barbara",
"state":"CA",
"zip":"93103",
"country":"US",
"active":"t"
}
}
Note: These example responses have been formatted for easy viewing. The actual response returns with whitespace stripped.
1 to 47 of 47