PHP code example of apimatic-sdksio / apimatic-sdk

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

    

apimatic-sdksio / apimatic-sdk example snippets


use ApimaticApiLib\Logging\LoggingConfigurationBuilder;
use ApimaticApiLib\Logging\RequestLoggingConfigurationBuilder;
use ApimaticApiLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use ApimaticApiLib\Environment;
use ApimaticApiLib\Authentication\CustomHeaderAuthenticationCredentialsBuilder;
use ApimaticApiLib\ApimaticApiClientBuilder;

$client = ApimaticApiClientBuilder::init()
    ->customHeaderAuthenticationCredentials(
        CustomHeaderAuthenticationCredentialsBuilder::init(
            'Authorization'
        )
    )
    ->userAgent('user-agent')
    ->environment(Environment::PRODUCTION)
    ->customUrl('https://localhost:44301/api')
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();