Not signed in (Sign In)
  • What is Intervals?

    Intervals is online time, task and project management software built by and for web designers, developers and creatives. Learn moreā€¦

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

API PHP Code Sample: People List

Bottom of Page

  1.  
    • jreeve
    • May 21st 2010 edited @ 05/21/2010 10:08 am
     

    The following code PHP requires the Curl library and shows how to request and parse a people list. In this example we will query the people list for all people with the same email domain.

    Documentation for the person resource can be found here:
    https://www.myintervals.com/api/resource.php?r=person


    //set some variables
    $apiToken = ""; // set this value to your API token

    //initialize the curl handler
    $ch = curl_init();
    //set options
    curl_setopt($ch, CURLOPT_URL, "https://api.myintervals.com/person/?email=pelagodesign.com");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERPWD, $apiToken . ":");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json")); //application/xml is also a valid header
    //query the API and parse the resulting json code into an array
    $response = json_decode(curl_exec($ch);)
    //close the curl handler
    curl_close($ch);

    //output the results
    print_r($response);

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