From a8388bb7a9f32e63ec6f5123a100f653a756f977 Mon Sep 17 00:00:00 2001 From: Satwika Reddy Maddi Date: Wed, 13 Nov 2024 17:27:59 -0800 Subject: [PATCH] Auto-generated php SDK code update Summary: ignore-conflict-markers Reviewed By: liliarizona Differential Revision: D65913687 fbshipit-source-id: 84bddd1d7f60ebffb645f29e7aec13d65fc1a8d7 --- examples/AdAccountAdCreativesEdge.php | 33 ++++ examples/AdAccountAdCreativesPost.php | 34 ++++ ...AccountAdCreativesPostCreateAdCreative.php | 33 ++++ ...tAdCreativesPostCreateAdCreativeCanvas.php | 34 ++++ ...tCreateAdCreativeCustomizationCanvasDV.php | 34 ++++ ...eateAdCreativeCustomizationCanvasImage.php | 34 ++++ ...eateAdCreativeCustomizationCanvasVideo.php | 34 ++++ .../AdAccountAdCreativesPostEnrollStatus.php | 36 ++++ examples/AdAccountAdLabelsPost.php | 33 ++++ examples/AdAccountAdSetsEdge.php | 35 ++++ .../AdAccountAdSetsPostAdSetCreateCpa.php | 45 +++++ ...countAdSetsPostAdSetCreateCpaAppEvents.php | 43 +++++ .../AdAccountAdSetsPostBehaviorTargeting.php | 39 +++++ examples/AdAccountAdSetsPostBidMultiplier.php | 42 +++++ examples/AdAccountAdSetsPostCreateAdSet.php | 42 +++++ ...AccountAdSetsPostCreateAudienceNetwork.php | 39 +++++ examples/AdAccountAdSetsPostCreateMAIA.php | 41 +++++ examples/AdAccountAdSetsPostDailyBudget20.php | 42 +++++ ...dAccountAdSetsPostDemographicTargeting.php | 41 +++++ .../AdAccountAdSetsPostInterestTargeting.php | 41 +++++ ...etsPostLifetimeBudget200Duration10Days.php | 42 +++++ ...ccountAdSetsPostOptimizePostEngagement.php | 42 +++++ examples/AdAccountAdSetsPostPageLikes.php | 41 +++++ .../AdAccountAdSetsPostPlacementTargeting.php | 40 +++++ examples/AdAccountAdSetsPostReach.php | 41 +++++ examples/AdAccountAdVideosPost.php | 33 ++++ examples/AdAccountAdsEdge.php | 34 ++++ .../AdAccountAdsPixelEdgeGetPixelCode.php | 32 ++++ examples/AdAccountAdsPixelsPost.php | 33 ++++ examples/AdAccountAdsPost.php | 36 ++++ examples/AdAccountAdsPostAdsRedownload.php | 37 +++++ .../AdAccountAdsPostAuthorizationCategory.php | 37 +++++ ...AdAccountAdsPostTrackingPostEngagement.php | 37 +++++ examples/AdAccountCampaignsEdge.php | 35 ++++ examples/AdAccountCampaignsPost.php | 156 ++++++++++++++++++ examples/AdAccountCampaignsPostCategories.php | 38 +++++ .../AdAccountCampaignsPostDailyBudget.php | 37 +++++ examples/AdAccountCampaignsPostLeadGen.php | 36 ++++ examples/AdAccountCampaignsPostLinkClicks.php | 36 ++++ .../AdAccountCampaignsPostLocalAwareness.php | 36 ++++ examples/AdAccountCampaignsPostMAIA.php | 36 ++++ examples/AdAccountCampaignsPostMAIDPA.php | 36 ++++ examples/AdAccountCampaignsPostPageLikes.php | 36 ++++ .../AdAccountCampaignsPostPostEngagement.php | 36 ++++ examples/AdAccountCampaignsPostVideoViews.php | 36 ++++ examples/AdAccountCustomAudiencesEdge.php | 33 ++++ ...ntCustomAudiencesEdgeDataSourceSubtype.php | 34 ++++ ...ustomAudiencesPostCreateCustomAudience.php | 36 ++++ ...EventValueBasedLookalikeCustomAudience.php | 35 ++++ ...namicValueBasedLookalikeCustomAudience.php | 35 ++++ ...ncesPostPlatformCustomAudienceMACARule.php | 35 ++++ ...stomAudiencesPostPlatformECAExclusions.php | 35 ++++ ...omAudiencesPostPlatformECAMultiFilters.php | 35 ++++ ...stomAudiencesPostPlatformECAMultiPages.php | 35 ++++ ...esPostPlatformEngagementCustomAudience.php | 35 ++++ ...encesPostPlatformWebsiteCustomAudience.php | 35 ++++ ...mAudiencesPostValueBasedCustomAudience.php | 36 ++++ ...sPostValueBasedLookalikeCustomAudience.php | 36 ++++ examples/AdAccountGeneratePreviewsEdge.php | 34 ++++ ...GeneratePreviewsEdgeDesktopWithStoryId.php | 34 ++++ ...GeneratePreviewsEdgeInstagramStandards.php | 34 ++++ ...atePreviewsEdgeMaiaWithObjectStorySpec.php | 34 ++++ examples/AdAccountNode.php | 32 ++++ ...oductAudiencesPostIphoneViewNoPurchase.php | 36 ++++ ...dAccountProductAudiencesPostNoPurchase.php | 36 ++++ examples/AdAccountReachEstimate.php | 33 ++++ examples/AdCampaignAdsEdge.php | 34 ++++ examples/AdCampaignGroupAdsEdge.php | 33 ++++ ...GroupAdsEdgeAdgroupsWithStatusArchived.php | 34 ++++ examples/AdCampaignGroupAdsetsEdge.php | 37 +++++ examples/AdCampaignNode.php | 32 ++++ examples/AdCampaignNodeRead.php | 33 ++++ examples/AdCampaignNodeReadFormatUNIX.php | 36 ++++ examples/AdCampaignPost.php | 32 ++++ examples/AdCampaignPostAdsetUpdateCpa.php | 35 ++++ examples/AdCreativeNode.php | 32 ++++ examples/AdCreativeNodeRead.php | 33 ++++ ...dCreativeNodeReadInstagramPermalinkUrl.php | 32 ++++ examples/AdCreativePreviewsEdge.php | 34 ++++ examples/AdCreativePreviewsEdgePreview.php | 33 ++++ ...dCreativePreviewsEdgePreviewDynamicAds.php | 34 ++++ ...dgePreviewDynamicAdsWithCustomizations.php | 35 ++++ examples/AdSetsDelete.php | 32 ++++ examples/AdgroupDelete.php | 32 ++++ examples/AdgroupLeadsEdgeAdgroupLeads.php | 32 ++++ examples/AdgroupLeadsEdgeAdgroupLeadsDPA.php | 34 ++++ .../AdgroupLeadsEdgeAdgroupLeadsFiltered.php | 33 ++++ examples/AdgroupNode.php | 33 ++++ examples/AdgroupPost.php | 32 ++++ examples/AdgroupPostAddLabel.php | 33 ++++ examples/AdgroupPostUpdateStatus.php | 32 ++++ .../AdsInsightsEdgeAdCampaignInsights.php | 34 ++++ examples/AdsInsightsEdgeAdGroupInsights.php | 34 ++++ ...sightsEdgeCampaignGroupAdLevelInsights.php | 35 ++++ .../AdsInsightsEdgeCampaignGroupInsights.php | 34 ++++ examples/AdsPixelEventsPost.php | 32 ++++ examples/AdsPixelEventsPostCustom.php | 61 +++++++ examples/AdsPixelSharedAccountsEdge.php | 33 ++++ examples/AdsPixelSharedAccountsPost.php | 33 ++++ examples/AdsPixelSharedAgenciesEdge.php | 32 ++++ examples/CampaignsDelete.php | 32 ++++ examples/CustomAudienceDelete.php | 32 ++++ examples/CustomAudienceNode.php | 31 ++++ examples/CustomAudienceNodeReadRule.php | 33 ++++ examples/CustomAudiencePost.php | 32 ++++ examples/CustomAudienceUsersPost.php | 32 ++++ .../CustomAudienceUsersPostCrossPlatform.php | 32 ++++ examples/MULTIPost.php | 43 +++++ examples/MULTIPostOne.php | 33 ++++ examples/MULTIPostTwo.php | 33 ++++ .../OfflineConversionsCreateOfflineSet.php | 34 ++++ examples/PageFeedEdge.php | 32 ++++ examples/PageFeedPost.php | 33 ++++ examples/PageFeedPostFeedImageDeepLink.php | 34 ++++ examples/PageNode.php | 35 ++++ examples/PageNodePageSearch.php | 34 ++++ examples/PagePhotosEdge.php | 32 ++++ examples/PagePhotosPost.php | 34 ++++ examples/PagePictureEdge.php | 33 ++++ examples/PagePostCommentsPost.php | 33 ++++ examples/PagePostDelete.php | 32 ++++ examples/PagePostNode.php | 31 ++++ examples/PagePostPost.php | 32 ++++ examples/PagePostsEdge.php | 32 ++++ .../PagePostsEdgePagePostCreateCarousel.php | 37 +++++ examples/PageRolesEdge.php | 32 ++++ examples/PageSubscribedAppsPost.php | 32 ++++ examples/ProductCatalogEventStatsEdge.php | 32 ++++ examples/ProductCatalogHotelsPost.php | 42 +++++ ...gHotelsPostUpdateHotelsCatalogSettings.php | 31 ++++ ...ductCatalogProductFeedsPostProductFeed.php | 34 ++++ .../ProductCatalogProductSetsPostHotelSet.php | 34 ++++ ...roductCatalogProductSetsPostProductSet.php | 34 ++++ examples/UserAccountsEdge.php | 32 ++++ examples/UserAdAccountsEdge.php | 32 ++++ examples/UserLeadGenInfoNode.php | 31 ++++ examples/UserNode.php | 31 ++++ examples/VideoThumbnailsEdge.php | 32 ++++ src/FacebookAds/ApiConfig.php | 2 +- .../AdCreativeFeatureCustomizationsFields.php | 2 + 140 files changed, 4945 insertions(+), 1 deletion(-) create mode 100644 examples/AdAccountAdCreativesEdge.php create mode 100644 examples/AdAccountAdCreativesPost.php create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreative.php create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.php create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.php create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.php create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.php create mode 100644 examples/AdAccountAdCreativesPostEnrollStatus.php create mode 100644 examples/AdAccountAdLabelsPost.php create mode 100644 examples/AdAccountAdSetsEdge.php create mode 100644 examples/AdAccountAdSetsPostAdSetCreateCpa.php create mode 100644 examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.php create mode 100644 examples/AdAccountAdSetsPostBehaviorTargeting.php create mode 100644 examples/AdAccountAdSetsPostBidMultiplier.php create mode 100644 examples/AdAccountAdSetsPostCreateAdSet.php create mode 100644 examples/AdAccountAdSetsPostCreateAudienceNetwork.php create mode 100644 examples/AdAccountAdSetsPostCreateMAIA.php create mode 100644 examples/AdAccountAdSetsPostDailyBudget20.php create mode 100644 examples/AdAccountAdSetsPostDemographicTargeting.php create mode 100644 examples/AdAccountAdSetsPostInterestTargeting.php create mode 100644 examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.php create mode 100644 examples/AdAccountAdSetsPostOptimizePostEngagement.php create mode 100644 examples/AdAccountAdSetsPostPageLikes.php create mode 100644 examples/AdAccountAdSetsPostPlacementTargeting.php create mode 100644 examples/AdAccountAdSetsPostReach.php create mode 100644 examples/AdAccountAdVideosPost.php create mode 100644 examples/AdAccountAdsEdge.php create mode 100644 examples/AdAccountAdsPixelEdgeGetPixelCode.php create mode 100644 examples/AdAccountAdsPixelsPost.php create mode 100644 examples/AdAccountAdsPost.php create mode 100644 examples/AdAccountAdsPostAdsRedownload.php create mode 100644 examples/AdAccountAdsPostAuthorizationCategory.php create mode 100644 examples/AdAccountAdsPostTrackingPostEngagement.php create mode 100644 examples/AdAccountCampaignsEdge.php create mode 100644 examples/AdAccountCampaignsPost.php create mode 100644 examples/AdAccountCampaignsPostCategories.php create mode 100644 examples/AdAccountCampaignsPostDailyBudget.php create mode 100644 examples/AdAccountCampaignsPostLeadGen.php create mode 100644 examples/AdAccountCampaignsPostLinkClicks.php create mode 100644 examples/AdAccountCampaignsPostLocalAwareness.php create mode 100644 examples/AdAccountCampaignsPostMAIA.php create mode 100644 examples/AdAccountCampaignsPostMAIDPA.php create mode 100644 examples/AdAccountCampaignsPostPageLikes.php create mode 100644 examples/AdAccountCampaignsPostPostEngagement.php create mode 100644 examples/AdAccountCampaignsPostVideoViews.php create mode 100644 examples/AdAccountCustomAudiencesEdge.php create mode 100644 examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.php create mode 100644 examples/AdAccountCustomAudiencesPostCreateCustomAudience.php create mode 100644 examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.php create mode 100644 examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.php create mode 100644 examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.php create mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAExclusions.php create mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.php create mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.php create mode 100644 examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.php create mode 100644 examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.php create mode 100644 examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.php create mode 100644 examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.php create mode 100644 examples/AdAccountGeneratePreviewsEdge.php create mode 100644 examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.php create mode 100644 examples/AdAccountGeneratePreviewsEdgeInstagramStandards.php create mode 100644 examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.php create mode 100644 examples/AdAccountNode.php create mode 100644 examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.php create mode 100644 examples/AdAccountProductAudiencesPostNoPurchase.php create mode 100644 examples/AdAccountReachEstimate.php create mode 100644 examples/AdCampaignAdsEdge.php create mode 100644 examples/AdCampaignGroupAdsEdge.php create mode 100644 examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.php create mode 100644 examples/AdCampaignGroupAdsetsEdge.php create mode 100644 examples/AdCampaignNode.php create mode 100644 examples/AdCampaignNodeRead.php create mode 100644 examples/AdCampaignNodeReadFormatUNIX.php create mode 100644 examples/AdCampaignPost.php create mode 100644 examples/AdCampaignPostAdsetUpdateCpa.php create mode 100644 examples/AdCreativeNode.php create mode 100644 examples/AdCreativeNodeRead.php create mode 100644 examples/AdCreativeNodeReadInstagramPermalinkUrl.php create mode 100644 examples/AdCreativePreviewsEdge.php create mode 100644 examples/AdCreativePreviewsEdgePreview.php create mode 100644 examples/AdCreativePreviewsEdgePreviewDynamicAds.php create mode 100644 examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.php create mode 100644 examples/AdSetsDelete.php create mode 100644 examples/AdgroupDelete.php create mode 100644 examples/AdgroupLeadsEdgeAdgroupLeads.php create mode 100644 examples/AdgroupLeadsEdgeAdgroupLeadsDPA.php create mode 100644 examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.php create mode 100644 examples/AdgroupNode.php create mode 100644 examples/AdgroupPost.php create mode 100644 examples/AdgroupPostAddLabel.php create mode 100644 examples/AdgroupPostUpdateStatus.php create mode 100644 examples/AdsInsightsEdgeAdCampaignInsights.php create mode 100644 examples/AdsInsightsEdgeAdGroupInsights.php create mode 100644 examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.php create mode 100644 examples/AdsInsightsEdgeCampaignGroupInsights.php create mode 100644 examples/AdsPixelEventsPost.php create mode 100644 examples/AdsPixelEventsPostCustom.php create mode 100644 examples/AdsPixelSharedAccountsEdge.php create mode 100644 examples/AdsPixelSharedAccountsPost.php create mode 100644 examples/AdsPixelSharedAgenciesEdge.php create mode 100644 examples/CampaignsDelete.php create mode 100644 examples/CustomAudienceDelete.php create mode 100644 examples/CustomAudienceNode.php create mode 100644 examples/CustomAudienceNodeReadRule.php create mode 100644 examples/CustomAudiencePost.php create mode 100644 examples/CustomAudienceUsersPost.php create mode 100644 examples/CustomAudienceUsersPostCrossPlatform.php create mode 100644 examples/MULTIPost.php create mode 100644 examples/MULTIPostOne.php create mode 100644 examples/MULTIPostTwo.php create mode 100644 examples/OfflineConversionsCreateOfflineSet.php create mode 100644 examples/PageFeedEdge.php create mode 100644 examples/PageFeedPost.php create mode 100644 examples/PageFeedPostFeedImageDeepLink.php create mode 100644 examples/PageNode.php create mode 100644 examples/PageNodePageSearch.php create mode 100644 examples/PagePhotosEdge.php create mode 100644 examples/PagePhotosPost.php create mode 100644 examples/PagePictureEdge.php create mode 100644 examples/PagePostCommentsPost.php create mode 100644 examples/PagePostDelete.php create mode 100644 examples/PagePostNode.php create mode 100644 examples/PagePostPost.php create mode 100644 examples/PagePostsEdge.php create mode 100644 examples/PagePostsEdgePagePostCreateCarousel.php create mode 100644 examples/PageRolesEdge.php create mode 100644 examples/PageSubscribedAppsPost.php create mode 100644 examples/ProductCatalogEventStatsEdge.php create mode 100644 examples/ProductCatalogHotelsPost.php create mode 100644 examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.php create mode 100644 examples/ProductCatalogProductFeedsPostProductFeed.php create mode 100644 examples/ProductCatalogProductSetsPostHotelSet.php create mode 100644 examples/ProductCatalogProductSetsPostProductSet.php create mode 100644 examples/UserAccountsEdge.php create mode 100644 examples/UserAdAccountsEdge.php create mode 100644 examples/UserLeadGenInfoNode.php create mode 100644 examples/UserNode.php create mode 100644 examples/VideoThumbnailsEdge.php diff --git a/examples/AdAccountAdCreativesEdge.php b/examples/AdAccountAdCreativesEdge.php new file mode 100644 index 00000000..0c8edca5 --- /dev/null +++ b/examples/AdAccountAdCreativesEdge.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$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); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPost.php b/examples/AdAccountAdCreativesPost.php new file mode 100644 index 00000000..ee18c85a --- /dev/null +++ b/examples/AdAccountAdCreativesPost.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$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' => '_', +); +echo json_encode((new AdAccount($id))->createAdCreative( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreative.php b/examples/AdAccountAdCreativesPostCreateAdCreative.php new file mode 100644 index 00000000..6576e837 --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreative.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'object_story_id' => '_', +); +echo json_encode((new AdAccount($id))->createAdCreative( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.php b/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.php new file mode 100644 index 00000000..62d850fc --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'image_hash' => '', + 'object_story_spec' => array('page_id' => '','link_data' => array('image_hash' => '','link' => '','name' => 'Creative message','call_to_action' => array('type' => 'LEARN_MORE'))), +); +echo json_encode((new AdAccount($id))->createAdCreative( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.php b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.php new file mode 100644 index 00000000..5e8d7aec --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'object_story_spec' => array('page_id' => '','template_data' => array('format_option' => 'collection_video','link' => '','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' => '','name' => 'French Creative title','message' => 'French Creative message')))), + 'product_set_id' => '', +); +echo json_encode((new AdAccount($id))->createAdCreative( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.php b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.php new file mode 100644 index 00000000..49d78cd1 --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'object_story_spec' => array('page_id' => '','link_data' => array('picture' => '','link' => '','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' => '','link' => '','name' => 'French Creative title','message' => 'French Creative message')))), + 'product_set_id' => '', +); +echo json_encode((new AdAccount($id))->createAdCreative( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.php b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.php new file mode 100644 index 00000000..9a8c4503 --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'object_story_spec' => array('page_id' => '','video_data' => array('video_id' => '','image_url' => '','title' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE','value' => array('link' => '')),'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' => '','picture' => '','link' => '','name' => 'French Creative title','message' => 'French Creative message')))), + 'product_set_id' => '', +); +echo json_encode((new AdAccount($id))->createAdCreative( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostEnrollStatus.php b/examples/AdAccountAdCreativesPostEnrollStatus.php new file mode 100644 index 00000000..514208b0 --- /dev/null +++ b/examples/AdAccountAdCreativesPostEnrollStatus.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$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' => '','link_data' => array('image_hash' => '','link' => '','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); \ No newline at end of file diff --git a/examples/AdAccountAdLabelsPost.php b/examples/AdAccountAdLabelsPost.php new file mode 100644 index 00000000..a764f142 --- /dev/null +++ b/examples/AdAccountAdLabelsPost.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$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); \ No newline at end of file diff --git a/examples/AdAccountAdSetsEdge.php b/examples/AdAccountAdSetsEdge.php new file mode 100644 index 00000000..b7ba457d --- /dev/null +++ b/examples/AdAccountAdSetsEdge.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$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); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpa.php b/examples/AdAccountAdSetsPostAdSetCreateCpa.php new file mode 100644 index 00000000..546bd8d4 --- /dev/null +++ b/examples/AdAccountAdSetsPostAdSetCreateCpa.php @@ -0,0 +1,45 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'A CPA Ad Set', + 'campaign_id' => '', + 'daily_budget' => '5000', + 'start_time' => '2024-07-27T00:47:13-0700', + 'end_time' => '2024-08-03T00:47:13-0700', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'REACH', + 'bid_amount' => '1000', + 'promoted_object' => array('page_id' => ''), + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))), + 'user_os' => 'iOS', + 'publisher_platforms' => 'facebook', + 'device_platforms' => 'mobile', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.php b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.php new file mode 100644 index 00000000..6cb00dc6 --- /dev/null +++ b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.php @@ -0,0 +1,43 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'A CPA Ad Set optimized for App Events', + 'campaign_id' => '', + 'daily_budget' => '300', + 'start_time' => '2024-08-05T17:55:15-0700', + 'end_time' => '2024-08-12T17:55:15-0700', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'OFFSITE_CONVERSIONS', + 'bid_amount' => '100', + 'status' => 'PAUSED', + 'promoted_object' => array('application_id' => '','object_store_url' => '','custom_event_type' => 'PURCHASE'), + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'user_os' => array('iOS')), +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostBehaviorTargeting.php b/examples/AdAccountAdSetsPostBehaviorTargeting.php new file mode 100644 index 00000000..5158489b --- /dev/null +++ b/examples/AdAccountAdSetsPostBehaviorTargeting.php @@ -0,0 +1,39 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My AdSet', + 'optimization_goal' => 'REACH', + 'billing_event' => 'IMPRESSIONS', + 'bid_amount' => '2', + 'daily_budget' => '1000', + 'campaign_id' => '', + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'behaviors' => array(array('id' => 6007101597783,'name' => 'Business Travelers'),array('id' => 6004386044572,'name' => 'Android Owners (All)'))), +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostBidMultiplier.php b/examples/AdAccountAdSetsPostBidMultiplier.php new file mode 100644 index 00000000..1fc84a56 --- /dev/null +++ b/examples/AdAccountAdSetsPostBidMultiplier.php @@ -0,0 +1,42 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Adset with bid multiplier', + 'campaign_id' => '', + 'daily_budget' => '3000', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'OFFSITE_CONVERSIONS', + 'bid_amount' => '500', + 'bid_adjustments' => array('user_groups' => array('gender' => array('male' => 0.8,'female' => 1))), + 'promoted_object' => array('product_set_id' => '','custom_event_type' => 'ADD_TO_CART'), + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateAdSet.php b/examples/AdAccountAdSetsPostCreateAdSet.php new file mode 100644 index 00000000..676df613 --- /dev/null +++ b/examples/AdAccountAdSetsPostCreateAdSet.php @@ -0,0 +1,42 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First AdSet', + 'lifetime_budget' => '20000', + 'start_time' => '2024-07-27T00:46:29-0700', + 'end_time' => '2024-08-03T00:46:29-0700', + 'campaign_id' => '', + 'bid_amount' => '500', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'POST_ENGAGEMENT', + 'targeting' => array('age_min' => 20,'age_max' => 24,'behaviors' => array(array('id' => 6002714895372,'name' => 'All travelers')),'genders' => array(1),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => '777934','radius' => 10,'distance_unit' => 'mile'))),'interests' => array(array('id' => '','name' => '')),'life_events' => array(array('id' => 6002714398172,'name' => 'Newlywed (1 year)')),'facebook_positions' => array('feed'),'publisher_platforms' => array('facebook','audience_network')), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateAudienceNetwork.php b/examples/AdAccountAdSetsPostCreateAudienceNetwork.php new file mode 100644 index 00000000..1e6a3848 --- /dev/null +++ b/examples/AdAccountAdSetsPostCreateAudienceNetwork.php @@ -0,0 +1,39 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Ad Set', + 'optimization_goal' => 'LINK_CLICKS', + 'billing_event' => 'LINK_CLICKS', + 'bid_amount' => '2', + 'daily_budget' => '1000', + 'campaign_id' => '', + 'targeting' => array('device_platforms' => array('mobile'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network'),'facebook_positions' => array('feed')), +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateMAIA.php b/examples/AdAccountAdSetsPostCreateMAIA.php new file mode 100644 index 00000000..c4a369fb --- /dev/null +++ b/examples/AdAccountAdSetsPostCreateMAIA.php @@ -0,0 +1,41 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Mobile App Installs Ad Set', + 'daily_budget' => '1000', + 'bid_amount' => '2', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'APP_INSTALLS', + 'campaign_id' => '', + 'promoted_object' => array('application_id' => '','object_store_url' => ''), + 'targeting' => array('device_platforms' => array('mobile'),'facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network'),'user_os' => array('IOS')), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostDailyBudget20.php b/examples/AdAccountAdSetsPostDailyBudget20.php new file mode 100644 index 00000000..e5fd3ab6 --- /dev/null +++ b/examples/AdAccountAdSetsPostDailyBudget20.php @@ -0,0 +1,42 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Adset', + 'daily_budget' => '2000', + 'start_time' => '2024-07-29T17:54:47-0700', + 'end_time' => '2024-08-05T17:54:47-0700', + 'campaign_id' => '', + 'bid_amount' => '100', + 'billing_event' => 'LINK_CLICKS', + 'optimization_goal' => 'LINK_CLICKS', + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostDemographicTargeting.php b/examples/AdAccountAdSetsPostDemographicTargeting.php new file mode 100644 index 00000000..a03f519a --- /dev/null +++ b/examples/AdAccountAdSetsPostDemographicTargeting.php @@ -0,0 +1,41 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First AdSet', + 'daily_budget' => '10000', + 'bid_amount' => '300', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'REACH', + 'campaign_id' => '', + 'promoted_object' => array('page_id' => ''), + 'targeting' => array('facebook_positions' => array('feed'),'age_max' => 24,'age_min' => 20,'behaviors' => array(array('id' => 6002714895372,'name' => 'All travelers')),'device_platforms' => array('mobile'),'genders' => array(1),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => 777934,'radius' => 10,'distance_unit' => 'mile'))),'interests' => array(array('id' => '','name' => '')),'life_events' => array(array('id' => 6002714398172,'name' => 'Newlywed (1 year)')),'publisher_platforms' => array('facebook','audience_network')), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostInterestTargeting.php b/examples/AdAccountAdSetsPostInterestTargeting.php new file mode 100644 index 00000000..74ef4224 --- /dev/null +++ b/examples/AdAccountAdSetsPostInterestTargeting.php @@ -0,0 +1,41 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First AdSet', + 'daily_budget' => '10000', + 'bid_amount' => '300', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'REACH', + 'campaign_id' => '', + 'promoted_object' => array('page_id' => ''), + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => 777934,'radius' => 10,'distance_unit' => 'mile'))),'genders' => array(1),'age_max' => 24,'age_min' => 20,'publisher_platforms' => array('facebook','audience_network'),'device_platforms' => array('mobile'),'flexible_spec' => array(array('interests' => array(array('id' => '','name' => ''))))), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.php b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.php new file mode 100644 index 00000000..ac2ccf1a --- /dev/null +++ b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.php @@ -0,0 +1,42 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Adset', + 'lifetime_budget' => '20000', + 'start_time' => '2024-07-29T17:54:57-0700', + 'end_time' => '2024-08-08T17:54:57-0700', + 'campaign_id' => '', + 'bid_amount' => '100', + 'billing_event' => 'LINK_CLICKS', + 'optimization_goal' => 'LINK_CLICKS', + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network')), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostOptimizePostEngagement.php b/examples/AdAccountAdSetsPostOptimizePostEngagement.php new file mode 100644 index 00000000..cca86eb0 --- /dev/null +++ b/examples/AdAccountAdSetsPostOptimizePostEngagement.php @@ -0,0 +1,42 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Adset', + 'lifetime_budget' => '20000', + 'start_time' => '2024-07-29T17:55:06-0700', + 'end_time' => '2024-08-08T17:55:06-0700', + 'campaign_id' => '', + 'bid_amount' => '500', + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'POST_ENGAGEMENT', + 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => 777934,'radius' => 10,'distance_unit' => 'mile'))),'genders' => array(1),'age_max' => 24,'age_min' => 20,'behaviors' => array(array('id' => 6002714895372,'name' => 'All travelers')),'life_events' => array(array('id' => 6002714398172,'name' => 'Newlywed (1 year)')),'publisher_platforms' => array('facebook'),'device_platforms' => array('desktop')), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostPageLikes.php b/examples/AdAccountAdSetsPostPageLikes.php new file mode 100644 index 00000000..b398199a --- /dev/null +++ b/examples/AdAccountAdSetsPostPageLikes.php @@ -0,0 +1,41 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Reach Ad Set', + 'optimization_goal' => 'REACH', + 'billing_event' => 'IMPRESSIONS', + 'bid_amount' => '2', + 'daily_budget' => '1000', + 'campaign_id' => '', + 'targeting' => array('geo_locations' => array('countries' => array('US')),'facebook_positions' => array('feed')), + 'status' => 'PAUSED', + 'promoted_object' => array('page_id' => ''), +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostPlacementTargeting.php b/examples/AdAccountAdSetsPostPlacementTargeting.php new file mode 100644 index 00000000..ab90f71f --- /dev/null +++ b/examples/AdAccountAdSetsPostPlacementTargeting.php @@ -0,0 +1,40 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My AdSet', + 'optimization_goal' => 'REACH', + 'billing_event' => 'IMPRESSIONS', + 'bid_amount' => '2', + 'daily_budget' => '1000', + 'campaign_id' => '', + 'targeting' => array('geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook'),'facebook_positions' => array('feed')), + 'promoted_object' => array('page_id' => ''), +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostReach.php b/examples/AdAccountAdSetsPostReach.php new file mode 100644 index 00000000..55eed446 --- /dev/null +++ b/examples/AdAccountAdSetsPostReach.php @@ -0,0 +1,41 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Reach Ad Set', + 'optimization_goal' => 'REACH', + 'billing_event' => 'IMPRESSIONS', + 'bid_amount' => '2', + 'daily_budget' => '1000', + 'campaign_id' => '', + 'targeting' => array('excluded_geo_locations' => array('regions' => array(array('key' => '3847'))),'geo_locations' => array('countries' => array('US')),'facebook_positions' => array('feed')), + 'status' => 'PAUSED', + 'promoted_object' => array('page_id' => ''), +); +echo json_encode((new AdAccount($id))->createAdSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdVideosPost.php b/examples/AdAccountAdVideosPost.php new file mode 100644 index 00000000..3781db14 --- /dev/null +++ b/examples/AdAccountAdVideosPost.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'source' => '', +); +echo json_encode((new AdAccount($id))->createAdVideo( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsEdge.php b/examples/AdAccountAdsEdge.php new file mode 100644 index 00000000..0353c82f --- /dev/null +++ b/examples/AdAccountAdsEdge.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', + 'id', +); +$params = array( +); +echo json_encode((new AdAccount($id))->getAds( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsPixelEdgeGetPixelCode.php b/examples/AdAccountAdsPixelEdgeGetPixelCode.php new file mode 100644 index 00000000..ea81301e --- /dev/null +++ b/examples/AdAccountAdsPixelEdgeGetPixelCode.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'code', +); +$params = array( +); +echo json_encode((new AdsPixel($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsPixelsPost.php b/examples/AdAccountAdsPixelsPost.php new file mode 100644 index 00000000..1dc8a91f --- /dev/null +++ b/examples/AdAccountAdsPixelsPost.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My WCA Pixel', +); +echo json_encode((new AdAccount($id))->createAdsPixel( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsPost.php b/examples/AdAccountAdsPost.php new file mode 100644 index 00000000..06ad9cf4 --- /dev/null +++ b/examples/AdAccountAdsPost.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Ad', + 'adset_id' => '', + 'creative' => array('creative_id' => ''), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAd( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsPostAdsRedownload.php b/examples/AdAccountAdsPostAdsRedownload.php new file mode 100644 index 00000000..420c4365 --- /dev/null +++ b/examples/AdAccountAdsPostAdsRedownload.php @@ -0,0 +1,37 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My AdGroup with Redownload', + 'adset_id' => '', + 'creative' => array('creative_id' => ''), + 'redownload' => '1', + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAd( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsPostAuthorizationCategory.php b/examples/AdAccountAdsPostAuthorizationCategory.php new file mode 100644 index 00000000..9ab5da52 --- /dev/null +++ b/examples/AdAccountAdsPostAuthorizationCategory.php @@ -0,0 +1,37 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My AdGroup', + 'adset_id' => '', + 'creative' => array('creative_id' => ''), + 'status' => 'PAUSED', + 'authorization_category' => 'POLITICAL', +); +echo json_encode((new AdAccount($id))->createAd( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountAdsPostTrackingPostEngagement.php b/examples/AdAccountAdsPostTrackingPostEngagement.php new file mode 100644 index 00000000..f1bd176d --- /dev/null +++ b/examples/AdAccountAdsPostTrackingPostEngagement.php @@ -0,0 +1,37 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Ad', + 'adset_id' => '', + 'creative' => array('creative_id' => ''), + 'tracking_specs' => array('action.type' => 'post_engagement','post' => '','page' => ''), + 'status' => 'PAUSED', +); +echo json_encode((new AdAccount($id))->createAd( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsEdge.php b/examples/AdAccountCampaignsEdge.php new file mode 100644 index 00000000..3852f09a --- /dev/null +++ b/examples/AdAccountCampaignsEdge.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', + 'objective', +); +$params = array( + 'effective_status' => array('ACTIVE','PAUSED'), +); +echo json_encode((new AdAccount($id))->getCampaigns( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPost.php b/examples/AdAccountCampaignsPost.php new file mode 100644 index 00000000..d90e9926 --- /dev/null +++ b/examples/AdAccountCampaignsPost.php @@ -0,0 +1,156 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My campaign', + 'objective' => 'OUTCOME_TRAFFIC', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'Lead generation campaign', + 'objective' => 'OUTCOME_LEADS', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'Local ad campaign', + 'objective' => 'OUTCOME_AWARENESS', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'Mobile App Installs Campaign', + 'objective' => 'OUTCOME_APP_PROMOTION', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'App Installs Campaign with Dynamic Product Ads', + 'objective' => 'OUTCOME_APP_PROMOTION', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'Video Views campaign', + 'objective' => 'OUTCOME_ENGAGEMENT', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign', + 'objective' => 'OUTCOME_ENGAGEMENT', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign', + 'objective' => 'OUTCOME_ENGAGEMENT', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign with daily budget', + 'objective' => 'OUTCOME_LEADS', + 'status' => 'PAUSED', + 'daily_budget' => '1000', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign with special ad categories', + 'objective' => 'OUTCOME_LEADS', + 'status' => 'PAUSED', + 'daily_budget' => '1000', + 'special_ad_categories' => array(), + 'special_ad_category_country' => array('MX'), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostCategories.php b/examples/AdAccountCampaignsPostCategories.php new file mode 100644 index 00000000..159f564e --- /dev/null +++ b/examples/AdAccountCampaignsPostCategories.php @@ -0,0 +1,38 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign with special ad categories', + 'objective' => 'OUTCOME_LEADS', + 'status' => 'PAUSED', + 'daily_budget' => '1000', + 'special_ad_categories' => array(), + 'special_ad_category_country' => array('MX'), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostDailyBudget.php b/examples/AdAccountCampaignsPostDailyBudget.php new file mode 100644 index 00000000..5deebca8 --- /dev/null +++ b/examples/AdAccountCampaignsPostDailyBudget.php @@ -0,0 +1,37 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign with daily budget', + 'objective' => 'OUTCOME_LEADS', + 'status' => 'PAUSED', + 'daily_budget' => '1000', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLeadGen.php b/examples/AdAccountCampaignsPostLeadGen.php new file mode 100644 index 00000000..f4b90850 --- /dev/null +++ b/examples/AdAccountCampaignsPostLeadGen.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Lead generation campaign', + 'objective' => 'OUTCOME_LEADS', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLinkClicks.php b/examples/AdAccountCampaignsPostLinkClicks.php new file mode 100644 index 00000000..2aacbff5 --- /dev/null +++ b/examples/AdAccountCampaignsPostLinkClicks.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My campaign', + 'objective' => 'OUTCOME_TRAFFIC', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLocalAwareness.php b/examples/AdAccountCampaignsPostLocalAwareness.php new file mode 100644 index 00000000..c114299d --- /dev/null +++ b/examples/AdAccountCampaignsPostLocalAwareness.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Local ad campaign', + 'objective' => 'OUTCOME_AWARENESS', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostMAIA.php b/examples/AdAccountCampaignsPostMAIA.php new file mode 100644 index 00000000..7a13c7a5 --- /dev/null +++ b/examples/AdAccountCampaignsPostMAIA.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Mobile App Installs Campaign', + 'objective' => 'OUTCOME_APP_PROMOTION', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostMAIDPA.php b/examples/AdAccountCampaignsPostMAIDPA.php new file mode 100644 index 00000000..84e8d3d5 --- /dev/null +++ b/examples/AdAccountCampaignsPostMAIDPA.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'App Installs Campaign with Dynamic Product Ads', + 'objective' => 'OUTCOME_APP_PROMOTION', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostPageLikes.php b/examples/AdAccountCampaignsPostPageLikes.php new file mode 100644 index 00000000..0532d4bd --- /dev/null +++ b/examples/AdAccountCampaignsPostPageLikes.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign', + 'objective' => 'OUTCOME_ENGAGEMENT', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostPostEngagement.php b/examples/AdAccountCampaignsPostPostEngagement.php new file mode 100644 index 00000000..0532d4bd --- /dev/null +++ b/examples/AdAccountCampaignsPostPostEngagement.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My First Campaign', + 'objective' => 'OUTCOME_ENGAGEMENT', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostVideoViews.php b/examples/AdAccountCampaignsPostVideoViews.php new file mode 100644 index 00000000..b1f0c3b8 --- /dev/null +++ b/examples/AdAccountCampaignsPostVideoViews.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Video Views campaign', + 'objective' => 'OUTCOME_ENGAGEMENT', + 'status' => 'PAUSED', + 'special_ad_categories' => array(), +); +echo json_encode((new AdAccount($id))->createCampaign( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesEdge.php b/examples/AdAccountCustomAudiencesEdge.php new file mode 100644 index 00000000..6f3995f7 --- /dev/null +++ b/examples/AdAccountCustomAudiencesEdge.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'id', +); +$params = array( +); +echo json_encode((new AdAccount($id))->getCustomAudiences( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.php b/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.php new file mode 100644 index 00000000..0780adb5 --- /dev/null +++ b/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'data_source', + 'subtype', +); +$params = array( +); +echo json_encode((new AdAccount($id))->getCustomAudiences( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostCreateCustomAudience.php b/examples/AdAccountCustomAudiencesPostCreateCustomAudience.php new file mode 100644 index 00000000..4ec8a114 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostCreateCustomAudience.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My new Custom Audience', + 'subtype' => 'CUSTOM', + 'description' => 'People who purchased on my website', + 'customer_file_source' => 'USER_PROVIDED_ONLY', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.php b/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.php new file mode 100644 index 00000000..a69a87d8 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Value-Based lookalike from Pixel', + 'subtype' => 'LOOKALIKE', + 'lookalike_spec' => array('origin_event_sources' => array(array('id' => '','event_names' => array('AddToCart'))),'type' => 'custom_ratio','ratio' => 0.01,'country' => 'US'), +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.php b/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.php new file mode 100644 index 00000000..f3fd8112 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Value-Based lookalike from Pixel', + 'subtype' => 'LOOKALIKE', + 'lookalike_spec' => array('origin_event_sources' => array(array('id' => '')),'type' => 'custom_ratio','ratio' => 0.01,'country' => 'US'), +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.php b/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.php new file mode 100644 index 00000000..0b136851 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Test Website Custom Audience', + 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'app')),'retention_seconds' => 8400,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'fb_mobile_purchase'))))))), + 'prefill' => '1', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.php b/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.php new file mode 100644 index 00000000..9865f83f --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Test Engagement Custom Audience', + 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged')))))),'exclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_cta_clicked'))))))), + 'prefill' => '1', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.php b/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.php new file mode 100644 index 00000000..872759e0 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Test Engagement Custom Audience', + 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged'),array('field' => 'event','operator' => 'eq','value' => 'page_engaged'))))))), + 'prefill' => '1', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.php b/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.php new file mode 100644 index 00000000..1a0f7420 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Test Engagement Custom Audience', + 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'page'),array('id' => '','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged'))))))), + 'prefill' => '1', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.php b/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.php new file mode 100644 index 00000000..806339bd --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Test Engagement Custom Audience', + 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged'))))))), + 'prefill' => '1', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.php b/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.php new file mode 100644 index 00000000..05665e7a --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Test Website Custom Audience', + 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '','type' => 'pixel')),'retention_seconds' => 8400,'filter' => array('operator' => 'and','filters' => array(array('field' => 'url','operator' => 'i_contains','value' => 'shoes'))))))), + 'prefill' => '1', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.php b/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.php new file mode 100644 index 00000000..a074016c --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Value-Based Custom Audience', + 'subtype' => 'CUSTOM', + 'is_value_based' => '1', + 'customer_file_source' => 'PARTNER_PROVIDED_ONLY', +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.php b/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.php new file mode 100644 index 00000000..4a70a53f --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Value-Based lookalike', + 'subtype' => 'LOOKALIKE', + 'origin_audience_id' => '', + 'lookalike_spec' => array('type' => 'custom_ratio','ratio' => 0.01,'country' => 'US'), +); +echo json_encode((new AdAccount($id))->createCustomAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdge.php b/examples/AdAccountGeneratePreviewsEdge.php new file mode 100644 index 00000000..43edc793 --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdge.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'creative' => '', + 'ad_format' => '', +); +echo json_encode((new AdAccount($id))->getGeneratePreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.php b/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.php new file mode 100644 index 00000000..f48a5f9a --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'creative' => array('object_story_id' => '_'), + 'ad_format' => 'DESKTOP_FEED_STANDARD', +); +echo json_encode((new AdAccount($id))->getGeneratePreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.php b/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.php new file mode 100644 index 00000000..0c688caf --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'creative' => array('instagram_actor_id' => '','object_story_spec' => array('link_data' => array('call_to_action' => array('type' => 'LEARN_MORE','value' => array('link' => '')),'caption' => 'www.example.com','image_hash' => '','link' => '','message' => 'Message'),'page_id' => '')), + 'ad_format' => 'INSTAGRAM_STANDARD', +); +echo json_encode((new AdAccount($id))->getGeneratePreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.php b/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.php new file mode 100644 index 00000000..773fc4b0 --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'creative' => array('object_story_spec' => array('link_data' => array('call_to_action' => array('type' => 'USE_APP','value' => array('link' => '')),'description' => 'Description','link' => '','message' => 'Message','name' => 'Name','picture' => ''),'page_id' => '')), + 'ad_format' => 'MOBILE_FEED_STANDARD', +); +echo json_encode((new AdAccount($id))->getGeneratePreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountNode.php b/examples/AdAccountNode.php new file mode 100644 index 00000000..60d6ab0f --- /dev/null +++ b/examples/AdAccountNode.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$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))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.php b/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.php new file mode 100644 index 00000000..0cb7af05 --- /dev/null +++ b/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Iphone Product Audience', + 'product_set_id' => '', + 'inclusions' => array(array('retention_seconds' => 86400,'rule' => array('and' => array(array('event' => array('eq' => 'AddToCart')),array('userAgent' => array('i_contains' => 'iPhone')))))), + 'exclusions' => array(array('retention_seconds' => 172800,'rule' => array('event' => array('eq' => 'Purchase')))), +); +echo json_encode((new AdAccount($id))->createProductAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountProductAudiencesPostNoPurchase.php b/examples/AdAccountProductAudiencesPostNoPurchase.php new file mode 100644 index 00000000..9e204957 --- /dev/null +++ b/examples/AdAccountProductAudiencesPostNoPurchase.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Product Audience', + 'product_set_id' => '', + 'inclusions' => array(array('retention_seconds' => 86400,'rule' => array('event' => array('eq' => 'AddToCart'))),array('retention_seconds' => 72000,'rule' => array('event' => array('eq' => 'ViewContent')))), + 'exclusions' => array(array('retention_seconds' => 172800,'rule' => array('event' => array('eq' => 'Purchase')))), +); +echo json_encode((new AdAccount($id))->createProductAudience( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdAccountReachEstimate.php b/examples/AdAccountReachEstimate.php new file mode 100644 index 00000000..ee7cda03 --- /dev/null +++ b/examples/AdAccountReachEstimate.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'targeting_spec' => array('geo_locations' => array('countries' => array('US')),'age_min' => 20,'age_max' => 40), +); +echo json_encode((new AdAccount($id))->getReachEstimate( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignAdsEdge.php b/examples/AdCampaignAdsEdge.php new file mode 100644 index 00000000..d5e53dce --- /dev/null +++ b/examples/AdCampaignAdsEdge.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', + 'id', +); +$params = array( +); +echo json_encode((new AdSet($id))->getAds( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsEdge.php b/examples/AdCampaignGroupAdsEdge.php new file mode 100644 index 00000000..6c04fe3f --- /dev/null +++ b/examples/AdCampaignGroupAdsEdge.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', +); +$params = array( +); +echo json_encode((new Campaign($id))->getAds( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.php b/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.php new file mode 100644 index 00000000..7b399b11 --- /dev/null +++ b/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', +); +$params = array( + 'effective_status' => array('ARCHIVED'), +); +echo json_encode((new Campaign($id))->getAds( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsetsEdge.php b/examples/AdCampaignGroupAdsetsEdge.php new file mode 100644 index 00000000..81e84aa9 --- /dev/null +++ b/examples/AdCampaignGroupAdsetsEdge.php @@ -0,0 +1,37 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', + 'start_time', + 'end_time', + 'daily_budget', + 'lifetime_budget', +); +$params = array( +); +echo json_encode((new Campaign($id))->getAdSets( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignNode.php b/examples/AdCampaignNode.php new file mode 100644 index 00000000..81eea3a0 --- /dev/null +++ b/examples/AdCampaignNode.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'adset_schedule', +); +$params = array( +); +echo json_encode((new AdSet($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignNodeRead.php b/examples/AdCampaignNodeRead.php new file mode 100644 index 00000000..9fa93e20 --- /dev/null +++ b/examples/AdCampaignNodeRead.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', + 'status', +); +$params = array( +); +echo json_encode((new AdSet($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignNodeReadFormatUNIX.php b/examples/AdCampaignNodeReadFormatUNIX.php new file mode 100644 index 00000000..2ac5c4a0 --- /dev/null +++ b/examples/AdCampaignNodeReadFormatUNIX.php @@ -0,0 +1,36 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'id', + 'name', + 'start_time', + 'end_time', +); +$params = array( + 'date_format' => 'U', +); +echo json_encode((new AdSet($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignPost.php b/examples/AdCampaignPost.php new file mode 100644 index 00000000..d3b91c4e --- /dev/null +++ b/examples/AdCampaignPost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'bid_adjustments' => array('user_groups' => array('user_bucket' => array('event_sources' => array('',''),'1' => 0.1,'2' => 0.2,'3' => 0.3,'default' => array('gender' => array('male' => 0.99,'female' => 0.12))))), +); +echo json_encode((new AdSet($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCampaignPostAdsetUpdateCpa.php b/examples/AdCampaignPostAdsetUpdateCpa.php new file mode 100644 index 00000000..a075a2d5 --- /dev/null +++ b/examples/AdCampaignPostAdsetUpdateCpa.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'billing_event' => 'IMPRESSIONS', + 'optimization_goal' => 'LINK_CLICKS', + 'bid_amount' => '200', + 'targeting' => array('geo_locations' => array('countries' => array('US')),'facebook_positions' => array('feed')), +); +echo json_encode((new AdSet($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCreativeNode.php b/examples/AdCreativeNode.php new file mode 100644 index 00000000..bdc49a32 --- /dev/null +++ b/examples/AdCreativeNode.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'asset_feed_spec', +); +$params = array( +); +echo json_encode((new AdCreative($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCreativeNodeRead.php b/examples/AdCreativeNodeRead.php new file mode 100644 index 00000000..f3f751b7 --- /dev/null +++ b/examples/AdCreativeNodeRead.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_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); \ No newline at end of file diff --git a/examples/AdCreativeNodeReadInstagramPermalinkUrl.php b/examples/AdCreativeNodeReadInstagramPermalinkUrl.php new file mode 100644 index 00000000..62d4fadc --- /dev/null +++ b/examples/AdCreativeNodeReadInstagramPermalinkUrl.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'instagram_permalink_url', +); +$params = array( +); +echo json_encode((new AdCreative($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdge.php b/examples/AdCreativePreviewsEdge.php new file mode 100644 index 00000000..635844c4 --- /dev/null +++ b/examples/AdCreativePreviewsEdge.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_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(''), +); +echo json_encode((new AdCreative($id))->getPreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreview.php b/examples/AdCreativePreviewsEdgePreview.php new file mode 100644 index 00000000..6766f68f --- /dev/null +++ b/examples/AdCreativePreviewsEdgePreview.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'ad_format' => 'DESKTOP_FEED_STANDARD', +); +echo json_encode((new AdCreative($id))->getPreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreviewDynamicAds.php b/examples/AdCreativePreviewsEdgePreviewDynamicAds.php new file mode 100644 index 00000000..635844c4 --- /dev/null +++ b/examples/AdCreativePreviewsEdgePreviewDynamicAds.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_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(''), +); +echo json_encode((new AdCreative($id))->getPreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.php b/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.php new file mode 100644 index 00000000..fe674ab2 --- /dev/null +++ b/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_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(''), + 'dynamic_customization' => array('language' => 'fr_XX','country' => 'FR'), +); +echo json_encode((new AdCreative($id))->getPreviews( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdSetsDelete.php b/examples/AdSetsDelete.php new file mode 100644 index 00000000..4c00bdcc --- /dev/null +++ b/examples/AdSetsDelete.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new AdSet($id))->deleteSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupDelete.php b/examples/AdgroupDelete.php new file mode 100644 index 00000000..5b408824 --- /dev/null +++ b/examples/AdgroupDelete.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Ad($id))->deleteSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeads.php b/examples/AdgroupLeadsEdgeAdgroupLeads.php new file mode 100644 index 00000000..3a4b2352 --- /dev/null +++ b/examples/AdgroupLeadsEdgeAdgroupLeads.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Ad($id))->getLeads( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.php b/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.php new file mode 100644 index 00000000..d418178a --- /dev/null +++ b/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'field_data', + 'retailer_item_id', +); +$params = array( +); +echo json_encode((new Ad($id))->getLeads( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.php b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.php new file mode 100644 index 00000000..f308eb52 --- /dev/null +++ b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'filtering' => array(array('field' => 'time_created','operator' => 'GREATER_THAN','value' => 1721709809)), +); +echo json_encode((new Ad($id))->getLeads( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupNode.php b/examples/AdgroupNode.php new file mode 100644 index 00000000..5cd915af --- /dev/null +++ b/examples/AdgroupNode.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'id', + 'name', +); +$params = array( +); +echo json_encode((new Ad($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupPost.php b/examples/AdgroupPost.php new file mode 100644 index 00000000..8f7696cf --- /dev/null +++ b/examples/AdgroupPost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My New Ad', +); +echo json_encode((new Ad($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupPostAddLabel.php b/examples/AdgroupPostAddLabel.php new file mode 100644 index 00000000..df29e81a --- /dev/null +++ b/examples/AdgroupPostAddLabel.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My New Ad with Label', + 'adlabels' => array(array('id' => '','name' => 'My Label')), +); +echo json_encode((new Ad($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdgroupPostUpdateStatus.php b/examples/AdgroupPostUpdateStatus.php new file mode 100644 index 00000000..6c8deeea --- /dev/null +++ b/examples/AdgroupPostUpdateStatus.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'adgroup_status' => 'PAUSED', +); +echo json_encode((new Ad($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsInsightsEdgeAdCampaignInsights.php b/examples/AdsInsightsEdgeAdCampaignInsights.php new file mode 100644 index 00000000..44c1fffe --- /dev/null +++ b/examples/AdsInsightsEdgeAdCampaignInsights.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'impressions', +); +$params = array( + 'breakdown' => 'publisher_platform', +); +echo json_encode((new AdSet($id))->getInsights( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsInsightsEdgeAdGroupInsights.php b/examples/AdsInsightsEdgeAdGroupInsights.php new file mode 100644 index 00000000..10ee6451 --- /dev/null +++ b/examples/AdsInsightsEdgeAdGroupInsights.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'impressions', +); +$params = array( + 'date_preset' => 'last_7d', +); +echo json_encode((new Ad($id))->getInsights( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.php b/examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.php new file mode 100644 index 00000000..254750db --- /dev/null +++ b/examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'impressions', + 'ad_id', +); +$params = array( + 'level' => 'ad', +); +echo json_encode((new Campaign($id))->getInsights( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsInsightsEdgeCampaignGroupInsights.php b/examples/AdsInsightsEdgeCampaignGroupInsights.php new file mode 100644 index 00000000..081e8119 --- /dev/null +++ b/examples/AdsInsightsEdgeCampaignGroupInsights.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'impressions', +); +$params = array( + 'date_preset' => 'last_3d', +); +echo json_encode((new Campaign($id))->getInsights( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsPixelEventsPost.php b/examples/AdsPixelEventsPost.php new file mode 100644 index 00000000..8604569a --- /dev/null +++ b/examples/AdsPixelEventsPost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'data' => array(array('event_name' => 'PageView','event_time' => 1721461428,'user_data' => array('fbc' => 'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp' => 'fb.1.1558571054389.1098115397','em' => '309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'))), +); +echo json_encode((new AdsPixel($id))->createEvent( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsPixelEventsPostCustom.php b/examples/AdsPixelEventsPostCustom.php new file mode 100644 index 00000000..3d6fee33 --- /dev/null +++ b/examples/AdsPixelEventsPostCustom.php @@ -0,0 +1,61 @@ +'; +$pixel_id = ''; + +$api = Api::init(null, null, $access_token); +$api->setLogger(new CurlLogger()); + +$user_data = (new UserData()) + ->setEmails(array('joe@eg.com')) + ->setPhones(array('12345678901', '14251234567')) + // It is recommended to send Client IP and User Agent for Conversions API Events. + ->setClientIpAddress($_SERVER['REMOTE_ADDR']) + ->setClientUserAgent($_SERVER['HTTP_USER_AGENT']) + ->setFbc('fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890') + ->setFbp('fb.1.1558571054389.1098115397'); + +$content = (new Content()) + ->setProductId('product123') + ->setQuantity(1) + ->setDeliveryCategory(DeliveryCategory::HOME_DELIVERY); + +$custom_data = (new CustomData()) + ->setContents(array($content)) + ->setCurrency('usd') + ->setValue(123.45); + +$event = (new Event()) + ->setEventName('Purchase') + ->setEventTime(time()) + ->setEventSourceUrl('http://jaspers-market.com/product/123') + ->setUserData($user_data) + ->setCustomData($custom_data) + ->setActionSource(ActionSource::WEBSITE); + +$events = array(); +array_push($events, $event); + +$request = (new EventRequest($pixel_id)) + ->setEvents($events); +$response = $request->execute(); +print_r($response); \ No newline at end of file diff --git a/examples/AdsPixelSharedAccountsEdge.php b/examples/AdsPixelSharedAccountsEdge.php new file mode 100644 index 00000000..37f4e2b1 --- /dev/null +++ b/examples/AdsPixelSharedAccountsEdge.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'business' => '', +); +echo json_encode((new AdsPixel($id))->getSharedAccounts( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsPixelSharedAccountsPost.php b/examples/AdsPixelSharedAccountsPost.php new file mode 100644 index 00000000..770d6399 --- /dev/null +++ b/examples/AdsPixelSharedAccountsPost.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'account_id' => '', + 'business' => '', +); +echo json_encode((new AdsPixel($id))->createSharedAccount( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/AdsPixelSharedAgenciesEdge.php b/examples/AdsPixelSharedAgenciesEdge.php new file mode 100644 index 00000000..902fb19a --- /dev/null +++ b/examples/AdsPixelSharedAgenciesEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new AdsPixel($id))->getSharedAgencies( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CampaignsDelete.php b/examples/CampaignsDelete.php new file mode 100644 index 00000000..43525960 --- /dev/null +++ b/examples/CampaignsDelete.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Campaign($id))->deleteSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CustomAudienceDelete.php b/examples/CustomAudienceDelete.php new file mode 100644 index 00000000..fe1f3331 --- /dev/null +++ b/examples/CustomAudienceDelete.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new CustomAudience($id))->deleteSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CustomAudienceNode.php b/examples/CustomAudienceNode.php new file mode 100644 index 00000000..4a764419 --- /dev/null +++ b/examples/CustomAudienceNode.php @@ -0,0 +1,31 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new CustomAudience($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CustomAudienceNodeReadRule.php b/examples/CustomAudienceNodeReadRule.php new file mode 100644 index 00000000..ece2f621 --- /dev/null +++ b/examples/CustomAudienceNodeReadRule.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'name', + 'rule', +); +$params = array( +); +echo json_encode((new CustomAudience($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CustomAudiencePost.php b/examples/CustomAudiencePost.php new file mode 100644 index 00000000..0e1742a9 --- /dev/null +++ b/examples/CustomAudiencePost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Updated Name for CA', +); +echo json_encode((new CustomAudience($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CustomAudienceUsersPost.php b/examples/CustomAudienceUsersPost.php new file mode 100644 index 00000000..1c038c17 --- /dev/null +++ b/examples/CustomAudienceUsersPost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'payload' => array('schema' => array('EMAIL','LOOKALIKE_VALUE'),'data' => array(array('9b431636bd164765d63c573c346708846af4f68fe3701a77a3bdd7e7e5166254',44.5),array('8cc62c145cd0c6dc444168eaeb1b61b351f9b1809a579cc9b4c9e9d7213a39ee',140),array('4eaf70b1f7a797962b9d2a533f122c8039012b31e0a52b34a426729319cb792a',0),array('98df8d46f118f8bef552b0ec0a3d729466a912577830212a844b73960777ac56',0.9))), +); +echo json_encode((new CustomAudience($id))->createUser( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/CustomAudienceUsersPostCrossPlatform.php b/examples/CustomAudienceUsersPostCrossPlatform.php new file mode 100644 index 00000000..4a365829 --- /dev/null +++ b/examples/CustomAudienceUsersPostCrossPlatform.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'payload' => array('schema' => array('EMAIL','MADID','APPUID','LOOKALIKE_VALUE'),'app_ids' => array(''),'data' => array(array('b36a83701f1c3191e19722d6f90274bc1b5501fe69ebf33313e440fe4b0fe210','6032d997-3ab0-4de0-aa16-8af0e5b482fb','1234567890','0.9'),array('2b3b2b9ce842ab8b6a6c614cb1f9604bb8a0d502d1af49c526b72b10894e95b5','B67385F8-9A82-4670-8C0A-6F9EA7513F5F','','0'),array('898628e28890f937bdf009391def42879c401a4bcf1b5fd24e738d9f5da8cbbb','','9876543210','0.4'))), +); +echo json_encode((new CustomAudience($id))->createUser( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/MULTIPost.php b/examples/MULTIPost.php new file mode 100644 index 00000000..054b1197 --- /dev/null +++ b/examples/MULTIPost.php @@ -0,0 +1,43 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Label 1', +); +echo json_encode((new AdAccount($id))->createAdLabel( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); + +$fields = array( +); +$params = array( + 'name' => 'My Label 2', +); +echo json_encode((new AdAccount($id))->createAdLabel( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/MULTIPostOne.php b/examples/MULTIPostOne.php new file mode 100644 index 00000000..72901e6c --- /dev/null +++ b/examples/MULTIPostOne.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Label 1', +); +echo json_encode((new AdAccount($id))->createAdLabel( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/MULTIPostTwo.php b/examples/MULTIPostTwo.php new file mode 100644 index 00000000..b74e91c7 --- /dev/null +++ b/examples/MULTIPostTwo.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'My Label 2', +); +echo json_encode((new AdAccount($id))->createAdLabel( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/OfflineConversionsCreateOfflineSet.php b/examples/OfflineConversionsCreateOfflineSet.php new file mode 100644 index 00000000..d48fbe6c --- /dev/null +++ b/examples/OfflineConversionsCreateOfflineSet.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'offline_event_set', + 'description' => 'conversion data used for superbowl campaign', +); +echo json_encode((new Business($id))->createOfflineConversionDataSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageFeedEdge.php b/examples/PageFeedEdge.php new file mode 100644 index 00000000..e5d96625 --- /dev/null +++ b/examples/PageFeedEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Page($id))->getFeed( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageFeedPost.php b/examples/PageFeedPost.php new file mode 100644 index 00000000..76816686 --- /dev/null +++ b/examples/PageFeedPost.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'message' => 'This is a test value', +); +echo json_encode((new Page($id))->createFeed( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageFeedPostFeedImageDeepLink.php b/examples/PageFeedPostFeedImageDeepLink.php new file mode 100644 index 00000000..4109b5e6 --- /dev/null +++ b/examples/PageFeedPostFeedImageDeepLink.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'message' => 'This is a test message', + 'call_to_action' => array('type' => 'BUY_NOW','value' => array('link' => '','app_link' => '')), +); +echo json_encode((new Page($id))->createFeed( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageNode.php b/examples/PageNode.php new file mode 100644 index 00000000..dc4e2e4b --- /dev/null +++ b/examples/PageNode.php @@ -0,0 +1,35 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( + 'location{latitude', + 'longitude}', + 'is_permanently_closed', +); +$params = array( + 'limit' => '30000', +); +echo json_encode((new Page($id))->getLocations( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageNodePageSearch.php b/examples/PageNodePageSearch.php new file mode 100644 index 00000000..927a01d9 --- /dev/null +++ b/examples/PageNodePageSearch.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'type' => 'adradiussuggestion', + 'latitude' => '51.5152253', + 'longitude' => '-0.1423029', +); +echo json_encode((new Page($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePhotosEdge.php b/examples/PagePhotosEdge.php new file mode 100644 index 00000000..1315cc41 --- /dev/null +++ b/examples/PagePhotosEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Page($id))->getPhotos( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePhotosPost.php b/examples/PagePhotosPost.php new file mode 100644 index 00000000..2c8981a5 --- /dev/null +++ b/examples/PagePhotosPost.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'url' => 'https://www.facebook.com/images/fb_icon_325x325.png', + 'published' => 'false', +); +echo json_encode((new Page($id))->createPhoto( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePictureEdge.php b/examples/PagePictureEdge.php new file mode 100644 index 00000000..b7add1de --- /dev/null +++ b/examples/PagePictureEdge.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'redirect' => '0', +); +echo json_encode((new Page($id))->getPicture( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePostCommentsPost.php b/examples/PagePostCommentsPost.php new file mode 100644 index 00000000..339c8c23 --- /dev/null +++ b/examples/PagePostCommentsPost.php @@ -0,0 +1,33 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'message' => 'This is a test value', +); +echo json_encode((new PagePost($id))->createComment( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePostDelete.php b/examples/PagePostDelete.php new file mode 100644 index 00000000..f048bb3c --- /dev/null +++ b/examples/PagePostDelete.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new PagePost($id))->deleteSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePostNode.php b/examples/PagePostNode.php new file mode 100644 index 00000000..b1b7f613 --- /dev/null +++ b/examples/PagePostNode.php @@ -0,0 +1,31 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new PagePost($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePostPost.php b/examples/PagePostPost.php new file mode 100644 index 00000000..10e1b8c4 --- /dev/null +++ b/examples/PagePostPost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'message' => 'This is a test value', +); +echo json_encode((new PagePost($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePostsEdge.php b/examples/PagePostsEdge.php new file mode 100644 index 00000000..b44d105e --- /dev/null +++ b/examples/PagePostsEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Page($id))->getPosts( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PagePostsEdgePagePostCreateCarousel.php b/examples/PagePostsEdgePagePostCreateCarousel.php new file mode 100644 index 00000000..96f5e79d --- /dev/null +++ b/examples/PagePostsEdgePagePostCreateCarousel.php @@ -0,0 +1,37 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'message' => 'Browse our latest products', + 'published' => '0', + 'child_attachments' => array(array('link' => '','name' => 'Product 1','description' => '$4.99','image_hash' => ''),array('link' => '','name' => 'Product 2','description' => '$4.99','image_hash' => ''),array('link' => '','name' => 'Product 3','description' => '$4.99','image_hash' => ''),array('link' => '','name' => 'Product 4','description' => '$4.99','image_hash' => '')), + 'caption' => 'WWW.EXAMPLE.COM', + 'link' => 'http://www.example.com/products', +); +echo json_encode((new Page($id))->getPosts( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageRolesEdge.php b/examples/PageRolesEdge.php new file mode 100644 index 00000000..ffd6f3d1 --- /dev/null +++ b/examples/PageRolesEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Page($id))->getRoles( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/PageSubscribedAppsPost.php b/examples/PageSubscribedAppsPost.php new file mode 100644 index 00000000..fdd367c0 --- /dev/null +++ b/examples/PageSubscribedAppsPost.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'subscribed_fields' => 'leadgen', +); +echo json_encode((new Page($id))->createSubscribedApp( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/ProductCatalogEventStatsEdge.php b/examples/ProductCatalogEventStatsEdge.php new file mode 100644 index 00000000..3d3e0608 --- /dev/null +++ b/examples/ProductCatalogEventStatsEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new ProductCatalog($id))->getEventStats( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/ProductCatalogHotelsPost.php b/examples/ProductCatalogHotelsPost.php new file mode 100644 index 00000000..2f4528da --- /dev/null +++ b/examples/ProductCatalogHotelsPost.php @@ -0,0 +1,42 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'hotel_id' => 'h_1', + 'name' => 'Sample Hotel', + 'description' => 'hotel description', + 'brand' => 'hotel brand', + 'url' => 'http://www.example.com/samplehotel', + 'images' => array(array('image_url' => 'https://www.example.com/pic1.jpg','tags' => array('front view','balcony')),array('image_url' => 'http://www.example.com/pic2.jpg','tags' => array('lobby view'))), + 'address' => array('street_address' => '1 Hacker Way','city' => 'Menlo Park','region' => 'California','country' => 'United States','postal_code' => '94025','neighborhoods' => array('Palo Alto','Menlo Park'),'latitude' => 37.484116,'longitude' => -122.148244), + 'guest_ratings' => array(array('score' => 7.8,'max_score' => 10,'rating_system' => 'sample_rating','number_of_raters' => 780)), + 'star_rating' => '4', + 'phone' => '+351234123456', +); +echo json_encode((new ProductCatalog($id))->createHotel( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.php b/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.php new file mode 100644 index 00000000..e296ab9c --- /dev/null +++ b/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.php @@ -0,0 +1,31 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new ProductCatalog($id))->updateSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/ProductCatalogProductFeedsPostProductFeed.php b/examples/ProductCatalogProductFeedsPostProductFeed.php new file mode 100644 index 00000000..b1140344 --- /dev/null +++ b/examples/ProductCatalogProductFeedsPostProductFeed.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Feed', + 'schedule' => array('interval' => 'DAILY','url' => 'http://www.example.com/sample_feed.tsv','hour' => '22'), +); +echo json_encode((new ProductCatalog($id))->createProductFeed( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/ProductCatalogProductSetsPostHotelSet.php b/examples/ProductCatalogProductSetsPostHotelSet.php new file mode 100644 index 00000000..91aa278a --- /dev/null +++ b/examples/ProductCatalogProductSetsPostHotelSet.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Hotel Set', + 'filter' => array('brand' => array('i_contains' => 'sample brand')), +); +echo json_encode((new ProductCatalog($id))->createProductSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/ProductCatalogProductSetsPostProductSet.php b/examples/ProductCatalogProductSetsPostProductSet.php new file mode 100644 index 00000000..b2eec1f1 --- /dev/null +++ b/examples/ProductCatalogProductSetsPostProductSet.php @@ -0,0 +1,34 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( + 'name' => 'Test Set', + 'filter' => array('product_type' => array('i_contains' => 'shirt')), +); +echo json_encode((new ProductCatalog($id))->createProductSet( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/UserAccountsEdge.php b/examples/UserAccountsEdge.php new file mode 100644 index 00000000..715eaa43 --- /dev/null +++ b/examples/UserAccountsEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new User($id))->getAccounts( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/UserAdAccountsEdge.php b/examples/UserAdAccountsEdge.php new file mode 100644 index 00000000..6a798c31 --- /dev/null +++ b/examples/UserAdAccountsEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new User($id))->getAdAccounts( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/UserLeadGenInfoNode.php b/examples/UserLeadGenInfoNode.php new file mode 100644 index 00000000..d75d96d6 --- /dev/null +++ b/examples/UserLeadGenInfoNode.php @@ -0,0 +1,31 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new Lead($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/UserNode.php b/examples/UserNode.php new file mode 100644 index 00000000..29995ac6 --- /dev/null +++ b/examples/UserNode.php @@ -0,0 +1,31 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new User($id))->getSelf( + $fields, + $params +)->exportAllData(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/VideoThumbnailsEdge.php b/examples/VideoThumbnailsEdge.php new file mode 100644 index 00000000..56617103 --- /dev/null +++ b/examples/VideoThumbnailsEdge.php @@ -0,0 +1,32 @@ +'; +$app_secret = ''; +$app_id = ''; +$id = ''; + +$api = Api::init($app_id, $app_secret, $access_token); +$api->setLogger(new CurlLogger()); + +$fields = array( +); +$params = array( +); +echo json_encode((new AdVideo($id))->getThumbnails( + $fields, + $params +)->getResponse()->getContent(), JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/src/FacebookAds/ApiConfig.php b/src/FacebookAds/ApiConfig.php index b2d6af7c..ce58e552 100644 --- a/src/FacebookAds/ApiConfig.php +++ b/src/FacebookAds/ApiConfig.php @@ -10,6 +10,6 @@ namespace FacebookAds; class ApiConfig { const APIVersion = '21.0'; - const SDKVersion = '21.0.1'; + const SDKVersion = '21.0.2'; const TYPE_CHECKER_STRICT_MODE = false; } diff --git a/src/FacebookAds/Object/Fields/AdCreativeFeatureCustomizationsFields.php b/src/FacebookAds/Object/Fields/AdCreativeFeatureCustomizationsFields.php index c1c31354..acf3dd22 100644 --- a/src/FacebookAds/Object/Fields/AdCreativeFeatureCustomizationsFields.php +++ b/src/FacebookAds/Object/Fields/AdCreativeFeatureCustomizationsFields.php @@ -22,10 +22,12 @@ class AdCreativeFeatureCustomizationsFields extends AbstractEnum { + const IMAGE_CROP_STYLE = 'image_crop_style'; const SHOWCASE_CARD_DISPLAY = 'showcase_card_display'; public function getFieldTypes() { return array( + 'image_crop_style' => 'string', 'showcase_card_display' => 'string', ); }