werkspot / bing-ads-api-bundle
A service to make API calls to bing ads in Symfony
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- cpcstrategy/bing-ads-sdk-php: ~2.0
- guzzlehttp/guzzle: ~6.1
- symfony/framework-bundle: ~2.3|~3.0
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ^5.2
This package is auto-updated.
Last update: 2020-10-21 07:19:19 UTC
README
The BingAdsApiBundle provides a simple integration of the Bing Ads API for your Symfony project.
Checkout the Bing Ads full documentation
Warning: Currently in development
TODO
- Create more Reports
Installation
With composer, add:
{ "require": { "werkspot/bing-ads-api-bundle": "dev-master" } }
Then enable it in your kernel:
// app/AppKernel.php public function registerBundles() { $bundles = [ //... new Werkspot\BingAdsApiBundle\WerkspotBingAdsApiBundle(), //...
Configuration
# app/config/config.yml # Bing ads API werkspot_bing_ads_api: cache_dir: "%kernel.cache_dir%" #<-- optional
Usage
The bundle registers the werkspot.bing_ads_api_client
service witch allows you to call the api;
Get Report
use BingAds\Reporting\ReportTimePeriod; $reportType = 'GeoLocationPerformanceReportRequest'; $timePeriod = ReportTimePeriod::LastMonth; $columns = [ 'TimePeriod', 'AccountName', 'AdGroupId', 'AdGroupName', 'Impressions', 'Clicks', 'CurrencyCode', 'Spend', 'Country', 'City', 'State', 'MetroArea', 'MostSpecificLocation', ]; $apiDetails = new ApiDetails( 'refreshToken', 'clientId', 'secret', 'redirectUri', 'devToken' ); $bingApi = $this->get('werkspot.bing_ads_api_client'); $bingApi->setApiDetails($apiDetails); $arrayOfFiles = $bingApi->get($columns, $reportType, $timePeriod ); /* [...] Do something with the list */ $bingApi->clearCache(); //-- When done remove the files $newRefreshToken = $bingApi->getRefreshToken() //-- Get new RefreshToken
Credits
BingAdsApiBundle is based on the officical Bing Ads API. BingAdsApiBundle has been developed by LauLaman.