0

I am trying to use Active Collab (API version 2.3.1) with the activeCollab SDK (1.0.5). Therefore I installed the SDK via composer. Next I tried to execute the below listed example from 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>';

But for any reason I get the following error:

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

Call Stack

{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) )

Variables in local scope (#5)

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

Does anybody have an idea what I am doing wrong?

HH.
  • 197
  • 3
  • 17
  • As mentioned in the docs, that version of SDK works with Active Collab 4. SDK for Active Collab 2 has been discontinued and it is no longer available (I am not sure if we still have it somewhere in the archives). My recommendation is that you upgrade your Active Collab. – Ilija May 25 '16 at 04:05
  • @Ilija: Thanks for clarification. – HH. May 25 '16 at 04:31

0 Answers0