API and Activity Arguments


When I make a get request with only the first argument ("/activity/") it works as expected. But if I add an array as the second argument, the _request function in Client.php throws an exception, but the exception is empty with no info. Here's my code:


$data = array(
        'path'     => '/Public Downloads/Syntorial-Demo-Installer.msi',

    $response = $client->get("/activity/", $data);
    echo "pages: " . $response['pages'];

catch(Exception $e)
    echo 'Message : ' . $e->getMessage();

This happens no matter what I fill the $data array with. I've tried 'page', 'limit', etc. Always the same empty exception. Any ideas?

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • 1. What is the name of the exception? The client has specific exceptions for a two kinds of errors.

    2. Also, try echoing the $response right after the call to $client->get().

    3. If that doesn't give you any more information do like we did here:


    Bypass the get function and use the doRequest() function. Then, echo the $response right after that.

    $response = $client->doRequest('/activity/', 'get', $data);
    echo $response;
    Reply Like
  • 1. The exception is Service_SmartFile_ResponseException

    2/3. $response is empty.

    Bypassing the get, also results in an empty $response. 

    I've tried echoing the $response in the get( method, as well as in a few of the other methods called, but they all come back empty.

    I am getting the following php error:

    Deprecated: Function split() is deprecated in 
    /home5/syntoria/Smartfile/Client.php on line 
    Notice: Undefined offset: 2 in 
    /home5/syntoria/Smartfile/Client.php on line 
    Notice: Undefined offset: 1 in 
    /home5/syntoria/Smartfile/Client.php on line 

    Line 212 is:

    list($ignored, $http_status, $ignored) = split(' ', $headers);​

    Does this php error clue you into what's going wrong in Client.php?

    Reply Like
  • The php errors do help. Check of the php docs:


    You can see that split() is deprecated as of php 5.3. Assuming you are using php 5.3 or newer.

    Replace it with preg_split is also recommended in the docs:

    Given that we are splitting on a space, changing to preg should work without issue.

    In the future, Googling your php errors will save you time waiting for a response.

    Reply Like
Like Follow
  • 5 yrs agoLast active
  • 3Replies
  • 873Views
  • 2 Following