We are trying to gauge how much an API with Intervals would help our current customers. An API is on every Web 2.0 checklist, but we have focused our attention on listening to our customers and rolling out features that are most in demand.
We have the core in place for an API in our framework are wondering if we should execute it sooner rather than later. Much to our surprise, many of our customers have been asking for more and more features and have not been clamoring for an API. They have been looking to use Intervals as their one stop place for all task, time, and project management needs.
As web developers ourselves, we expected more API demand so here is your chance to sound off. Would you use an API? Should we move it to our list of features to execute sooner rather than later?
As always, thanks for you thoughts - Michael
Our firm is definitely interested in an API as we would like the ability to exchange information captured in Intervals easily with other systems that are not web-based. Also, we are interested in any ability to link from other websites into Intervals.
Robert
We would have interest in an API. We would like to import time into Dynamics GP as invoices and that would be great.
Thanks,
Matt
curl -H 'Accept: application/xml' -u jreevius:wh4t1tb3l1k3 https://url
<?xml version="1.0" encoding="utf-8"?>
<item>
<key>value</key>
<key>value</key>
</item>
The API is in its early stages of development. We are writing documentation and layering API aware code throughout the application. If you'd like to try it out, here is a way to use the API to start and stop timers:
To start a timer:
curl -k -H 'Accept: application/xml' -u [username]:[password] https://[yourdomain]/timer/start/0/[taskID]/
To stop a timer:
curl -k -H 'Accept: application/xml' -u [username]:[password] https://[yourdomain]/timer/stop/0/[taskID]/
To clear a timer:
curl -k -H 'Accept: application/xml' -u [username]:[password] https://[yourdomain]/timer/clear/0/[taskID]/
For example, here is how I would start, stop, and clear a timer for task #14754:
curl -k -H 'Accept: application/xml' -u jreeve:wh4t1tb3l1k3 https://pelago.projectaccount.com/timer/start/0/14754/
curl -k -H 'Accept: application/xml' -u jreeve:wh4t1tb3l1k3 https://pelago.projectaccount.com/timer/stop/0/14754/
curl -k -H 'Accept: application/xml' -u jreeve:wh4t1tb3l1k3 https://pelago.projectaccount.com/timer/clear/0/14754/
Next up...
Now that the basic foundation of the API has been built, we'll be API-enabling different areas of Intervals. The first areas to be retrofitted will be task views and lists.
Give the timer API calls a try and let us know what you think!
Could you give a quick example of using your API using vbscript, vba or visual basic?
Just to point me in the right direction...
Thanks,
Matt
I would love to beta-test your API. I really like what you've got going with Intervals. All of my time reporting is currently in Freshbooks and/or Basecamp (both of which have APIs).
I'd like to get a jump-start on writing something to import from one or both of those services into Intervals. If you can provide me with an API, or if you would like to hire me to help you get the API done more quickly, I can do that.
One question I have about the API is this: What's the 0 for just before the task id?
Thanks.
This is an excellent approach; essentially the same strategy as most other W2.0 systems out there.
We had been using BaseCamp before switching to Intervals and we have started a framework for importing MS Project XML files. It created an OO abstraction layer over BaseCamp so it treated all of the POST and returned XML elements as populated classes - much like an object relational mapper (since we already develop an ORM for SQL called BizBlox).
Since you are attacking the tasks first, please see if you can also allow for task creation as well as just viewing/listing.
I will start rewriting the wrapper for Intervals as I get some time and post it up. Its written in C# so any managed language can use it - and it could easily be ported to Java - I will post code back here as it gets done.
Regards
Joe
It works great - but I am missing the list of tasks! :-)
Have you finished that part of the interface?
I'm also interested in the api to replace an existing app I use - my personal priorities would be:
- List all client/projects/tasks
- Ability to record Start/Stop times
Then I could re-write the application I bought, using the same interface but with the intervals back-end.
Any update on the API? We just started using intervals and we're very pleased with it. However, as a programmer I'd like more flexibility than what you have currently with your curl implementation. I understand it's still in development :D
It would be cool to build a desktop timer, iPhone app, etc.
Thanks.
I wanted to give everyone a quick update on the API.
The API is currently in development. After meeting internally with our developers, we all agreed that the best approach is going to be the REST method. Our first release of the API will allow for basic interaction with tasks, time, projects, clients, invoices, documents, and so on. Subsequent releases will further enhance the API by adding specialized methods for common use scenarios like closing tasks, starting and stopping timers, etc.
So stay tuned! The API is on its way and is going to be highly functional and versatile.
If you need help in beta testing it I'd be more than happy to help. I wouldn't mind helping write language specific implementation wrappers for PHP, Python either.
I'm just excited for the API.
I am very interested in this. I would love to move at least the interface for clients onto my own site, so I can provide more options like submitting project requests etc. I'd like a way in the API to be able to create projects, if possible.
I'm thinking about developing a simple control panel for clients hosted with me, and would love to tie Intervals into that, too.
I have an update on the API. We are putting the finishing touches on the read-only API (the writable API will be luanched soon after the read-only) and getting it ready for beta. If you would like to be a beta tester for the API, please email us and let us know and we'll add you to the list.
We recently completed the API components and documentation. The only thing left is to layer in the authentication scheme that will control access to the API. We considered several methodologies and have finally settled on one. Thanks to all of you who participated in the survey. Your feedback was invaluable. We ultimately decided to use HTTP Basic Authentication in combination with User Tokens, as explained in item #2 below. Please read on to see our completed research on API Authentication options. Meanwhile, we should have the read-only portion of the API ready to go soon enough.
Here is a page of API examples from our upcoming beta documentation.
Resource Operations 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. Sample Requests 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. Sample Response 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.
We just launched the first draft of the documentation for the API. Feel free to take a look here. The read API is not quite beta yet but we are hoping to get it functional in the next few weeks.
We just sent an email to everyone that expressed interest in the API beta. If the email doesn't arrive or if you have any questions on where things are at or next steps please feel free to email api@myintervals.com.
The API documentation can be found here https://www.myintervals.com/api/.
Your API token can be created by logging into your Intervals account and navigating to Options -> My Account -> API Access.
I am using curl to test drive the API and I am getting the following error: and then it just returns the html for the error page. This is the first time I have used curl, so please let me know if I am missing something
Error Message>curl: (6) could not resolve host: application; host not found
Command Used>curl -k -h 'Accept: application/json' -u <generated_token>:x https://api.myintervals.com/task
I also tried with our actual domain and got the same thing.
Thanks,
The only thing wrong I see with the code is the header should be proceed by a '-H' (capital H, not lowercase). I've just tested this from my laptop at home and it returned the json list of tasks.
The message about not being able to find the host makes me think there may have been a temporary routing issue to the server. Please try submitting your curl request again.
If you again get a message about the host not being found, please type 'traceroute api.myintervals.com' and send the output to api@myintervals.com.
If you get the html error page, please email the date and time of the curl request to api@myintervals.com so we can check the server logs to see what may have gone wrong.
Regards,
John
Thanks for the prompt feedback John!
I sent the information you requested to the api@myintervals.com.
I was able to resolve the host error(I think), after rereading the error message I removed the space between the colon and application in 'Accept: application/json' and I did not get the host error anymore, but still returning the "Oh Snap" html.
Thanks,
I'm trying to write a hook for Subversion where if somebody mentions "task (number)" in their commit comment, that task gets updated with a comment about what changed. I've worked out the SVN side of things but I'm having an issue with the API: it seems to use some internal ID for tasks rather than the client-visibile ID (presumably some surrogate key used for all tasks stored by Intervals across all companies).
For example, I have a task #6567 in my company's Intervals account, but I can't add a comment to it.
curl --header "Accept: application/json" --insecure -u "********" https://api.myintervals.com/task/6567
...results in:
{"personid":null,"status":"Forbidden","code":403,"error":{"code":10,"message":"User not authorized to access this information","verbose":["You don't appear to have the correct permissions to access the element you are trying to access."]}}
However, if I use a six-digit ID I found while reverse-engineering some Ajax used when viewing a task, the comment does show up. I have the same kind of error when trying to view a task using GET /task/number where number is the four-digit number used for task numbers in the UI and not the surrogate key.
Is this a known bug or am I doing something wrong?
Also got this while trying to post just now, even though my message got posted (Opera 10):
Unfortunately, our forum has been temporarily disabled due to network issues. This problem has been reported to our support team.
Please check back after a few minutes or click here and shoot us an email and we will let you know as soon as the issue has been resolved.
- Intervals Support
Strange. That error should only occur when there are database connectivity issues, which is rare. I'm going to assume that since your message went through, the request to view the result had a database mishap. Let's chalk it up as a fluke ;)
Meanwhile, to answer your question...
You are correct. The internal id for the tasks is different than the vanity id (due to primary key constraints at the database level). To update a task you need to use the internal id. One way to get that is to reverse-engineer the ajax requests, but that is the long way round (great movie, by the way). Anyways, if you use the task resource to get a list of tasks that will show you the internal id for each task. The vanity id is the localid field.
I realize now we don't have localid as a filter option for the task list resource. I'm going to forward that to our development team. Once we have the localid as an option for the task list filter, it will make it much much easier to get the internal id and other task info.
Wow, I have been wondering about this for a long time. Is there any online documentation or wiki on the Intervals API?
Thanks,
David
Are you wondering if we have a functional API? If so we do have an API. Here is a direct link to the API documentation and there is a link to the API documentation in the footer below as well.
1 to 47 of 47
Comments are closed.
For more Intervals help documentation, please visit help.myintervals.com