PHP code example of spinque / query-api

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

    

spinque / query-api example snippets




= new Api(
    array(
        'workspace' => 'course-chris',
        'config' => 'default',
        'api' => 'movies'
    )
);


$queries = [
    new Query('movie_search', array('query' => 'Keanu Reeves'))
];

try {
    echo $api->fetch($queries);
} catch (Exception $e) {
    echo $e;
}



= new Api(
    array(
        'workspace' => 'course-chris',
        'config' => 'default',
        'api' => 'movies',
        'authentication' => array(
            'authServer' => 'https://login.spinque.com',
            'clientId' => '<CLIENT-ID>',
            'clientSecret' => '<CLIENT-SECRET>',
        )
    )
);
bash
$ php composer.phar update