PHP code example of oxy-coach / aliexpress-api-client-local

1. Go to this page and download the library: Download oxy-coach/aliexpress-api-client-local 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/ */

    

oxy-coach / aliexpress-api-client-local example snippets


use Simla\Component\AppData;
use Simla\Factory\ClientFactory;

$client = ClientFactory::createClient(
    AppData::ENDPOINT,
    'your jwt token'
);

use Simla\Model\Request\GetOrderListRequest;

$request = new GetOrderListRequest();

/** @var \Simla\Model\Response\GetOrderListResponse $response */
$response = $client->sendRequest(new GetOrderListRequest());

use Http\Client\Curl\Client;
use Simla\Component\AppData;
use Simla\Component\Environment;
use Nyholm\Psr7\Factory\Psr17Factory;
use Simla\Builder\ClientBuilder;
use Simla\Builder\ContainerBuilder;
use Simla\Component\Logger\StdoutLogger;

$client = new Client();
$logger = new StdoutLogger();
$factory = new Psr17Factory();
$appData = new AppData(AppData::ENDPOINT, 'jwt token');
$container = ContainerBuilder::create()
            ->setEnv(Environment::TEST)
            ->setClient($client)
            ->setLogger($logger)
            ->setStreamFactory($factory)
            ->setRequestFactory($factory)
            ->setUriFactory($factory)
            ->build();
$client = ClientBuilder::create()
            ->setContainer($container)
            ->setAppData($appData)
            ->build();

use Simla\Component\AppData;
use Simla\Builder\ClientBuilder;
use Simla\Builder\ContainerBuilder;

$appData = new AppData(AppData::ENDPOINT, 'jwt token');
$client = ClientBuilder::create()
            ->setContainer(ContainerBuilder::create()->build())
            ->setAppData($appData)
            ->build();