PHP code example of keboola / syrup-php-client

1. Go to this page and download the library: Download keboola/syrup-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

keboola / syrup-php-client example snippets






use Keboola\Syrup\Client,

$client = new Client([
  'token' => 'YOUR_TOKEN',
  'runId' => 'CURRENT_RUNID'
]);

$response = $client->runJob("test-component", array("config" => 1));



use Keboola\Syrup\Client,

$client = new Client([
  'token' => 'YOUR_TOKEN',
  'runId' => 'CURRENT_RUNID',
  'super' => 'docker'
]);

$response = $client->encryptString("test-component", "string", ["path" => "configs"]);



use Keboola\Syrup\Client,

$client = new Client([
  'token' => 'YOUR_TOKEN',
  'runId' => 'CURRENT_RUNID',
  'super' => 'provisioning'
]);

$response = $client->runAsyncAction("async/docker", "POST", ["body" => ["type" => "rstudio"]]);



use Keboola\Syrup\Client,

$client = new Client([
  'token' => 'YOUR_TOKEN',
  'runId' => 'CURRENT_RUNID',
  'super' => 'provisioning'
]);

$response = $client->runAsyncAction("async/docker/1", "DELETE");
json
{
    "hp" : ">=5.4.0",
        "keboola/syrup-php-client": "2.0.*"
    }
}