Help for calling Kanboard API from jsonRPC client

Hello,
I am trying to use the kanboard API with PHP to do some tests. I successfully tested with cURL, but I’m having trouble getting started with a jsonRPC client.
I need help just to get started. If any of you can show me a snippet of calling code, I think it will unblock me.

my code :


   <?php

   require __DIR__ . '/vendor/autoload.php';

   defined('KB_URL') or define('KB_URL', "https://kb_demo.my.local");
   defined('KB_TOKEN') or define('KB_TOKEN', "123123123123123123123123123123123123");


   use JsonRPC\Client;
   $client = new Client(KB_URL);

   /*
    * First call : ok
    */
   $result =  $client->getHttpClient()
   ->withDebug()
   ->withUsername('jsonrpc')
   ->withPassword(KB_TOKEN);
   print_r($result);

   /*
    * second call : Ko
    */
   $result =  $client->getHttpClient()
   ->getAllProjects()
   ->withUsername('jsonrpc')
   ->withPassword(KB_TOKEN)
   ;
   print_r($result);

The first test get :

JsonRPC\HttpClient Object
(
    [url:protected] => https://kb_demo.my.local
    [timeout:protected] => 5
    [headers:protected] => Array
(
    [0] => User-Agent: JSON-RPC PHP Client <https://github.com/fguillot/JsonRPC>
    [1] => Content-Type: application/json
    [2] => Accept: application/json
    [3] => Connection: close
        )

    [username:protected] => jsonrpc
[password:protected] => abc123lkdfgj65d4f6qs5dg4q6ds5g4qsdg5sdq6g54qs
[debug:protected] => 1
    [cookies:protected] => Array
(
)

[verifySslCertificate:protected] => 1
    [sslLocalCert:protected] =>
    [beforeRequest:protected] =>
)

The last give me an error :

PHP Fatal error: Uncaught Error: Call to undefined method JsonRPC\HttpClient::getAllProjects()

Thank you in advance !

I Progress , and now, I think my problem is arround autentication with JsonRPC for a site where ssl certificate is selfsigned … (develop environnement)


echo "\n####################### Sample with JsonRPC Client => debug ################################\n";
/*
 * Sample with JsonRPC Client => debug
 */
defined('KB_URL') or define('KB_URL', "https://kb_demo.my.local/jsonrpc.php");
defined('KB_TOKEN') or define('KB_TOKEN', "12312312312331313131311313365645");

$client = new JsonRPC\Client(KB_URL);
$result =  $client->getHttpClient()
    ->withDebug()
    ->withUsername('jsonrpc')
    ->withPassword(KB_TOKEN)
    ->withoutSslVerification();
print_r($result);


echo "\n########################## Sample getAllProjects() => KO #################################\n";
print_r( $client->getAllProjects() );

Give me :

  ####################### Sample with JsonRPC Client => debug ################################
JsonRPC\HttpClient Object
(
    [url:protected] => https://kb_demo.my.local/jsonrpc.php
    [timeout:protected] => 5
    [headers:protected] => Array
        (
            [0] => User-Agent: JSON-RPC PHP Client <https://github.com/fguillot/JsonRPC>
            [1] => Content-Type: application/json
            [2] => Accept: application/json
            [3] => Connection: close
        )

    [username:protected] => jsonrpc
    [password:protected] => 12312312312331313131311313365645
    [debug:protected] => 1
    [cookies:protected] => Array
        (
        )

    [verifySslCertificate:protected] =>
    [sslLocalCert:protected] =>
    [beforeRequest:protected] =>
)

########################## Sample getAllProjects() => KO #################################
PHP Fatal error:  Uncaught JsonRPC\Exception\ConnectionFailureException: Unable to establish a connection in /dataweb/csv2kanboard/jsonRPC/vendor/fguillot/json-rpc/src/JsonRPC/HttpClient.php:296
Stack trace:
#0 /dataweb/csv2kanboard/jsonRPC/vendor/fguillot/json-rpc/src/JsonRPC/Client.php(194): JsonRPC\HttpClient->execute('{"jsonrpc":"2.0...', Array)
#1 /dataweb/csv2kanboard/jsonRPC/vendor/fguillot/json-rpc/src/JsonRPC/Client.php(177): JsonRPC\Client->sendPayload('{"jsonrpc":"2.0...', Array)
#2 /dataweb/csv2kanboard/jsonRPC/vendor/fguillot/json-rpc/src/JsonRPC/Client.php(119): JsonRPC\Client->execute('getAllProjects', Array)
#3 /dataweb/csv2kanboard/jsonRPC/kbapiJsonRPC.php(65): JsonRPC\Client->__call('getAllProjects', Array)
#4 {main}
  thrown in /dataweb/csv2kanboard/jsonRPC/vendor/fguillot/json-rpc/src/JsonRPC/HttpClient.php on line 296