forked from facebook/facebook-php-business-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: The controller you requested could not be found. Reviewed By: jingping2015 Differential Revision: D10473070 fbshipit-source-id: 16bffcd2
1 parent
649e6ca
commit 96f5849
Showing
39 changed files
with
1,341 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Code of Conduct | ||
|
||
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Contributing to Facebook Ads API SDK for PHP | ||
We want to make contributing to this project as easy and transparent as | ||
possible. | ||
|
||
## Code of Conduct | ||
The code of conduct is described in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) | ||
|
||
## Our Development Process | ||
The Facebook Ads API SDK for PHP is currently developed in Facebook's internal | ||
repositories and then exported out to GitHub by a Facebook team member. We invite | ||
you to submit pull requests directly to GitHub and, after review, these can be | ||
merged into the project. | ||
|
||
## Pull Requests | ||
We actively welcome your pull requests. | ||
|
||
1. Fork the repo and create your branch from `master`. | ||
2. If you've added code that should be tested, add tests. | ||
3. If you've changed APIs, update the documentation. | ||
4. Ensure the test suite passes. | ||
5. Make sure your code lints. | ||
6. If you haven't already, complete the Contributor License Agreement ("CLA"). | ||
|
||
## Contributor License Agreement ("CLA") | ||
In order to accept your pull request, we need you to submit a CLA. You only need | ||
to do this once to work on any of Facebook's open source projects. | ||
|
||
Complete your CLA [here](https://code.facebook.com/cla) | ||
|
||
## Issues | ||
Since we want to handle bugs more efficiently, we encourage you report bug to | ||
our dedicated bug reporting channel. If you encounter a bug with Business SDK | ||
(PHP), please report the issue at | ||
[our developer bug reporting channel](https://developers.facebook.com/support/bugs/). | ||
|
||
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe | ||
disclosure of security bugs. In those cases, please go through the process | ||
outlined on that page | ||
|
||
## Coding Style | ||
Please follow [PHP Coding Standards](https://secure.phabricator.com/book/phabcontrib/article/php_coding_standards/) | ||
|
||
## License | ||
By contributing to Facebook Ads API SDK for PHP, you agree that your contributions | ||
will be licensed under the LICENSE file in the root directory of this source tree. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. | ||
* | ||
* You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
* use, copy, modify, and distribute this software in source code or binary | ||
* form for use in connection with the web services and APIs provided by | ||
* Facebook. | ||
* | ||
* As with any software that integrates with the Facebook platform, your use | ||
* of this software is subject to the Facebook Developer Principles and | ||
* Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
* shall be included in all copies or substantial portions of the software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
'name', | ||
'object_story_id', | ||
); | ||
$params = array( | ||
); | ||
echo json_encode((new AdCreative($id))->getSelf( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. | ||
* | ||
* You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
* use, copy, modify, and distribute this software in source code or binary | ||
* form for use in connection with the web services and APIs provided by | ||
* Facebook. | ||
* | ||
* As with any software that integrates with the Facebook platform, your use | ||
* of this software is subject to the Facebook Developer Principles and | ||
* Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
* shall be included in all copies or substantial portions of the software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
'link_destination_display_url', | ||
); | ||
$params = array( | ||
); | ||
echo json_encode((new AdCreative($id))->getSelf( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. | ||
* | ||
* You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
* use, copy, modify, and distribute this software in source code or binary | ||
* form for use in connection with the web services and APIs provided by | ||
* Facebook. | ||
* | ||
* As with any software that integrates with the Facebook platform, your use | ||
* of this software is subject to the Facebook Developer Principles and | ||
* Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
* shall be included in all copies or substantial portions of the software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Object\AdPreview; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'ad_format' => 'DESKTOP_FEED_STANDARD', | ||
'product_item_ids' => array('<productItemID>'), | ||
); | ||
echo json_encode((new AdCreative($id))->getPreviews( | ||
$fields, | ||
$params | ||
)->getResponse()->getContent(), JSON_PRETTY_PRINT); |
48 changes: 48 additions & 0 deletions
48
examples/BusinessOwnedProductCatalogsPostDestinationCatalog.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. | ||
* | ||
* You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
* use, copy, modify, and distribute this software in source code or binary | ||
* form for use in connection with the web services and APIs provided by | ||
* Facebook. | ||
* | ||
* As with any software that integrates with the Facebook platform, your use | ||
* of this software is subject to the Facebook Developer Principles and | ||
* Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
* shall be included in all copies or substantial portions of the software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\Business; | ||
use FacebookAds\Object\ProductCatalog; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'name' => 'Test Destination Catalog', | ||
'vertical' => 'destinations', | ||
); | ||
echo json_encode((new Business($id))->createOwnedProductCatalog( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
48 changes: 48 additions & 0 deletions
48
examples/BusinessOwnedProductCatalogsPostFlightCatalog.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. | ||
* | ||
* You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
* use, copy, modify, and distribute this software in source code or binary | ||
* form for use in connection with the web services and APIs provided by | ||
* Facebook. | ||
* | ||
* As with any software that integrates with the Facebook platform, your use | ||
* of this software is subject to the Facebook Developer Principles and | ||
* Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
* shall be included in all copies or substantial portions of the software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\Business; | ||
use FacebookAds\Object\ProductCatalog; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'name' => 'Test Flight Catalog', | ||
'vertical' => 'flights', | ||
); | ||
echo json_encode((new Business($id))->createOwnedProductCatalog( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. | ||
* | ||
* You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
* use, copy, modify, and distribute this software in source code or binary | ||
* form for use in connection with the web services and APIs provided by | ||
* Facebook. | ||
* | ||
* As with any software that integrates with the Facebook platform, your use | ||
* of this software is subject to the Facebook Developer Principles and | ||
* Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
* shall be included in all copies or substantial portions of the software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\Business; | ||
use FacebookAds\Object\ProductCatalog; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'name' => 'Test Hotel Catalog', | ||
'vertical' => 'hotels', | ||
); | ||
echo json_encode((new Business($id))->createOwnedProductCatalog( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
Oops, something went wrong.