-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathexample.php
More file actions
32 lines (21 loc) · 755 Bytes
/
example.php
File metadata and controls
32 lines (21 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once 'ActiveCollab/autoload.php';
use \ActiveCollab\Client as API;
use \ActiveCollab\Connectors\Curl as CurlConnector;
API::setUrl('https://myaccount.manageprojects.com/api.php');
API::setKey('MY-API-TOKEN');
API::setConnector(new CurlConnector);
print '<pre>';
print "API info:\n\n";
var_dump(API::info());
print "Defined project templates:\n\n";
var_dump(API::call('projects/templates'));
print "Task creation example:\n\n";
var_dump(API::call('projects/65/tasks/add', null, array(
'task[name]' => 'This is a task name',
'task[assignee_id]' => 48,
'task[other_assignees]' => array(3, 1),
), array(
'/Library/WebServer/Documents/BZHI6GtCQAEEMz-.jpg-large.jpeg'
)));
print '</pre>';