PHP code example of sdksio / apimatic-mx-apis-sdk
1. Go to this page and download the library: Download sdksio/apimatic-mx-apis-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/ */
sdksio / apimatic-mx-apis-sdk example snippets
use MxPlatformApiLib\Logging\LoggingConfigurationBuilder;
use MxPlatformApiLib\Logging\RequestLoggingConfigurationBuilder;
use MxPlatformApiLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use MxPlatformApiLib\Environment;
use MxPlatformApiLib\Authentication\BasicAuthCredentialsBuilder;
use MxPlatformApiLib\Authentication\BearerAuthCredentialsBuilder;
use MxPlatformApiLib\MxPlatformApiClientBuilder;
$client = MxPlatformApiClientBuilder::init()
->basicAuthCredentials(
BasicAuthCredentialsBuilder::init(
'Username',
'Password'
)
)
->bearerAuthCredentials(
BearerAuthCredentialsBuilder::init(
'AccessToken'
)
)
->environment(Environment::PRODUCTION)
->loggingConfiguration(
LoggingConfigurationBuilder::init()
->level(LogLevel::INFO)
->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
)
->build();