主动协作-连接v4

时间:2019-10-29 14:26:30

标签: php json api connection activecollab

Hellow,我尝试连接我的ActiveCollab帐户,但不能保证,但是我认为让它成为版本4,在查找文档,查看文档之后,我最终下载了他们的SDK,但是当我输入密钥和我的令牌,它将所有值返回为null,有人可以帮助我吗?

我的代码:

<?php

 require_once 'ActiveCollab/autoload.php';

 use \ActiveCollab\Client as API;
 use \ActiveCollab\Connectors\Curl as CurlConnector;
 use ActiveCollab\Exceptions\AppException;

 API::setUrl('x');
 API::setKey('x');
 API::setConnector(new CurlConnector);

 print '<pre>';

 print "API info:\n\n";

 var_dump(API::info());

 print "template project:\n\n";

 var_dump(API::call('projects/templates'));

 print "create task:\n\n";
try {
 var_dump(API::call('projects/x/task/add', null, array(
   'task[name]' => 'Teste 1',
   'task[assignee_id]' => x,
   //'task[other_assignees]' => array(3, 1),
   'task[body]' => 'Aqui vai todo o conteudo da tarefa',
 ), array(
   'C:\Users\x\Documents\Capturar.JPG'
 )));

 print '</pre>';
} catch (AppException $e) {
 print "Erro: \n";
 print $e -> getMessage() . '</br></br>';
 var_dump($e -> getServerResponse());
}

那是我的回报: enter image description here

0 个答案:

没有答案