PHP code example of katsana / katsana-sdk-php

1. Go to this page and download the library: Download katsana/katsana-sdk-php 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/ */

    

katsana / katsana-sdk-php example snippets




use Katsana\Sdk\Client;

$katsana = Client::make('client-id', 'client-secret');



use Katsana\Sdk\Client;

$katsana = Client::personal('personal-access-token');

$katsana->onTimeZone('Asia/Kuala_Lumpur');

$vehicles = $katsana->uses('Vehicles');
$vehicles->onTimeZone('Asia/Kuala_Lumpur');

$response = $katsana->uses('Welcome')->hello();

var_dump($response->toArray());

$response->getBody();

$response->toArray();

$response->getStatusCode();

$response->isSuccessful();

$response->isUnauthorized();

$response->getHeaders(); // get all headers as array.
$response->hasHeader('Content-Type'); // check if `Content-Type` header exist.
$response->getHeader('Content-Type'); // get `Content-Type` header.

$vehicles = $katsana->uses('Vehicles'); 

$response = $vehicles->all(); 

$vehicles = $katsana->via(new Katsana\Sdk\One\Vehicles());

$response = $vehicles->all();
json
{
    "atsana/katsana-sdk-php": "^1.2",
        "php-http/guzzle6-adapter": "^2.0"
    }
}