PHP code example of sdksio / apimatic-semgrep-sdk

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


use SemgrepWebAppLib\Logging\LoggingConfigurationBuilder;
use SemgrepWebAppLib\Logging\RequestLoggingConfigurationBuilder;
use SemgrepWebAppLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use SemgrepWebAppLib\Environment;
use SemgrepWebAppLib\Authentication\SemgrepAdminJwtCredentialsBuilder;
use SemgrepWebAppLib\Authentication\SemgrepJwtCredentialsBuilder;
use SemgrepWebAppLib\Authentication\SemgrepWebTokenCredentialsBuilder;
use SemgrepWebAppLib\SemgrepWebAppClientBuilder;

$client = SemgrepWebAppClientBuilder::init()
    ->semgrepAdminJwtCredentials(
        SemgrepAdminJwtCredentialsBuilder::init(
            'AccessToken'
        )
    )
    ->semgrepJwtCredentials(
        SemgrepJwtCredentialsBuilder::init(
            'AccessToken'
        )
    )
    ->semgrepWebTokenCredentials(
        SemgrepWebTokenCredentialsBuilder::init(
            'AccessToken'
        )
    )
    ->environment(Environment::PRODUCTION)
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();