PHP code example of brandlive / vtex-api

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

    

brandlive / vtex-api example snippets



$catalogClient = new \Vtex\Catalog\CatalogClient([
    'credentials' => [
        'accountName' => "account name",
        'environment' => "environment",
        'appKey' => 'app key',
        'appToken' => 'app token',
    ]
]);

try {
    /**
     * Argument Options:
     * pathParams
     * queryParams
     * body
    */
    $catalogClient->getAttachment([
        'pathParams' => [
            'attachmentid' => 1
        ]
    ]);
} catch (\Vtex\Exception\VtexException $vtexException) {
    echo $vtexException->getMessage();
}