-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: ignore-conflict-markers Reviewed By: liliarizona Differential Revision: D65913687 fbshipit-source-id: 84bddd1d7f60ebffb645f29e7aec13d65fc1a8d7
- Loading branch information
1 parent
3ec36fd
commit a8388bb
Showing
140 changed files
with
4,945 additions
and
1 deletion.
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,33 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
'name', | ||
); | ||
$params = array( | ||
); | ||
echo json_encode((new AdAccount($id))->getAdCreatives( | ||
$fields, | ||
$params | ||
)->getResponse()->getContent(), 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,34 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'name' => 'Sample Promoted Post', | ||
'object_story_id' => '<pageID>_<postID>', | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$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,33 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'object_story_id' => '<pageID>_<postID>', | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
34 changes: 34 additions & 0 deletions
34
examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.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,34 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'image_hash' => '<imageHash>', | ||
'object_story_spec' => array('page_id' => '<pageID>','link_data' => array('image_hash' => '<imageHash>','link' => '<canvasURI>','name' => 'Creative message','call_to_action' => array('type' => 'LEARN_MORE'))), | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
34 changes: 34 additions & 0 deletions
34
examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.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,34 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'object_story_spec' => array('page_id' => '<pageID>','template_data' => array('format_option' => 'collection_video','link' => '<canvasURI>','name' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE'),'retailer_item_ids' => array(0,0,0,0),'customization_rules_spec' => array(array('customization_spec' => array('language' => 'en_XX')),array('customization_spec' => array('language' => 'fr_XX'),'link' => '<canvasURIFR>','name' => 'French Creative title','message' => 'French Creative message')))), | ||
'product_set_id' => '<productSetID>', | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
34 changes: 34 additions & 0 deletions
34
examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.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,34 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'object_story_spec' => array('page_id' => '<pageID>','link_data' => array('picture' => '<imageURL>','link' => '<canvasURI>','name' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE'),'retailer_item_ids' => array(0,0,0,0),'customization_rules_spec' => array(array('customization_spec' => array('language' => 'en_XX')),array('customization_spec' => array('language' => 'fr_XX'),'picture' => '<imageURLFR>','link' => '<canvasURIFR>','name' => 'French Creative title','message' => 'French Creative message')))), | ||
'product_set_id' => '<productSetID>', | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$fields, | ||
$params | ||
)->exportAllData(), JSON_PRETTY_PRINT); |
34 changes: 34 additions & 0 deletions
34
examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.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,34 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'object_story_spec' => array('page_id' => '<pageID>','video_data' => array('video_id' => '<videoID>','image_url' => '<imageURL>','title' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE','value' => array('link' => '<canvasURI>')),'retailer_item_ids' => array(0,0,0,0),'customization_rules_spec' => array(array('customization_spec' => array('language' => 'en_XX')),array('customization_spec' => array('language' => 'fr_XX'),'video_id' => '<videoIDFR>','picture' => '<imageURLFR>','link' => '<canvasURIFR>','name' => 'French Creative title','message' => 'French Creative message')))), | ||
'product_set_id' => '<productSetID>', | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$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,36 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdCreative; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'name' => 'Sample Promoted', | ||
'object_story_spec' => array('page_id' => '<pageID>','link_data' => array('image_hash' => '<imageHash>','link' => '<imageURL>','message' => 'try it out')), | ||
'degrees_of_freedom_spec' => array('creative_features_spec' => 'array(\'standard_enhancements\' => \'array(\\\'enroll_status\\\' => \\\'OPT_IN\\\')\')'), | ||
'special_ad_categories' => array(), | ||
); | ||
echo json_encode((new AdAccount($id))->createAdCreative( | ||
$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,33 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdLabel; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
); | ||
$params = array( | ||
'name' => 'My Label', | ||
); | ||
echo json_encode((new AdAccount($id))->createAdLabel( | ||
$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,35 @@ | ||
<?php | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use FacebookAds\Object\AdAccount; | ||
use FacebookAds\Object\AdSet; | ||
use FacebookAds\Api; | ||
use FacebookAds\Logger\CurlLogger; | ||
|
||
$access_token = '<ACCESS_TOKEN>'; | ||
$app_secret = '<APP_SECRET>'; | ||
$app_id = '<APP_ID>'; | ||
$id = '<AD_ACCOUNT_ID>'; | ||
|
||
$api = Api::init($app_id, $app_secret, $access_token); | ||
$api->setLogger(new CurlLogger()); | ||
|
||
$fields = array( | ||
'name', | ||
'id', | ||
'status', | ||
); | ||
$params = array( | ||
); | ||
echo json_encode((new AdAccount($id))->getAdSets( | ||
$fields, | ||
$params | ||
)->getResponse()->getContent(), JSON_PRETTY_PRINT); |
Oops, something went wrong.