Download the PHP package villaflor/taboola-sdk without Composer

On this page you can find all versions of the php package villaflor/taboola-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package taboola-sdk

Connecting to the Taboola API has never been easier.


This package contains the open source PHP SDK, which allows your PHP application to connect to the Taboola Platform.

Requirement

Note: Request your client_id and client_secret from your Taboola Account Manager. Your account_id, as well as your client id and client secret, are supplied to you throughout the API onboarding process.

Installation

In the root application directory, run this command.

composer require villaflor/taboola-sdk

Usage

use Villaflor\Connection\Auth\APIToken;
use Villaflor\Connection\Auth\None;
use Villaflor\TaboolaSDK\Configurations\Account\AccountDetailsConfiguration;
use Villaflor\TaboolaSDK\Configurations\Account\AdvertiserAccountsInNetworkConfiguration;
use Villaflor\TaboolaSDK\Configurations\Account\AllowedAccountsConfiguration;
use Villaflor\TaboolaSDK\Configurations\AuthenticationConfiguration;
use Villaflor\TaboolaSDK\Configurations\Campaigns\AllCampaignsConfiguration;
use Villaflor\TaboolaSDK\Configurations\Reporting\CampaignSummaryConfiguration;
use Villaflor\TaboolaSDK\Configurations\Reporting\TopCampaignContentConfiguration;
use Villaflor\TaboolaSDK\Definitions\AllCampaignsFilterDefinition;
use Villaflor\TaboolaSDK\Definitions\CampaignSummaryDimensionDefinition;
use Villaflor\TaboolaSDK\Definitions\CampaignSummaryFilterDefinition;
use Villaflor\TaboolaSDK\Definitions\TopCampaignContentDimensionDefinition;
use Villaflor\TaboolaSDK\Definitions\TopCampaignContentFilterDefinition;
use Villaflor\TaboolaSDK\Endpoints\Account;
use Villaflor\TaboolaSDK\Endpoints\Authentication;
use Villaflor\TaboolaSDK\Endpoints\Campaigns;
use Villaflor\TaboolaSDK\Endpoints\Reporting;
use Villaflor\TaboolaSDK\TaboolaClient;

class MyClass
{
    public function __inovke()
    {
        $clientID = '1234abcd123abcd';
        $clientSecret = '1234567890qwertyui';
        $accountId = 'demo-account-001';

        $accessToken = $this->getAccessToken(
            new Authentication(new TaboolaClient(new None())),
            new AuthenticationConfiguration($clientID, $clientSecret)
        );

        var_dump($accessToken);

        $auth = new APIToken($accessToken);
        $taboolaClient = new TaboolaClient($auth);

        $accountDetails = $this->getAccountDetails(
            new Account($taboolaClient),
            new AccountDetailsConfiguration()
        );

        var_dump($accountDetails);

        $advertiserAccountsInNetwork = $this->getAdvertiserAccountsInNetwork(
            new Account($taboolaClient),
            new AdvertiserAccountsInNetworkConfiguration($accountId)
        );

        var_dump($advertiserAccountsInNetwork);

        $allowedAccounts = $this->getAllowedAccounts(
            new Account($taboolaClient),
            new AllowedAccountsConfiguration(),
        );

        var_dump($allowedAccounts);

        $allCampaigns = $this->getAllCampaigns(
            new Campaigns($taboolaClient),
            new AllCampaignsConfiguration($accountId, [
                AllCampaignsFilterDefinition::FETCH_LEVEL => AllCampaignsFilterDefinition::FETCH_LEVEL_RECENT_AND_PAUSED_OPTIONS
            ])
        );

        var_dump($allCampaigns);

        $campaignSummaryReport = $this->getCampaignSummaryReport(
            new Reporting($taboolaClient),
            new CampaignSummaryConfiguration(
                $accountId,
                CampaignSummaryDimensionDefinition::CAMPAIGN_DAY_BREAKDOWN,
                [
                    CampaignSummaryFilterDefinition::START_DATE => '2021-08-01',
                    CampaignSummaryFilterDefinition::END_DATE => '2021-08-01',
                ]
            )
        );

        var_dump($campaignSummaryReport);

        $topCampaignContentReport = $this->getTopCampaignContentReport(
            new Reporting($taboolaClient),
            new TopCampaignContentConfiguration(
                $accountId,
                TopCampaignContentDimensionDefinition::ITEM_BREAKDOWN,
                [
                    TopCampaignContentFilterDefinition::START_DATE => '2021-08-01',
                    TopCampaignContentFilterDefinition::END_DATE => '2021-08-01',
                ]
            )
        );

        var_dump($topCampaignContentReport);
    }

    private function getAccessToken($service, $config)
    {
        $result = $service->getAccessToken($config);

        return $result->body->access_token;
    }

    private function getAccountDetails($service, $config)
    {
        return $service->getAccountDetails($config);
    }

    private function getAdvertiserAccountsInNetwork($service, $config)
    {
        return $service->getAdvertiserAccountsInNetwork($config);
    }

    private function getAllowedAccounts($service, $config)
    {
        return $service->getAllowedAccounts($config);
    }

    private function getAllCampaigns($service, $config)
    {
        return $service->getAllCampaigns($config);
    }

    private function getCampaignSummaryReport($service, $config)
    {
        return $service->getCampaignSummaryReport($config);
    }

    private function getTopCampaignContentReport($service, $config)
    {
        return $service->getTopCampaignContentReport($config);
    }
}

All versions of taboola-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-json Version *
guzzlehttp/guzzle Version ^7.3
villaflor/connection Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package villaflor/taboola-sdk contains the following files

Loading the files please wait ....