致命错误:未捕获异常'ActiveCollab \ Exceptions \ CallFailed',消息'HTTP error 302:Found'

时间:2016-05-24 22:26:21

标签: php activecollab

我正在尝试将Active Collab(API版本2.3.1)与activeCollab SDK(1.0.5)一起使用。因此我通过composer安装了SDK。接下来,我尝试从https://github.com/activecollab/activecollab-sdk执行下面列出的示例。

<?php

  require_once 'vendor/autoload.php';

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

  API::setUrl('MY-API-URL');
  API::setKey('MY-API-TOKEN');
  API::setConnector(new CurlConnector);

  print '<pre>';
  print_r(API::info());
  print '</pre>';

但由于任何原因,我收到以下错误:

Fatal error: Uncaught exception 'ActiveCollab\Exceptions\CallFailed' with
message 'HTTP error 302: Found' in /...path.../vendor/activecollab/ 
activecollab-sdk/ActiveCollab/Connectors/Curl.php on line 109 

ActiveCollab\Exceptions\CallFailed: HTTP error 302: Found in/...path.../  
vendor/activecollab/activecollab-sdk/ActiveCollab/Connectors/Curl.php 
on line 109

调用堆栈

{main}( )
ActiveCollab\Client::info( $property = ??? )
ActiveCollab\Client::call( $command = 'info', $additional_command_params = ???, $post_params = ???, $attachments = ??? )
ActiveCollab\Connectors\Curl->get( $url = 'https://...path.../api.php?path_info=info&auth_api_token=myToken&format=json' ) // Get valid JSON response
ActiveCollab\Connectors\Curl->execute( $http = resource(9) of type (Unknown) )

本地范围内的变量(#5)

$error_code = Undefined
$error_message = Undefined
$http = &resource(9, Unknown)
$result = string '' (length=0)
$status = int 302

有人知道我做错了吗?

0 个答案:

没有答案