Not signed in (Sign In)
The Intervals Forum is read-only
Please head to help.myintervals.com for help articles and guides. If you have any questions, please contact our support team.

API

Javascript Help

Bottom of Page

1 to 3 of 3

  1.  
  1.  

    I'm, unfortunately, not a developer, and the intricacies of the restful APIs are a little overwhelming to me. We use SOAP and web services for our own APIs, and while they are (also) somewhat over my head, once I see a javascript snippet that leverages one of our APIs, I can usually hack out a script that will leverage the other ones.

    So, and forgive me if this is too stupid for words...

    Is it possible to write javascript that will leverage Intervals APIs?

    If so, would some kind soul be willing to post what such a script would look like that, for example, passes the authentication string and then outputs a task list (or virtually any other simple GET or PUT function)?

  2.  
    Yes, you can build API requests with javascript. The prototype library is a good place to start looking, but is likely more developer intense. Some other JS libraries to look at are jquery and ext.
  3.  

    The jQuery library is perfectly suited for this. Observe a get request for all tasks:

    $.ajax({
    url: "https://api.myintervals.com/task/",
    dataType: "json",
    headers: {
    authorization: "Basic " + Base64.encode(api_token+":x"),
    nocache: Math.random()
    },
    success: function(data, code, jqx) {
    alert("it worked, and here's the response data: " + data);
    },
    error: function(jqx, err, ex) {
    alert("FAIL: " + err);
    },
    complete: function(jqx, status) {
    console.log("request complete");
    }
    });

Comments are closed.
For more Intervals help documentation, please visit help.myintervals.com