Examples of PHP API

You will have to create a file with .php extension for executing this.

 

  1. To fetch all projects where percent complete is > 0 and manager_id is 29863

    $rows = $api->query(array('table'=>'db_project', 'db_project.percent_complete.>' => 0, 'manager_id' => 29863));
    foreach ($rows as $row)
    {
    echo 'id=' . $row['id'];
    echo 'summary=' . $row['summary'];
    echo '<br/>';
    }
  2. To create a project

    $api->create("projects", array(
                array('project_category_id'=> 7864, 
                      'summary'=>'create by api 1',
                      'plan_start' => $api->encodeDate(2013, 6, 1),
                      'deadline' => $api->encodeDate(2013, 12, 31),
                      'manager_id' => 29863,
                      'client_id' => 29862)
                )
        );

For more details, download the PHP API here.