PHP code example of tippiti / api-client

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

    

tippiti / api-client example snippets


use Tippiti\Api\Tippiti;
use Tippiti\Api\Generated\Api\DictationApi;

$config = Tippiti::configure(token: getenv('TIPPITI_TOKEN'));
$dictations = new DictationApi(config: $config);

$response = $dictations->dictationIndex(

$dictation = $dictations->dictationShow(dictation: 'aid-xyz12345');

use Tippiti\Api\Generated\Api\DictationApi;
use Tippiti\Api\Generated\Api\AccountApi;
use Tippiti\Api\Generated\Api\FolderApi;
use Tippiti\Api\Generated\Api\InstructionSetApi;
use Tippiti\Api\Generated\Api\SubUserApi;
// ...

use Tippiti\Api\Generated\ApiException;

try {
    $response = $dictations->dictationShow(dictation: 'aid-xyz12345');
} catch (ApiException $e) {
    fwrite(STDERR, "HTTP {$e->getCode()}: {$e->getMessage()}\n");
    print_r($e->getResponseBody());
}

$config = Tippiti::configure(
    token: '...',
    baseUrl: 'https://staging.app.tippiti.io/api',
);

use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;

$stack = HandlerStack::create();
// add your middleware
$http = new Client(['handler' => $stack, 'timeout' => 30]);

$dictations = new DictationApi(client: $http, config: $config);