PHP code example of multidialogo / api-php-sdk

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

    

multidialogo / api-php-sdk example snippets


    use multidialogo\client\MultidialogoClient;
    
    $client = MultidialogoClient::builder()
        ->withHostUrl('http://rest.multidialogo.local')
        ->withPasswordCredentials('username', 'password')
        ->withLanguage('it')
        ->build();
    
    $response = $client->getJson('users/me', ['

        $client = MultidialogoClient::builder()
            ->withHostUrl('https://rest-stage.multidialogo.it')
            ->withFileTokenStorage(CLIENT_PROVIDED_FILESYSTEM_PATH)
            ->withLanguage('it')
            ->build();

        $client->getJson('geo/countries');

        $client = MultidialogoClient::builder()
            ->withHostUrl('https://rest-stage.multidialogo.it')
            ->withBearerToken($token)
            ->withLanguage('it')
            ->build();

        $client->getJson('geo/countries');
bash
composer