PHP code example of keyqcloud / kyte-api-php

1. Go to this page and download the library: Download keyqcloud/kyte-api-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/ */

    

keyqcloud / kyte-api-php example snippets




use Kyte\Api\Client;

$publicKey = 'your-public-key';
$privateKey = 'your-private-key';
$kyteAccount = 'your-kyte-account';
$kyteIdentifier = 'your-kyte-identifier';
$kyteEndpoint = 'your-kyte-endpoint';
$kyteAppId = 'your-kyte-app-id'; // Optional

$client = new Client($publicKey, $privateKey, $kyteAccount, $kyteIdentifier, $kyteEndpoint, $kyteAppId);

$sessionDetails = $client->createSession($username, $password);

$response = $client->post('model', $data);

$response = $client->get('model', 'field', 'value');

$response = $client->put('model', 'field', 'value', $data);

$response = $client->delete('model', 'field', 'value');

try {
    $response = $client->get('model', 'field', 'value');
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}