1. Go to this page and download the library: Download perf2k2/direct 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/ */
perf2k2 / direct example snippets
$reference = new ReferenceClient(
new Connection(new Credential('token', 'client')),
new JsonReader()
);
$criteria = (new AdsSelectionCriteria())
->setCampaignIds([1000])
->setTypes([AdTypeEnum::TEXT_AD()]);
$method = $reference
->getAdsService()
->getGetMethod()
->setSelectionCriteria($criteria)
->setFieldNames([AdFieldEnum::Id, AdFieldEnum::State])
->setTextAdFieldNames([
TextAdFieldEnum::VCardId,
TextAdFieldEnum::Href,
TextAdFieldEnum::SitelinkSetId,
]);
$data = $reference->process($method)->getResult('Ads');