From edf93b19cb9a2045f8886aa00713f5d24a71232a Mon Sep 17 00:00:00 2001 From: Satwika Reddy Maddi Date: Wed, 9 Oct 2024 09:23:32 -0700 Subject: [PATCH] Auto-generated python SDK code update Summary: ignore-conflict-markers Reviewed By: yoongyj Differential Revision: D64084200 fbshipit-source-id: 32ce38e020aa8aec129388730d89f64a1301bccd --- examples/AdAccountAdCreativesEdge.py | 40 --------- examples/AdAccountAdCreativesPost.py | 41 ---------- ...dAccountAdCreativesPostCreateAdCreative.py | 40 --------- ...ntAdCreativesPostCreateAdCreativeCanvas.py | 41 ---------- ...stCreateAdCreativeCustomizationCanvasDV.py | 41 ---------- ...reateAdCreativeCustomizationCanvasImage.py | 41 ---------- ...reateAdCreativeCustomizationCanvasVideo.py | 41 ---------- examples/AdAccountAdSetsPost2CreateMAIA.py | 48 ----------- examples/AdAccountAdSetsPostAdSetCreateCpa.py | 52 ------------ ...ccountAdSetsPostAdSetCreateCpaAppEvents.py | 50 ----------- .../AdAccountAdSetsPostBehaviorTargeting.py | 46 ----------- examples/AdAccountAdSetsPostBidMultiplier.py | 49 ----------- examples/AdAccountAdSetsPostCreateAdSet.py | 49 ----------- ...dAccountAdSetsPostCreateAudienceNetwork.py | 46 ----------- examples/AdAccountAdSetsPostDailyBudget20.py | 49 ----------- ...AdAccountAdSetsPostDemographicTargeting.py | 48 ----------- .../AdAccountAdSetsPostInterestTargeting.py | 48 ----------- ...SetsPostLifetimeBudget200Duration10Days.py | 49 ----------- ...AccountAdSetsPostOptimizePostEngagement.py | 49 ----------- examples/AdAccountAdSetsPostPageLikes.py | 48 ----------- .../AdAccountAdSetsPostPlacementTargeting.py | 47 ----------- examples/AdAccountAdSetsPostReach.py | 48 ----------- examples/AdAccountAdVideosPost.py | 40 --------- examples/AdAccountAdsPixelEdgeGetPixelCode.py | 39 --------- examples/AdAccountAdsPixelsPost.py | 40 --------- examples/AdAccountAdsPost.py | 43 ---------- examples/AdAccountAdsPostAdsRedownload.py | 44 ---------- .../AdAccountAdsPostTrackingPostEngagement.py | 44 ---------- examples/AdAccountCampaignsEdge.py | 42 ---------- examples/AdAccountCampaignsPostLinkClicks.py | 43 ---------- examples/AdAccountCustomAudiencesEdge.py | 40 --------- ...untCustomAudiencesEdgeDataSourceSubtype.py | 41 ---------- ...CustomAudiencesPostCreateCustomAudience.py | 43 ---------- ...cEventValueBasedLookalikeCustomAudience.py | 42 ---------- ...ynamicValueBasedLookalikeCustomAudience.py | 42 ---------- ...encesPostPlatformCustomAudienceMACARule.py | 42 ---------- ...ustomAudiencesPostPlatformECAExclusions.py | 42 ---------- ...tomAudiencesPostPlatformECAMultiFilters.py | 42 ---------- ...ustomAudiencesPostPlatformECAMultiPages.py | 42 ---------- ...cesPostPlatformEngagementCustomAudience.py | 42 ---------- ...iencesPostPlatformWebsiteCustomAudience.py | 42 ---------- ...omAudiencesPostValueBasedCustomAudience.py | 43 ---------- ...esPostValueBasedLookalikeCustomAudience.py | 43 ---------- examples/AdAccountGeneratePreviewsEdge.py | 41 ---------- ...tGeneratePreviewsEdgeDesktopWithStoryId.py | 41 ---------- ...tGeneratePreviewsEdgeInstagramStandards.py | 41 ---------- ...ratePreviewsEdgeMaiaWithObjectStorySpec.py | 41 ---------- examples/AdAccountNode.py | 39 --------- ...roductAudiencesPostIphoneViewNoPurchase.py | 43 ---------- ...AdAccountProductAudiencesPostNoPurchase.py | 43 ---------- examples/AdAccountReachEstimate.py | 40 --------- examples/AdCampaignGroupAdsEdge.py | 40 --------- ...nGroupAdsEdgeAdgroupsWithStatusArchived.py | 41 ---------- examples/AdCampaignGroupAdsetsEdge.py | 44 ---------- examples/AdCampaignNode.py | 39 --------- examples/AdCampaignPost.py | 39 --------- examples/AdCampaignPostAdsetUpdateCpa.py | 42 ---------- examples/AdCreativeNode.py | 39 --------- examples/AdCreativeNodeRead.py | 40 --------- ...AdCreativeNodeReadInstagramPermalinkUrl.py | 39 --------- examples/AdCreativePreviewsEdge.py | 41 ---------- examples/AdCreativePreviewsEdgePreview.py | 40 --------- ...AdCreativePreviewsEdgePreviewDynamicAds.py | 41 ---------- ...EdgePreviewDynamicAdsWithCustomizations.py | 42 ---------- examples/AdgroupLeadsEdgeAdgroupLeads.py | 39 --------- examples/AdgroupLeadsEdgeAdgroupLeadsDPA.py | 41 ---------- .../AdgroupLeadsEdgeAdgroupLeadsFiltered.py | 40 --------- examples/AdgroupPost.py | 39 --------- examples/AdgroupPostUpdateStatus.py | 39 --------- examples/AdsInsightsEdgeAdCampaignInsights.py | 41 ---------- examples/AdsPixelEventsPost.py | 39 --------- examples/AdsPixelEventsPostCustom.py | 77 ----------------- examples/AdsPixelSharedAccountsEdge.py | 40 --------- examples/AdsPixelSharedAccountsPost.py | 40 --------- examples/AdsPixelSharedAgenciesEdge.py | 39 --------- examples/CustomAudienceDelete.py | 39 --------- examples/CustomAudienceNode.py | 38 --------- examples/CustomAudienceNodeReadRule.py | 40 --------- examples/CustomAudiencePost.py | 39 --------- examples/CustomAudienceUsersPost.py | 39 --------- .../CustomAudienceUsersPostCrossPlatform.py | 39 --------- .../OfflineConversionsCreateOfflineSet.py | 41 ---------- examples/PageFeedEdge.py | 39 --------- examples/PageFeedPost.py | 40 --------- examples/PageFeedPostFeedImageDeepLink.py | 41 ---------- examples/PageNode.py | 42 ---------- examples/PageNodePageSearch.py | 41 ---------- .../PagePageWhatsAppNumberVerificationPost.py | 40 --------- examples/PagePhotosEdge.py | 39 --------- examples/PagePhotosPost.py | 41 ---------- examples/PagePictureEdge.py | 40 --------- examples/PagePostCommentsPost.py | 40 --------- examples/PagePostDelete.py | 39 --------- examples/PagePostNode.py | 38 --------- examples/PagePostPost.py | 39 --------- examples/PagePostsEdge.py | 39 --------- .../PagePostsEdgePagePostCreateCarousel.py | 44 ---------- examples/PageRolesEdge.py | 39 --------- examples/PageSubscribedAppsPost.py | 39 --------- examples/ProductCatalogEventStatsEdge.py | 39 --------- examples/ProductCatalogHotelsPost.py | 49 ----------- ...ogHotelsPostUpdateHotelsCatalogSettings.py | 38 --------- ...oductCatalogProductFeedsPostProductFeed.py | 41 ---------- .../ProductCatalogProductSetsPostHotelSet.py | 41 ---------- ...ProductCatalogProductSetsPostProductSet.py | 41 ---------- examples/UserAccountsEdge.py | 39 --------- examples/UserAdAccountsEdge.py | 39 --------- examples/UserLeadGenInfoNode.py | 38 --------- examples/UserNode.py | 38 --------- examples/VideoThumbnailsEdge.py | 39 --------- facebook_business/__init__.py | 2 +- facebook_business/adobjects/ad.py | 2 + facebook_business/adobjects/adaccount.py | 60 +++++++++++--- .../adobjects/adaccountadruleshistory.py | 4 + .../adobjects/adaccountadvolume.py | 21 +++++ ...ult.py => adaccountlivevideoadvertiser.py} | 24 ++---- .../adobjects/adaccounttargetingunified.py | 1 + facebook_business/adobjects/adactivity.py | 3 + facebook_business/adobjects/adcreative.py | 2 + .../adobjects/adcreativebrandedcontentads.py | 4 + .../adcreativebrandedcontentadspartners.py | 2 + .../adobjects/adcreativefeaturesspec.py | 20 +++++ .../adobjects/adcreativeobjectstoryspec.py | 6 +- .../adobjects/adcreativeproductdata.py | 39 +++++++++ facebook_business/adobjects/adpreview.py | 1 + .../adobjects/adpromotedobject.py | 6 ++ facebook_business/adobjects/adrule.py | 2 + facebook_business/adobjects/adrulehistory.py | 4 + facebook_business/adobjects/adset.py | 8 ++ facebook_business/adobjects/adsinsights.py | 12 +-- ...tificationsettings.py => adsquickviews.py} | 26 ++++-- .../adobjects/adsusersettings.py | 4 + .../adsvalueadjustmentrulecollection.py | 4 +- facebook_business/adobjects/advideo.py | 8 +- .../adobjects/almadaccountinfo.py | 2 + facebook_business/adobjects/application.py | 82 ++++++++----------- facebook_business/adobjects/business.py | 4 +- facebook_business/adobjects/campaign.py | 2 + .../adobjects/catalogitemrejectionreasons.py | 11 +-- .../adobjects/ctwawhatsappnumbersinfo.py | 2 + facebook_business/adobjects/customaudience.py | 19 +++++ facebook_business/adobjects/extendedcredit.py | 63 ++++++++++++++ facebook_business/adobjects/group.py | 53 +----------- facebook_business/adobjects/hotel.py | 10 +++ facebook_business/adobjects/igmedia.py | 2 + .../adobjects/igmediaforigonlyapi.py | 40 +++++++++ .../adobjects/iguserforigonlyapi.py | 39 +++++++++ facebook_business/adobjects/insightsresult.py | 62 +++++++++----- .../adobjects/instagraminsightsresult.py | 1 + ...report.py => messengerbusinesstemplate.py} | 42 +++++----- facebook_business/adobjects/page.py | 41 ++++++++-- .../partnershipadcontentsearchmedia.py | 6 ++ facebook_business/adobjects/placement.py | 81 ++++++++++++++++++ facebook_business/adobjects/productcatalog.py | 31 +++++++ .../productcatalogdiagnosticgroup.py | 36 ++++---- facebook_business/adobjects/productfeed.py | 1 + facebook_business/adobjects/productitem.py | 11 ++- .../adobjects/savedmessageresponse.py | 2 - facebook_business/adobjects/user.py | 14 ++-- facebook_business/adobjects/vehicle.py | 10 +++ facebook_business/adobjects/vehicleoffer.py | 10 +++ .../adobjects/whatsappbusinessaccount.py | 62 ++++++++++++++ facebook_business/apiconfig.py | 4 +- setup.py | 2 +- 164 files changed, 766 insertions(+), 4863 deletions(-) delete mode 100644 examples/AdAccountAdCreativesEdge.py delete mode 100644 examples/AdAccountAdCreativesPost.py delete mode 100644 examples/AdAccountAdCreativesPostCreateAdCreative.py delete mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.py delete mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.py delete mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.py delete mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.py delete mode 100644 examples/AdAccountAdSetsPost2CreateMAIA.py delete mode 100644 examples/AdAccountAdSetsPostAdSetCreateCpa.py delete mode 100644 examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py delete mode 100644 examples/AdAccountAdSetsPostBehaviorTargeting.py delete mode 100644 examples/AdAccountAdSetsPostBidMultiplier.py delete mode 100644 examples/AdAccountAdSetsPostCreateAdSet.py delete mode 100644 examples/AdAccountAdSetsPostCreateAudienceNetwork.py delete mode 100644 examples/AdAccountAdSetsPostDailyBudget20.py delete mode 100644 examples/AdAccountAdSetsPostDemographicTargeting.py delete mode 100644 examples/AdAccountAdSetsPostInterestTargeting.py delete mode 100644 examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py delete mode 100644 examples/AdAccountAdSetsPostOptimizePostEngagement.py delete mode 100644 examples/AdAccountAdSetsPostPageLikes.py delete mode 100644 examples/AdAccountAdSetsPostPlacementTargeting.py delete mode 100644 examples/AdAccountAdSetsPostReach.py delete mode 100644 examples/AdAccountAdVideosPost.py delete mode 100644 examples/AdAccountAdsPixelEdgeGetPixelCode.py delete mode 100644 examples/AdAccountAdsPixelsPost.py delete mode 100644 examples/AdAccountAdsPost.py delete mode 100644 examples/AdAccountAdsPostAdsRedownload.py delete mode 100644 examples/AdAccountAdsPostTrackingPostEngagement.py delete mode 100644 examples/AdAccountCampaignsEdge.py delete mode 100644 examples/AdAccountCampaignsPostLinkClicks.py delete mode 100644 examples/AdAccountCustomAudiencesEdge.py delete mode 100644 examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.py delete mode 100644 examples/AdAccountCustomAudiencesPostCreateCustomAudience.py delete mode 100644 examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.py delete mode 100644 examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.py delete mode 100644 examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.py delete mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAExclusions.py delete mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.py delete mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.py delete mode 100644 examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.py delete mode 100644 examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.py delete mode 100644 examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.py delete mode 100644 examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.py delete mode 100644 examples/AdAccountGeneratePreviewsEdge.py delete mode 100644 examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.py delete mode 100644 examples/AdAccountGeneratePreviewsEdgeInstagramStandards.py delete mode 100644 examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.py delete mode 100644 examples/AdAccountNode.py delete mode 100644 examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.py delete mode 100644 examples/AdAccountProductAudiencesPostNoPurchase.py delete mode 100644 examples/AdAccountReachEstimate.py delete mode 100644 examples/AdCampaignGroupAdsEdge.py delete mode 100644 examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.py delete mode 100644 examples/AdCampaignGroupAdsetsEdge.py delete mode 100644 examples/AdCampaignNode.py delete mode 100644 examples/AdCampaignPost.py delete mode 100644 examples/AdCampaignPostAdsetUpdateCpa.py delete mode 100644 examples/AdCreativeNode.py delete mode 100644 examples/AdCreativeNodeRead.py delete mode 100644 examples/AdCreativeNodeReadInstagramPermalinkUrl.py delete mode 100644 examples/AdCreativePreviewsEdge.py delete mode 100644 examples/AdCreativePreviewsEdgePreview.py delete mode 100644 examples/AdCreativePreviewsEdgePreviewDynamicAds.py delete mode 100644 examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.py delete mode 100644 examples/AdgroupLeadsEdgeAdgroupLeads.py delete mode 100644 examples/AdgroupLeadsEdgeAdgroupLeadsDPA.py delete mode 100644 examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py delete mode 100644 examples/AdgroupPost.py delete mode 100644 examples/AdgroupPostUpdateStatus.py delete mode 100644 examples/AdsInsightsEdgeAdCampaignInsights.py delete mode 100644 examples/AdsPixelEventsPost.py delete mode 100644 examples/AdsPixelEventsPostCustom.py delete mode 100644 examples/AdsPixelSharedAccountsEdge.py delete mode 100644 examples/AdsPixelSharedAccountsPost.py delete mode 100644 examples/AdsPixelSharedAgenciesEdge.py delete mode 100644 examples/CustomAudienceDelete.py delete mode 100644 examples/CustomAudienceNode.py delete mode 100644 examples/CustomAudienceNodeReadRule.py delete mode 100644 examples/CustomAudiencePost.py delete mode 100644 examples/CustomAudienceUsersPost.py delete mode 100644 examples/CustomAudienceUsersPostCrossPlatform.py delete mode 100644 examples/OfflineConversionsCreateOfflineSet.py delete mode 100644 examples/PageFeedEdge.py delete mode 100644 examples/PageFeedPost.py delete mode 100644 examples/PageFeedPostFeedImageDeepLink.py delete mode 100644 examples/PageNode.py delete mode 100644 examples/PageNodePageSearch.py delete mode 100644 examples/PagePageWhatsAppNumberVerificationPost.py delete mode 100644 examples/PagePhotosEdge.py delete mode 100644 examples/PagePhotosPost.py delete mode 100644 examples/PagePictureEdge.py delete mode 100644 examples/PagePostCommentsPost.py delete mode 100644 examples/PagePostDelete.py delete mode 100644 examples/PagePostNode.py delete mode 100644 examples/PagePostPost.py delete mode 100644 examples/PagePostsEdge.py delete mode 100644 examples/PagePostsEdgePagePostCreateCarousel.py delete mode 100644 examples/PageRolesEdge.py delete mode 100644 examples/PageSubscribedAppsPost.py delete mode 100644 examples/ProductCatalogEventStatsEdge.py delete mode 100644 examples/ProductCatalogHotelsPost.py delete mode 100644 examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.py delete mode 100644 examples/ProductCatalogProductFeedsPostProductFeed.py delete mode 100644 examples/ProductCatalogProductSetsPostHotelSet.py delete mode 100644 examples/ProductCatalogProductSetsPostProductSet.py delete mode 100644 examples/UserAccountsEdge.py delete mode 100644 examples/UserAdAccountsEdge.py delete mode 100644 examples/UserLeadGenInfoNode.py delete mode 100644 examples/UserNode.py delete mode 100644 examples/VideoThumbnailsEdge.py rename facebook_business/adobjects/{externaleventsourcedastatsresult.py => adaccountlivevideoadvertiser.py} (50%) create mode 100644 facebook_business/adobjects/adcreativeproductdata.py rename facebook_business/adobjects/{dognotificationsettings.py => adsquickviews.py} (76%) rename facebook_business/adobjects/{panelapireport.py => messengerbusinesstemplate.py} (70%) create mode 100644 facebook_business/adobjects/placement.py diff --git a/examples/AdAccountAdCreativesEdge.py b/examples/AdAccountAdCreativesEdge.py deleted file mode 100644 index c65334a5..00000000 --- a/examples/AdAccountAdCreativesEdge.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', -] -params = { -} -print AdAccount(id).get_ad_creatives( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPost.py b/examples/AdAccountAdCreativesPost.py deleted file mode 100644 index 737637c6..00000000 --- a/examples/AdAccountAdCreativesPost.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Sample Promoted Post', - 'object_story_id': '_', -} -print AdAccount(id).create_ad_creative( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreative.py b/examples/AdAccountAdCreativesPostCreateAdCreative.py deleted file mode 100644 index 9e1055a4..00000000 --- a/examples/AdAccountAdCreativesPostCreateAdCreative.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'object_story_id': '_', -} -print AdAccount(id).create_ad_creative( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.py b/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.py deleted file mode 100644 index 264ea9cc..00000000 --- a/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'image_hash': '', - 'object_story_spec': {'page_id':'','link_data':{'image_hash':'','link':'','name':'Creative message','call_to_action':{'type':'LEARN_MORE'}}}, -} -print AdAccount(id).create_ad_creative( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.py b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.py deleted file mode 100644 index 80ff14c8..00000000 --- a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'object_story_spec': {'page_id':'','template_data':{'format_option':'collection_video','link':'','name':'English Creative title','message':'English Creative message','call_to_action':{'type':'LEARN_MORE'},'retailer_item_ids':[0,0,0,0],'customization_rules_spec':[{'customization_spec':{'language':'en_XX'}},{'customization_spec':{'language':'fr_XX'},'link':'','name':'French Creative title','message':'French Creative message'}]}}, - 'product_set_id': '', -} -print AdAccount(id).create_ad_creative( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.py b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.py deleted file mode 100644 index dab12568..00000000 --- a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'object_story_spec': {'page_id':'','link_data':{'picture':'','link':'','name':'English Creative title','message':'English Creative message','call_to_action':{'type':'LEARN_MORE'},'retailer_item_ids':[0,0,0,0],'customization_rules_spec':[{'customization_spec':{'language':'en_XX'}},{'customization_spec':{'language':'fr_XX'},'picture':'','link':'','name':'French Creative title','message':'French Creative message'}]}}, - 'product_set_id': '', -} -print AdAccount(id).create_ad_creative( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.py b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.py deleted file mode 100644 index 6eb264c0..00000000 --- a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'object_story_spec': {'page_id':'','video_data':{'video_id':'','image_url':'','title':'English Creative title','message':'English Creative message','call_to_action':{'type':'LEARN_MORE','value':{'link':''}},'retailer_item_ids':[0,0,0,0],'customization_rules_spec':[{'customization_spec':{'language':'en_XX'}},{'customization_spec':{'language':'fr_XX'},'video_id':'','picture':'','link':'','name':'French Creative title','message':'French Creative message'}]}}, - 'product_set_id': '', -} -print AdAccount(id).create_ad_creative( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPost2CreateMAIA.py b/examples/AdAccountAdSetsPost2CreateMAIA.py deleted file mode 100644 index 3700087a..00000000 --- a/examples/AdAccountAdSetsPost2CreateMAIA.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Mobile App Installs Ad Set', - 'daily_budget': '1000', - 'bid_amount': '2', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'APP_INSTALLS', - 'campaign_id': '', - 'promoted_object': {'application_id':'','object_store_url':''}, - 'targeting': {'device_platforms':['mobile'],'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network'],'user_os':['IOS']}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpa.py b/examples/AdAccountAdSetsPostAdSetCreateCpa.py deleted file mode 100644 index 4eb1f62a..00000000 --- a/examples/AdAccountAdSetsPostAdSetCreateCpa.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'A CPA Ad Set', - 'campaign_id': '', - 'daily_budget': '5000', - 'start_time': '2024-06-18T16:39:15-0700', - 'end_time': '2024-06-25T16:39:15-0700', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'REACH', - 'bid_amount': '1000', - 'promoted_object': {'page_id':''}, - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, - 'user_os': 'iOS', - 'publisher_platforms': 'facebook', - 'device_platforms': 'mobile', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py deleted file mode 100644 index 2a1f622a..00000000 --- a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'A CPA Ad Set optimized for App Events', - 'campaign_id': '', - 'daily_budget': '300', - 'start_time': '2024-06-18T16:40:02-0700', - 'end_time': '2024-06-25T16:40:02-0700', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'OFFSITE_CONVERSIONS', - 'bid_amount': '100', - 'status': 'PAUSED', - 'promoted_object': {'application_id':'','object_store_url':'','custom_event_type':'PURCHASE'}, - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'user_os':['iOS']}, -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostBehaviorTargeting.py b/examples/AdAccountAdSetsPostBehaviorTargeting.py deleted file mode 100644 index 28785889..00000000 --- a/examples/AdAccountAdSetsPostBehaviorTargeting.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My AdSet', - 'optimization_goal': 'REACH', - 'billing_event': 'IMPRESSIONS', - 'bid_amount': '2', - 'daily_budget': '1000', - 'campaign_id': '', - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'behaviors':[{'id':6007101597783,'name':'Business Travelers'},{'id':6004386044572,'name':'Android Owners (All)'}]}, -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostBidMultiplier.py b/examples/AdAccountAdSetsPostBidMultiplier.py deleted file mode 100644 index e967bf89..00000000 --- a/examples/AdAccountAdSetsPostBidMultiplier.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Adset with bid multiplier', - 'campaign_id': '', - 'daily_budget': '3000', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'OFFSITE_CONVERSIONS', - 'bid_amount': '500', - 'bid_adjustments': {'user_groups':{'gender':{'male':0.8,'female':1}}}, - 'promoted_object': {'product_set_id':'','custom_event_type':'ADD_TO_CART'}, - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateAdSet.py b/examples/AdAccountAdSetsPostCreateAdSet.py deleted file mode 100644 index 8367b5c7..00000000 --- a/examples/AdAccountAdSetsPostCreateAdSet.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First AdSet', - 'lifetime_budget': '20000', - 'start_time': '2024-06-18T16:38:30-0700', - 'end_time': '2024-06-25T16:38:30-0700', - 'campaign_id': '', - 'bid_amount': '500', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'POST_ENGAGEMENT', - 'targeting': {'age_min':20,'age_max':24,'behaviors':[{'id':6002714895372,'name':'All travelers'}],'genders':[1],'geo_locations':{'countries':['US'],'regions':[{'key':'4081'}],'cities':[{'key':'777934','radius':10,'distance_unit':'mile'}]},'interests':[{'id':'','name':''}],'life_events':[{'id':6002714398172,'name':'Newlywed (1 year)'}],'facebook_positions':['feed'],'publisher_platforms':['facebook','audience_network']}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateAudienceNetwork.py b/examples/AdAccountAdSetsPostCreateAudienceNetwork.py deleted file mode 100644 index 4460c923..00000000 --- a/examples/AdAccountAdSetsPostCreateAudienceNetwork.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Ad Set', - 'optimization_goal': 'LINK_CLICKS', - 'billing_event': 'LINK_CLICKS', - 'bid_amount': '2', - 'daily_budget': '1000', - 'campaign_id': '', - 'targeting': {'device_platforms':['mobile'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network'],'facebook_positions':['feed']}, -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostDailyBudget20.py b/examples/AdAccountAdSetsPostDailyBudget20.py deleted file mode 100644 index cdff0eae..00000000 --- a/examples/AdAccountAdSetsPostDailyBudget20.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First Adset', - 'daily_budget': '2000', - 'start_time': '2024-06-11T16:39:34-0700', - 'end_time': '2024-06-18T16:39:34-0700', - 'campaign_id': '', - 'bid_amount': '100', - 'billing_event': 'LINK_CLICKS', - 'optimization_goal': 'LINK_CLICKS', - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostDemographicTargeting.py b/examples/AdAccountAdSetsPostDemographicTargeting.py deleted file mode 100644 index 5a1b0a2b..00000000 --- a/examples/AdAccountAdSetsPostDemographicTargeting.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First AdSet', - 'daily_budget': '10000', - 'bid_amount': '300', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'REACH', - 'campaign_id': '', - 'promoted_object': {'page_id':''}, - 'targeting': {'facebook_positions':['feed'],'age_max':24,'age_min':20,'behaviors':[{'id':6002714895372,'name':'All travelers'}],'device_platforms':['mobile'],'genders':[1],'geo_locations':{'countries':['US'],'regions':[{'key':'4081'}],'cities':[{'key':777934,'radius':10,'distance_unit':'mile'}]},'interests':[{'id':'','name':''}],'life_events':[{'id':6002714398172,'name':'Newlywed (1 year)'}],'publisher_platforms':['facebook','audience_network']}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostInterestTargeting.py b/examples/AdAccountAdSetsPostInterestTargeting.py deleted file mode 100644 index 6550ee81..00000000 --- a/examples/AdAccountAdSetsPostInterestTargeting.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First AdSet', - 'daily_budget': '10000', - 'bid_amount': '300', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'REACH', - 'campaign_id': '', - 'promoted_object': {'page_id':''}, - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US'],'regions':[{'key':'4081'}],'cities':[{'key':777934,'radius':10,'distance_unit':'mile'}]},'genders':[1],'age_max':24,'age_min':20,'publisher_platforms':['facebook','audience_network'],'device_platforms':['mobile'],'flexible_spec':[{'interests':[{'id':'','name':''}]}]}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py deleted file mode 100644 index d78657ff..00000000 --- a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First Adset', - 'lifetime_budget': '20000', - 'start_time': '2024-06-11T16:39:43-0700', - 'end_time': '2024-06-21T16:39:43-0700', - 'campaign_id': '', - 'bid_amount': '100', - 'billing_event': 'LINK_CLICKS', - 'optimization_goal': 'LINK_CLICKS', - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network']}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostOptimizePostEngagement.py b/examples/AdAccountAdSetsPostOptimizePostEngagement.py deleted file mode 100644 index 81cefea6..00000000 --- a/examples/AdAccountAdSetsPostOptimizePostEngagement.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First Adset', - 'lifetime_budget': '20000', - 'start_time': '2024-06-11T16:39:52-0700', - 'end_time': '2024-06-21T16:39:52-0700', - 'campaign_id': '', - 'bid_amount': '500', - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'POST_ENGAGEMENT', - 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US'],'regions':[{'key':'4081'}],'cities':[{'key':777934,'radius':10,'distance_unit':'mile'}]},'genders':[1],'age_max':24,'age_min':20,'behaviors':[{'id':6002714895372,'name':'All travelers'}],'life_events':[{'id':6002714398172,'name':'Newlywed (1 year)'}],'publisher_platforms':['facebook'],'device_platforms':['desktop']}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostPageLikes.py b/examples/AdAccountAdSetsPostPageLikes.py deleted file mode 100644 index b67474d5..00000000 --- a/examples/AdAccountAdSetsPostPageLikes.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Reach Ad Set', - 'optimization_goal': 'REACH', - 'billing_event': 'IMPRESSIONS', - 'bid_amount': '2', - 'daily_budget': '1000', - 'campaign_id': '', - 'targeting': {'geo_locations':{'countries':['US']},'facebook_positions':['feed']}, - 'status': 'PAUSED', - 'promoted_object': {'page_id':''}, -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostPlacementTargeting.py b/examples/AdAccountAdSetsPostPlacementTargeting.py deleted file mode 100644 index 06223494..00000000 --- a/examples/AdAccountAdSetsPostPlacementTargeting.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My AdSet', - 'optimization_goal': 'REACH', - 'billing_event': 'IMPRESSIONS', - 'bid_amount': '2', - 'daily_budget': '1000', - 'campaign_id': '', - 'targeting': {'geo_locations':{'countries':['US']},'publisher_platforms':['facebook'],'facebook_positions':['feed']}, - 'promoted_object': {'page_id':''}, -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostReach.py b/examples/AdAccountAdSetsPostReach.py deleted file mode 100644 index feac5906..00000000 --- a/examples/AdAccountAdSetsPostReach.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Reach Ad Set', - 'optimization_goal': 'REACH', - 'billing_event': 'IMPRESSIONS', - 'bid_amount': '2', - 'daily_budget': '1000', - 'campaign_id': '', - 'targeting': {'excluded_geo_locations':{'regions':[{'key':'3847'}]},'geo_locations':{'countries':['US']},'facebook_positions':['feed']}, - 'status': 'PAUSED', - 'promoted_object': {'page_id':''}, -} -print AdAccount(id).create_ad_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdVideosPost.py b/examples/AdAccountAdVideosPost.py deleted file mode 100644 index 3fb856ec..00000000 --- a/examples/AdAccountAdVideosPost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.advideo import AdVideo -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'source': '', -} -print AdAccount(id).create_ad_video( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdsPixelEdgeGetPixelCode.py b/examples/AdAccountAdsPixelEdgeGetPixelCode.py deleted file mode 100644 index d92f370f..00000000 --- a/examples/AdAccountAdsPixelEdgeGetPixelCode.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adspixel import AdsPixel -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'code', -] -params = { -} -print AdsPixel(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdsPixelsPost.py b/examples/AdAccountAdsPixelsPost.py deleted file mode 100644 index f8f8149d..00000000 --- a/examples/AdAccountAdsPixelsPost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adspixel import AdsPixel -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My WCA Pixel', -} -print AdAccount(id).create_ads_pixel( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdsPost.py b/examples/AdAccountAdsPost.py deleted file mode 100644 index a2a6261e..00000000 --- a/examples/AdAccountAdsPost.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Ad', - 'adset_id': '', - 'creative': {'creative_id':''}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdsPostAdsRedownload.py b/examples/AdAccountAdsPostAdsRedownload.py deleted file mode 100644 index 4e0ace5f..00000000 --- a/examples/AdAccountAdsPostAdsRedownload.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My AdGroup with Redownload', - 'adset_id': '', - 'creative': {'creative_id':''}, - 'redownload': '1', - 'status': 'PAUSED', -} -print AdAccount(id).create_ad( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountAdsPostTrackingPostEngagement.py b/examples/AdAccountAdsPostTrackingPostEngagement.py deleted file mode 100644 index 971abb06..00000000 --- a/examples/AdAccountAdsPostTrackingPostEngagement.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My First Ad', - 'adset_id': '', - 'creative': {'creative_id':''}, - 'tracking_specs': {'action.type':'post_engagement','post':'','page':''}, - 'status': 'PAUSED', -} -print AdAccount(id).create_ad( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCampaignsEdge.py b/examples/AdAccountCampaignsEdge.py deleted file mode 100644 index 5ee13da5..00000000 --- a/examples/AdAccountCampaignsEdge.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.campaign import Campaign -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', - 'objective', -] -params = { - 'effective_status': ['ACTIVE','PAUSED'], -} -print AdAccount(id).get_campaigns( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLinkClicks.py b/examples/AdAccountCampaignsPostLinkClicks.py deleted file mode 100644 index 15c1716f..00000000 --- a/examples/AdAccountCampaignsPostLinkClicks.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.campaign import Campaign -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My campaign', - 'objective': 'OUTCOME_TRAFFIC', - 'status': 'PAUSED', - 'special_ad_categories': [], -} -print AdAccount(id).create_campaign( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesEdge.py b/examples/AdAccountCustomAudiencesEdge.py deleted file mode 100644 index 2bc3ae1b..00000000 --- a/examples/AdAccountCustomAudiencesEdge.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'id', -] -params = { -} -print AdAccount(id).get_custom_audiences( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.py b/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.py deleted file mode 100644 index 2d60c20a..00000000 --- a/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'data_source', - 'subtype', -] -params = { -} -print AdAccount(id).get_custom_audiences( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostCreateCustomAudience.py b/examples/AdAccountCustomAudiencesPostCreateCustomAudience.py deleted file mode 100644 index 932eb285..00000000 --- a/examples/AdAccountCustomAudiencesPostCreateCustomAudience.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My new Custom Audience', - 'subtype': 'CUSTOM', - 'description': 'People who purchased on my website', - 'customer_file_source': 'USER_PROVIDED_ONLY', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.py b/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.py deleted file mode 100644 index db8a0d29..00000000 --- a/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Value-Based lookalike from Pixel', - 'subtype': 'LOOKALIKE', - 'lookalike_spec': {'origin_event_sources':[{'id':'','event_names':['AddToCart']}],'type':'custom_ratio','ratio':0.01,'country':'US'}, -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.py b/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.py deleted file mode 100644 index 7da0275a..00000000 --- a/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Value-Based lookalike from Pixel', - 'subtype': 'LOOKALIKE', - 'lookalike_spec': {'origin_event_sources':[{'id':''}],'type':'custom_ratio','ratio':0.01,'country':'US'}, -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.py b/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.py deleted file mode 100644 index 705aae0d..00000000 --- a/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Test Website Custom Audience', - 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'app'}],'retention_seconds':8400,'filter':{'operator':'and','filters':[{'field':'event','operator':'eq','value':'fb_mobile_purchase'}]}}]}}, - 'prefill': '1', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.py b/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.py deleted file mode 100644 index 53a83741..00000000 --- a/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Test Engagement Custom Audience', - 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'page'}],'retention_seconds':31536000,'filter':{'operator':'and','filters':[{'field':'event','operator':'eq','value':'page_engaged'}]}}]},'exclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'page'}],'retention_seconds':31536000,'filter':{'operator':'and','filters':[{'field':'event','operator':'eq','value':'page_cta_clicked'}]}}]}}, - 'prefill': '1', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.py b/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.py deleted file mode 100644 index 85ddc60c..00000000 --- a/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Test Engagement Custom Audience', - 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'page'}],'retention_seconds':31536000,'filter':{'operator':'and','filters':[{'field':'event','operator':'eq','value':'page_engaged'},{'field':'event','operator':'eq','value':'page_engaged'}]}}]}}, - 'prefill': '1', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.py b/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.py deleted file mode 100644 index 8d6d2b0f..00000000 --- a/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Test Engagement Custom Audience', - 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'page'},{'id':'','type':'page'}],'retention_seconds':31536000,'filter':{'operator':'and','filters':[{'field':'event','operator':'eq','value':'page_engaged'}]}}]}}, - 'prefill': '1', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.py b/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.py deleted file mode 100644 index 7129efc4..00000000 --- a/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Test Engagement Custom Audience', - 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'page'}],'retention_seconds':31536000,'filter':{'operator':'and','filters':[{'field':'event','operator':'eq','value':'page_engaged'}]}}]}}, - 'prefill': '1', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.py b/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.py deleted file mode 100644 index a0ad79b5..00000000 --- a/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My Test Website Custom Audience', - 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'','type':'pixel'}],'retention_seconds':8400,'filter':{'operator':'and','filters':[{'field':'url','operator':'i_contains','value':'shoes'}]}}]}}, - 'prefill': '1', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.py b/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.py deleted file mode 100644 index 57d46447..00000000 --- a/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Value-Based Custom Audience', - 'subtype': 'CUSTOM', - 'is_value_based': '1', - 'customer_file_source': 'PARTNER_PROVIDED_ONLY', -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.py b/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.py deleted file mode 100644 index 324d619d..00000000 --- a/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Value-Based lookalike', - 'subtype': 'LOOKALIKE', - 'origin_audience_id': '', - 'lookalike_spec': {'type':'custom_ratio','ratio':0.01,'country':'US'}, -} -print AdAccount(id).create_custom_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdge.py b/examples/AdAccountGeneratePreviewsEdge.py deleted file mode 100644 index 40d4d2ce..00000000 --- a/examples/AdAccountGeneratePreviewsEdge.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'creative': '', - 'ad_format': '', -} -print AdAccount(id).get_generate_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.py b/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.py deleted file mode 100644 index 872bed50..00000000 --- a/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'creative': {'object_story_id':'_'}, - 'ad_format': 'DESKTOP_FEED_STANDARD', -} -print AdAccount(id).get_generate_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.py b/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.py deleted file mode 100644 index d86f3d96..00000000 --- a/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'creative': {'instagram_actor_id':'','object_story_spec':{'link_data':{'call_to_action':{'type':'LEARN_MORE','value':{'link':''}},'caption':'www.example.com','image_hash':'','link':'','message':'Message'},'page_id':''}}, - 'ad_format': 'INSTAGRAM_STANDARD', -} -print AdAccount(id).get_generate_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.py b/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.py deleted file mode 100644 index ecdc7409..00000000 --- a/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'creative': {'object_story_spec':{'link_data':{'call_to_action':{'type':'USE_APP','value':{'link':''}},'description':'Description','link':'','message':'Message','name':'Name','picture':''},'page_id':''}}, - 'ad_format': 'MOBILE_FEED_STANDARD', -} -print AdAccount(id).get_generate_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountNode.py b/examples/AdAccountNode.py deleted file mode 100644 index 4ca656fe..00000000 --- a/examples/AdAccountNode.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', -] -params = { -} -print AdAccount(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.py b/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.py deleted file mode 100644 index a7815ca6..00000000 --- a/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Iphone Product Audience', - 'product_set_id': '', - 'inclusions': [{'retention_seconds':86400,'rule':{'and':[{'event':{'eq':'AddToCart'}},{'userAgent':{'i_contains':'iPhone'}}]}}], - 'exclusions': [{'retention_seconds':172800,'rule':{'event':{'eq':'Purchase'}}}], -} -print AdAccount(id).create_product_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountProductAudiencesPostNoPurchase.py b/examples/AdAccountProductAudiencesPostNoPurchase.py deleted file mode 100644 index b17f0585..00000000 --- a/examples/AdAccountProductAudiencesPostNoPurchase.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Product Audience', - 'product_set_id': '', - 'inclusions': [{'retention_seconds':86400,'rule':{'event':{'eq':'AddToCart'}}},{'retention_seconds':72000,'rule':{'event':{'eq':'ViewContent'}}}], - 'exclusions': [{'retention_seconds':172800,'rule':{'event':{'eq':'Purchase'}}}], -} -print AdAccount(id).create_product_audience( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdAccountReachEstimate.py b/examples/AdAccountReachEstimate.py deleted file mode 100644 index 86b7cfaa..00000000 --- a/examples/AdAccountReachEstimate.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.adobjects.adaccountreachestimate import AdAccountReachEstimate -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'targeting_spec': {'geo_locations':{'countries':['US']},'age_min':20,'age_max':40}, -} -print AdAccount(id).get_reach_estimate( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsEdge.py b/examples/AdCampaignGroupAdsEdge.py deleted file mode 100644 index b95cadd6..00000000 --- a/examples/AdCampaignGroupAdsEdge.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.campaign import Campaign -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', -] -params = { -} -print Campaign(id).get_ads( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.py b/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.py deleted file mode 100644 index 208487c1..00000000 --- a/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.campaign import Campaign -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', -] -params = { - 'effective_status': ['ARCHIVED'], -} -print Campaign(id).get_ads( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsetsEdge.py b/examples/AdCampaignGroupAdsetsEdge.py deleted file mode 100644 index c8f9d1ed..00000000 --- a/examples/AdCampaignGroupAdsetsEdge.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.campaign import Campaign -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', - 'start_time', - 'end_time', - 'daily_budget', - 'lifetime_budget', -] -params = { -} -print Campaign(id).get_ad_sets( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCampaignNode.py b/examples/AdCampaignNode.py deleted file mode 100644 index cdf9cf77..00000000 --- a/examples/AdCampaignNode.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'adset_schedule', -] -params = { -} -print AdSet(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCampaignPost.py b/examples/AdCampaignPost.py deleted file mode 100644 index 74b83068..00000000 --- a/examples/AdCampaignPost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'bid_adjustments': {'user_groups':{'user_bucket':{'event_sources':['',''],'1':0.1,'2':0.2,'3':0.3,'default':{'gender':{'male':0.99,'female':0.12}}}}}, -} -print AdSet(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCampaignPostAdsetUpdateCpa.py b/examples/AdCampaignPostAdsetUpdateCpa.py deleted file mode 100644 index 428dcb2d..00000000 --- a/examples/AdCampaignPostAdsetUpdateCpa.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adset import AdSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'billing_event': 'IMPRESSIONS', - 'optimization_goal': 'LINK_CLICKS', - 'bid_amount': '200', - 'targeting': {'geo_locations':{'countries':['US']},'facebook_positions':['feed']}, -} -print AdSet(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativeNode.py b/examples/AdCreativeNode.py deleted file mode 100644 index 3e0db783..00000000 --- a/examples/AdCreativeNode.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'asset_feed_spec', -] -params = { -} -print AdCreative(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativeNodeRead.py b/examples/AdCreativeNodeRead.py deleted file mode 100644 index 9b184d5c..00000000 --- a/examples/AdCreativeNodeRead.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', - 'object_story_id', -] -params = { -} -print AdCreative(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativeNodeReadInstagramPermalinkUrl.py b/examples/AdCreativeNodeReadInstagramPermalinkUrl.py deleted file mode 100644 index 1abc4542..00000000 --- a/examples/AdCreativeNodeReadInstagramPermalinkUrl.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'instagram_permalink_url', -] -params = { -} -print AdCreative(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdge.py b/examples/AdCreativePreviewsEdge.py deleted file mode 100644 index b7c98fa0..00000000 --- a/examples/AdCreativePreviewsEdge.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'ad_format': 'DESKTOP_FEED_STANDARD', - 'product_item_ids': [''], -} -print AdCreative(id).get_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreview.py b/examples/AdCreativePreviewsEdgePreview.py deleted file mode 100644 index 48ea231a..00000000 --- a/examples/AdCreativePreviewsEdgePreview.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'ad_format': 'DESKTOP_FEED_STANDARD', -} -print AdCreative(id).get_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreviewDynamicAds.py b/examples/AdCreativePreviewsEdgePreviewDynamicAds.py deleted file mode 100644 index b7c98fa0..00000000 --- a/examples/AdCreativePreviewsEdgePreviewDynamicAds.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'ad_format': 'DESKTOP_FEED_STANDARD', - 'product_item_ids': [''], -} -print AdCreative(id).get_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.py b/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.py deleted file mode 100644 index 7abe17a2..00000000 --- a/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adcreative import AdCreative -from facebook_business.adobjects.adpreview import AdPreview -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'ad_format': 'DESKTOP_FEED_STANDARD', - 'product_item_ids': [''], - 'dynamic_customization': {'language':'fr_XX','country':'FR'}, -} -print AdCreative(id).get_previews( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeads.py b/examples/AdgroupLeadsEdgeAdgroupLeads.py deleted file mode 100644 index 7363c4f9..00000000 --- a/examples/AdgroupLeadsEdgeAdgroupLeads.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.ad import Ad -from facebook_business.adobjects.lead import Lead -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print Ad(id).get_leads( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.py b/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.py deleted file mode 100644 index 643dfb65..00000000 --- a/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.ad import Ad -from facebook_business.adobjects.lead import Lead -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'field_data', - 'retailer_item_id', -] -params = { -} -print Ad(id).get_leads( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py deleted file mode 100644 index 4b8b7221..00000000 --- a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.ad import Ad -from facebook_business.adobjects.lead import Lead -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1717544918}], -} -print Ad(id).get_leads( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdgroupPost.py b/examples/AdgroupPost.py deleted file mode 100644 index 5be22bdd..00000000 --- a/examples/AdgroupPost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'My New Ad', -} -print Ad(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdgroupPostUpdateStatus.py b/examples/AdgroupPostUpdateStatus.py deleted file mode 100644 index e274401f..00000000 --- a/examples/AdgroupPostUpdateStatus.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.ad import Ad -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'adgroup_status': 'PAUSED', -} -print Ad(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdsInsightsEdgeAdCampaignInsights.py b/examples/AdsInsightsEdgeAdCampaignInsights.py deleted file mode 100644 index 3c829adf..00000000 --- a/examples/AdsInsightsEdgeAdCampaignInsights.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adset import AdSet -from facebook_business.adobjects.adsinsights import AdsInsights -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'impressions', -] -params = { - 'breakdown': 'publisher_platform', -} -print AdSet(id).get_insights( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdsPixelEventsPost.py b/examples/AdsPixelEventsPost.py deleted file mode 100644 index 22e0acb1..00000000 --- a/examples/AdsPixelEventsPost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adspixel import AdsPixel -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'data': [{'event_name':'PageView','event_time':1718149023,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}], -} -print AdsPixel(id).create_event( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdsPixelEventsPostCustom.py b/examples/AdsPixelEventsPostCustom.py deleted file mode 100644 index 1781674f..00000000 --- a/examples/AdsPixelEventsPostCustom.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -import time - -from facebook_business.adobjects.serverside.action_source import ActionSource -from facebook_business.adobjects.serverside.content import Content -from facebook_business.adobjects.serverside.custom_data import CustomData -from facebook_business.adobjects.serverside.delivery_category import DeliveryCategory -from facebook_business.adobjects.serverside.event import Event -from facebook_business.adobjects.serverside.event_request import EventRequest -from facebook_business.adobjects.serverside.user_data import UserData -from facebook_business.api import FacebookAdsApi - -access_token = '' -pixel_id = 'ADS_PIXEL_ID>' - -FacebookAdsApi.init(access_token=access_token) - -user_data = UserData( - emails=['joe@eg.com'], - phones=['12345678901', '14251234567'], - # It is recommended to send Client IP and User Agent for Conversions API Events. - client_ip_address=request.META.get('REMOTE_ADDR'), - client_user_agent=request.headers['User-Agent'], - fbc='fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890', - fbp='fb.1.1558571054389.1098115397', -) - -content = Content( - product_id='product123', - quantity=1, - delivery_category=DeliveryCategory.HOME_DELIVERY, -) - -custom_data = CustomData( - contents=[content], - currency='usd', - value=123.45, -) - -event = Event( - event_name='Purchase', - event_time=int(time.time()), - user_data=user_data, - custom_data=custom_data, - event_source_url='http://jaspers-market.com/product/123', - action_source=ActionSource.WEBSITE, -) - -events = [event] - -event_request = EventRequest( - events=events, - pixel_id=pixel_id, -) - -event_response = event_request.execute() -print(event_response) \ No newline at end of file diff --git a/examples/AdsPixelSharedAccountsEdge.py b/examples/AdsPixelSharedAccountsEdge.py deleted file mode 100644 index 6ea5fd18..00000000 --- a/examples/AdsPixelSharedAccountsEdge.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adspixel import AdsPixel -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'business': '', -} -print AdsPixel(id).get_shared_accounts( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdsPixelSharedAccountsPost.py b/examples/AdsPixelSharedAccountsPost.py deleted file mode 100644 index 52a80efe..00000000 --- a/examples/AdsPixelSharedAccountsPost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adspixel import AdsPixel -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'account_id': '', - 'business': '', -} -print AdsPixel(id).create_shared_account( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/AdsPixelSharedAgenciesEdge.py b/examples/AdsPixelSharedAgenciesEdge.py deleted file mode 100644 index 2e8803e4..00000000 --- a/examples/AdsPixelSharedAgenciesEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.adspixel import AdsPixel -from facebook_business.adobjects.business import Business -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print AdsPixel(id).get_shared_agencies( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/CustomAudienceDelete.py b/examples/CustomAudienceDelete.py deleted file mode 100644 index 2dcbe7c4..00000000 --- a/examples/CustomAudienceDelete.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.adobjects.abstractobject import AbstractObject -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print CustomAudience(id).delete( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/CustomAudienceNode.py b/examples/CustomAudienceNode.py deleted file mode 100644 index 882b731f..00000000 --- a/examples/CustomAudienceNode.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print CustomAudience(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/CustomAudienceNodeReadRule.py b/examples/CustomAudienceNodeReadRule.py deleted file mode 100644 index 4b7f01c9..00000000 --- a/examples/CustomAudienceNodeReadRule.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'name', - 'rule', -] -params = { -} -print CustomAudience(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/CustomAudiencePost.py b/examples/CustomAudiencePost.py deleted file mode 100644 index f19052c2..00000000 --- a/examples/CustomAudiencePost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Updated Name for CA', -} -print CustomAudience(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/CustomAudienceUsersPost.py b/examples/CustomAudienceUsersPost.py deleted file mode 100644 index 76e0e003..00000000 --- a/examples/CustomAudienceUsersPost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'payload': {'schema':['EMAIL','LOOKALIKE_VALUE'],'data':[['9b431636bd164765d63c573c346708846af4f68fe3701a77a3bdd7e7e5166254',44.5],['8cc62c145cd0c6dc444168eaeb1b61b351f9b1809a579cc9b4c9e9d7213a39ee',140],['4eaf70b1f7a797962b9d2a533f122c8039012b31e0a52b34a426729319cb792a',0],['98df8d46f118f8bef552b0ec0a3d729466a912577830212a844b73960777ac56',0.9]]}, -} -print CustomAudience(id).create_user( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/CustomAudienceUsersPostCrossPlatform.py b/examples/CustomAudienceUsersPostCrossPlatform.py deleted file mode 100644 index 6811e13e..00000000 --- a/examples/CustomAudienceUsersPostCrossPlatform.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.customaudience import CustomAudience -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'payload': {'schema':['EMAIL','MADID','APPUID','LOOKALIKE_VALUE'],'app_ids':[''],'data':[['b36a83701f1c3191e19722d6f90274bc1b5501fe69ebf33313e440fe4b0fe210','6032d997-3ab0-4de0-aa16-8af0e5b482fb','1234567890','0.9'],['2b3b2b9ce842ab8b6a6c614cb1f9604bb8a0d502d1af49c526b72b10894e95b5','B67385F8-9A82-4670-8C0A-6F9EA7513F5F','','0'],['898628e28890f937bdf009391def42879c401a4bcf1b5fd24e738d9f5da8cbbb','','9876543210','0.4']]}, -} -print CustomAudience(id).create_user( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/OfflineConversionsCreateOfflineSet.py b/examples/OfflineConversionsCreateOfflineSet.py deleted file mode 100644 index fde301a0..00000000 --- a/examples/OfflineConversionsCreateOfflineSet.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.business import Business -from facebook_business.adobjects.offlineconversiondataset import OfflineConversionDataSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'offline_event_set', - 'description': 'conversion data used for superbowl campaign', -} -print Business(id).create_offline_conversion_data_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageFeedEdge.py b/examples/PageFeedEdge.py deleted file mode 100644 index f1037c88..00000000 --- a/examples/PageFeedEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print Page(id).get_feed( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageFeedPost.py b/examples/PageFeedPost.py deleted file mode 100644 index 8df6d3b2..00000000 --- a/examples/PageFeedPost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'message': 'This is a test value', -} -print Page(id).create_feed( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageFeedPostFeedImageDeepLink.py b/examples/PageFeedPostFeedImageDeepLink.py deleted file mode 100644 index 58cf6ac1..00000000 --- a/examples/PageFeedPostFeedImageDeepLink.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'message': 'This is a test message', - 'call_to_action': {'type':'BUY_NOW','value':{'link':'','app_link':''}}, -} -print Page(id).create_feed( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageNode.py b/examples/PageNode.py deleted file mode 100644 index d10a57a5..00000000 --- a/examples/PageNode.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ - 'location{latitude', - 'longitude}', - 'is_permanently_closed', -] -params = { - 'limit': '30000', -} -print Page(id).get_locations( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageNodePageSearch.py b/examples/PageNodePageSearch.py deleted file mode 100644 index fd24b9b5..00000000 --- a/examples/PageNodePageSearch.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'type': 'adradiussuggestion', - 'latitude': '51.5152253', - 'longitude': '-0.1423029', -} -print Page(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePageWhatsAppNumberVerificationPost.py b/examples/PagePageWhatsAppNumberVerificationPost.py deleted file mode 100644 index c7e4a898..00000000 --- a/examples/PagePageWhatsAppNumberVerificationPost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'whatsapp_number': '123456789', - 'verification_code': '12345', -} -print Page(id).create_page_whatsapp_number_verification( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePhotosEdge.py b/examples/PagePhotosEdge.py deleted file mode 100644 index 18842325..00000000 --- a/examples/PagePhotosEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.photo import Photo -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print Page(id).get_photos( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePhotosPost.py b/examples/PagePhotosPost.py deleted file mode 100644 index 093d0fee..00000000 --- a/examples/PagePhotosPost.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.photo import Photo -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'url': 'https://www.facebook.com/images/fb_icon_325x325.png', - 'published': 'false', -} -print Page(id).create_photo( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePictureEdge.py b/examples/PagePictureEdge.py deleted file mode 100644 index cd4e9a23..00000000 --- a/examples/PagePictureEdge.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.profilepicturesource import ProfilePictureSource -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'redirect': '0', -} -print Page(id).get_picture( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePostCommentsPost.py b/examples/PagePostCommentsPost.py deleted file mode 100644 index a1530042..00000000 --- a/examples/PagePostCommentsPost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.adobjects.comment import Comment -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'message': 'This is a test value', -} -print PagePost(id).create_comment( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePostDelete.py b/examples/PagePostDelete.py deleted file mode 100644 index 50f0ebe9..00000000 --- a/examples/PagePostDelete.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.adobjects.abstractobject import AbstractObject -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print PagePost(id).delete( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePostNode.py b/examples/PagePostNode.py deleted file mode 100644 index be90316d..00000000 --- a/examples/PagePostNode.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print PagePost(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePostPost.py b/examples/PagePostPost.py deleted file mode 100644 index c713ef03..00000000 --- a/examples/PagePostPost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'message': 'This is a test value', -} -print PagePost(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePostsEdge.py b/examples/PagePostsEdge.py deleted file mode 100644 index c65c7dce..00000000 --- a/examples/PagePostsEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print Page(id).get_posts( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PagePostsEdgePagePostCreateCarousel.py b/examples/PagePostsEdgePagePostCreateCarousel.py deleted file mode 100644 index cefdf17f..00000000 --- a/examples/PagePostsEdgePagePostCreateCarousel.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.pagepost import PagePost -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'message': 'Browse our latest products', - 'published': '0', - 'child_attachments': [{'link':'','name':'Product 1','description':'$4.99','image_hash':''},{'link':'','name':'Product 2','description':'$4.99','image_hash':''},{'link':'','name':'Product 3','description':'$4.99','image_hash':''},{'link':'','name':'Product 4','description':'$4.99','image_hash':''}], - 'caption': 'WWW.EXAMPLE.COM', - 'link': 'http://www.example.com/products', -} -print Page(id).get_posts( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageRolesEdge.py b/examples/PageRolesEdge.py deleted file mode 100644 index 5a33b30c..00000000 --- a/examples/PageRolesEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.adobjects.user import User -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print Page(id).get_roles( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/PageSubscribedAppsPost.py b/examples/PageSubscribedAppsPost.py deleted file mode 100644 index c50f43b5..00000000 --- a/examples/PageSubscribedAppsPost.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.page import Page -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'subscribed_fields': 'leadgen', -} -print Page(id).create_subscribed_app( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/ProductCatalogEventStatsEdge.py b/examples/ProductCatalogEventStatsEdge.py deleted file mode 100644 index c2e2826e..00000000 --- a/examples/ProductCatalogEventStatsEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.productcatalog import ProductCatalog -from facebook_business.adobjects.producteventstat import ProductEventStat -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print ProductCatalog(id).get_event_stats( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/ProductCatalogHotelsPost.py b/examples/ProductCatalogHotelsPost.py deleted file mode 100644 index 7457ab52..00000000 --- a/examples/ProductCatalogHotelsPost.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.productcatalog import ProductCatalog -from facebook_business.adobjects.hotel import Hotel -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'hotel_id': 'h_1', - 'name': 'Sample Hotel', - 'description': 'hotel description', - 'brand': 'hotel brand', - 'url': 'http://www.example.com/samplehotel', - 'images': [{'image_url':'https://www.example.com/pic1.jpg','tags':['front view','balcony']},{'image_url':'http://www.example.com/pic2.jpg','tags':['lobby view']}], - 'address': {'street_address':'1 Hacker Way','city':'Menlo Park','region':'California','country':'United States','postal_code':'94025','neighborhoods':['Palo Alto','Menlo Park'],'latitude':37.484116,'longitude':-122.148244}, - 'guest_ratings': [{'score':7.8,'max_score':10,'rating_system':'sample_rating','number_of_raters':780}], - 'star_rating': '4', - 'phone': '+351234123456', -} -print ProductCatalog(id).create_hotel( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.py b/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.py deleted file mode 100644 index e5a80644..00000000 --- a/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.productcatalog import ProductCatalog -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print ProductCatalog(id).update( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/ProductCatalogProductFeedsPostProductFeed.py b/examples/ProductCatalogProductFeedsPostProductFeed.py deleted file mode 100644 index 538b2fee..00000000 --- a/examples/ProductCatalogProductFeedsPostProductFeed.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.productcatalog import ProductCatalog -from facebook_business.adobjects.productfeed import ProductFeed -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Feed', - 'schedule': {'interval':'DAILY','url':'http://www.example.com/sample_feed.tsv','hour':'22'}, -} -print ProductCatalog(id).create_product_feed( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/ProductCatalogProductSetsPostHotelSet.py b/examples/ProductCatalogProductSetsPostHotelSet.py deleted file mode 100644 index b7449e65..00000000 --- a/examples/ProductCatalogProductSetsPostHotelSet.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.productcatalog import ProductCatalog -from facebook_business.adobjects.productset import ProductSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Hotel Set', - 'filter': {'brand':{'i_contains':'sample brand'}}, -} -print ProductCatalog(id).create_product_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/ProductCatalogProductSetsPostProductSet.py b/examples/ProductCatalogProductSetsPostProductSet.py deleted file mode 100644 index f852f1d8..00000000 --- a/examples/ProductCatalogProductSetsPostProductSet.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.productcatalog import ProductCatalog -from facebook_business.adobjects.productset import ProductSet -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { - 'name': 'Test Set', - 'filter': {'product_type':{'i_contains':'shirt'}}, -} -print ProductCatalog(id).create_product_set( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/UserAccountsEdge.py b/examples/UserAccountsEdge.py deleted file mode 100644 index be7269c5..00000000 --- a/examples/UserAccountsEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.user import User -from facebook_business.adobjects.page import Page -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print User(id).get_accounts( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/UserAdAccountsEdge.py b/examples/UserAdAccountsEdge.py deleted file mode 100644 index f46e245a..00000000 --- a/examples/UserAdAccountsEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.user import User -from facebook_business.adobjects.adaccount import AdAccount -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print User(id).get_ad_accounts( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/UserLeadGenInfoNode.py b/examples/UserLeadGenInfoNode.py deleted file mode 100644 index 8b8454b5..00000000 --- a/examples/UserLeadGenInfoNode.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.lead import Lead -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print Lead(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/UserNode.py b/examples/UserNode.py deleted file mode 100644 index 110356de..00000000 --- a/examples/UserNode.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.user import User -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print User(id).get( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/examples/VideoThumbnailsEdge.py b/examples/VideoThumbnailsEdge.py deleted file mode 100644 index 5e797b7f..00000000 --- a/examples/VideoThumbnailsEdge.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# You are hereby granted a non-exclusive, worldwide, royalty-free license to -# use, copy, modify, and distribute this software in source code or binary -# form for use in connection with the web services and APIs provided by -# Facebook. - -# As with any software that integrates with the Facebook platform, your use -# of this software is subject to the Facebook Developer Principles and -# Policies [http://developers.facebook.com/policy/]. This copyright notice -# shall be included in all copies or substantial portions of the software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from facebook_business.adobjects.advideo import AdVideo -from facebook_business.adobjects.videothumbnail import VideoThumbnail -from facebook_business.api import FacebookAdsApi - -access_token = '' -app_secret = '' -app_id = '' -id = '' -FacebookAdsApi.init(access_token=access_token) - -fields = [ -] -params = { -} -print AdVideo(id).get_thumbnails( - fields=fields, - params=params, -) \ No newline at end of file diff --git a/facebook_business/__init__.py b/facebook_business/__init__.py index b952f769..d5f58cfa 100644 --- a/facebook_business/__init__.py +++ b/facebook_business/__init__.py @@ -7,5 +7,5 @@ from facebook_business.session import FacebookSession from facebook_business.api import FacebookAdsApi -__version__ = '20.0.3' +__version__ = '21.0.0' __all__ = ['session', 'api'] diff --git a/facebook_business/adobjects/ad.py b/facebook_business/adobjects/ad.py index b3195a8a..ad258c60 100644 --- a/facebook_business/adobjects/ad.py +++ b/facebook_business/adobjects/ad.py @@ -57,6 +57,7 @@ class Field(AbstractObject.Field): issues_info = 'issues_info' last_updated_by_app_id = 'last_updated_by_app_id' name = 'name' + placement = 'placement' preview_shareable_link = 'preview_shareable_link' priority = 'priority' recommendations = 'recommendations' @@ -722,6 +723,7 @@ def get_targeting_sentence_lines(self, fields=None, params=None, batch=None, suc 'issues_info': 'list', 'last_updated_by_app_id': 'string', 'name': 'string', + 'placement': 'Placement', 'preview_shareable_link': 'string', 'priority': 'unsigned int', 'recommendations': 'list', diff --git a/facebook_business/adobjects/adaccount.py b/facebook_business/adobjects/adaccount.py index 1532c975..893518c7 100644 --- a/facebook_business/adobjects/adaccount.py +++ b/facebook_business/adobjects/adaccount.py @@ -225,6 +225,7 @@ class Subtype: lookalike = 'LOOKALIKE' managed = 'MANAGED' measurement = 'MEASUREMENT' + messenger_subscriber_list = 'MESSENGER_SUBSCRIBER_LIST' offline_conversion = 'OFFLINE_CONVERSION' partner = 'PARTNER' primary = 'PRIMARY' @@ -1420,6 +1421,8 @@ def create_ad_set(self, fields=None, params=None, batch=None, success=None, fail 'lifetime_min_spend_target': 'unsigned int', 'lifetime_spend_cap': 'unsigned int', 'line_number': 'unsigned int', + 'max_budget_spend_percentage': 'unsigned int', + 'min_budget_spend_percentage': 'unsigned int', 'multi_optimization_goal_weight': 'multi_optimization_goal_weight_enum', 'name': 'string', 'optimization_goal': 'optimization_goal_enum', @@ -1709,11 +1712,10 @@ def create_ad_video(self, fields=None, params=None, batch=None, success=None, fa 'formatting': 'formatting_enum', 'fov': 'unsigned int', 'front_z_rotation': 'float', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'guide': 'list>', 'guide_enabled': 'bool', - 'holiday_card': 'string', 'initial_heading': 'unsigned int', 'initial_pitch': 'unsigned int', 'instant_game_entry_point_data': 'string', @@ -1722,7 +1724,6 @@ def create_ad_video(self, fields=None, params=None, batch=None, success=None, fa 'is_voice_clip': 'bool', 'location_source_id': 'string', 'name': 'string', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_icon_id': 'string', 'og_object_id': 'string', @@ -2683,11 +2684,13 @@ def create_custom_audience(self, fields=None, params=None, batch=None, success=N 'event_source_group': 'string', 'event_sources': 'list', 'exclusions': 'list', + 'facebook_page_id': 'string', 'inclusions': 'list', 'is_snapshot': 'bool', 'is_value_based': 'bool', 'list_of_accounts': 'list', 'lookalike_spec': 'string', + 'marketing_message_channels': 'Object', 'name': 'string', 'opt_out_link': 'string', 'origin_audience_id': 'string', @@ -2701,7 +2704,9 @@ def create_custom_audience(self, fields=None, params=None, batch=None, success=N 'rev_share_policy_id': 'unsigned int', 'rule': 'string', 'rule_aggregation': 'string', + 'subscription_info': 'list', 'subtype': 'subtype_enum', + 'use_for_products': 'list', 'use_in_campaigns': 'bool', 'video_group_ids': 'list', 'whats_app_business_phone_number_id': 'string', @@ -2710,7 +2715,9 @@ def create_custom_audience(self, fields=None, params=None, batch=None, success=N 'claim_objective_enum': CustomAudience.ClaimObjective.__dict__.values(), 'content_type_enum': CustomAudience.ContentType.__dict__.values(), 'customer_file_source_enum': CustomAudience.CustomerFileSource.__dict__.values(), + 'subscription_info_enum': CustomAudience.SubscriptionInfo.__dict__.values(), 'subtype_enum': CustomAudience.Subtype.__dict__.values(), + 'use_for_products_enum': CustomAudience.UseForProducts.__dict__.values(), } request = FacebookRequest( node_id=self['id'], @@ -4258,7 +4265,38 @@ def delete_users_of_any_audience(self, fields=None, params=None, batch=None, suc self.assure_call() return request.execute() - def get_value_adjustment_rule_collections(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + def get_value_adjustment_rules(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + from facebook_business.adobjects.adsvalueadjustmentrule import AdsValueAdjustmentRule + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/value_adjustment_rules', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdsValueAdjustmentRule, + api_type='EDGE', + response_parser=ObjectParser(target_class=AdsValueAdjustmentRule, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def get_value_rule_set(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') @@ -4270,7 +4308,7 @@ def get_value_adjustment_rule_collections(self, fields=None, params=None, batch= request = FacebookRequest( node_id=self['id'], method='GET', - endpoint='/value_adjustment_rule_collections', + endpoint='/value_rule_set', api=self._api, param_checker=TypeChecker(param_types, enums), target_class=AdsValueAdjustmentRuleCollection, @@ -4289,24 +4327,26 @@ def get_value_adjustment_rule_collections(self, fields=None, params=None, batch= self.assure_call() return request.execute() - def get_value_adjustment_rules(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + def get_video_ads(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') - from facebook_business.adobjects.adsvalueadjustmentrule import AdsValueAdjustmentRule + from facebook_business.adobjects.advideo import AdVideo param_types = { + 'since': 'datetime', + 'until': 'datetime', } enums = { } request = FacebookRequest( node_id=self['id'], method='GET', - endpoint='/value_adjustment_rules', + endpoint='/video_ads', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AdsValueAdjustmentRule, + target_class=AdVideo, api_type='EDGE', - response_parser=ObjectParser(target_class=AdsValueAdjustmentRule, api=self._api), + response_parser=ObjectParser(target_class=AdVideo, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/adaccountadruleshistory.py b/facebook_business/adobjects/adaccountadruleshistory.py index e47b57be..1a22e913 100644 --- a/facebook_business/adobjects/adaccountadruleshistory.py +++ b/facebook_business/adobjects/adaccountadruleshistory.py @@ -38,13 +38,17 @@ class Action: budget_not_redistributed = 'BUDGET_NOT_REDISTRIBUTED' changed_bid = 'CHANGED_BID' changed_budget = 'CHANGED_BUDGET' + consolidate_asc_fragmentation = 'CONSOLIDATE_ASC_FRAGMENTATION' + convert_asc_cp_single_instance = 'CONVERT_ASC_CP_SINGLE_INSTANCE' email = 'EMAIL' enable_advantage_campaign_budget = 'ENABLE_ADVANTAGE_CAMPAIGN_BUDGET' enable_advantage_plus_creative = 'ENABLE_ADVANTAGE_PLUS_CREATIVE' enable_advantage_plus_placements = 'ENABLE_ADVANTAGE_PLUS_PLACEMENTS' enable_autoflow = 'ENABLE_AUTOFLOW' enable_gen_uncrop = 'ENABLE_GEN_UNCROP' + enable_landing_page_views = 'ENABLE_LANDING_PAGE_VIEWS' enable_music = 'ENABLE_MUSIC' + enable_reels_placements = 'ENABLE_REELS_PLACEMENTS' enable_semantic_based_audience_expansion = 'ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION' enable_shops_ads = 'ENABLE_SHOPS_ADS' endpoint_pinged = 'ENDPOINT_PINGED' diff --git a/facebook_business/adobjects/adaccountadvolume.py b/facebook_business/adobjects/adaccountadvolume.py index d316b62a..833c2304 100644 --- a/facebook_business/adobjects/adaccountadvolume.py +++ b/facebook_business/adobjects/adaccountadvolume.py @@ -54,6 +54,7 @@ class RecommendationType: advantage_detailed_targeting = 'ADVANTAGE_DETAILED_TARGETING' advantage_lookalike_audience = 'ADVANTAGE_LOOKALIKE_AUDIENCE' advantage_lookalike_duplication = 'ADVANTAGE_LOOKALIKE_DUPLICATION' + advantage_plus_app_campaign = 'ADVANTAGE_PLUS_APP_CAMPAIGN' advantage_plus_app_campaign_precreate = 'ADVANTAGE_PLUS_APP_CAMPAIGN_PRECREATE' advantage_plus_audience = 'ADVANTAGE_PLUS_AUDIENCE' advantage_plus_audience_duplication = 'ADVANTAGE_PLUS_AUDIENCE_DUPLICATION' @@ -66,8 +67,10 @@ class RecommendationType: advantage_plus_creative_se = 'ADVANTAGE_PLUS_CREATIVE_SE' advantage_plus_placements_duplication = 'ADVANTAGE_PLUS_PLACEMENTS_DUPLICATION' advantage_plus_placements_friction = 'ADVANTAGE_PLUS_PLACEMENTS_FRICTION' + advantage_plus_placements_v2_duplication = 'ADVANTAGE_PLUS_PLACEMENTS_V2_DUPLICATION' advantage_shopping_campaign = 'ADVANTAGE_SHOPPING_CAMPAIGN' advantage_shopping_campaign_fragmentation = 'ADVANTAGE_SHOPPING_CAMPAIGN_FRAGMENTATION' + ad_lift_recall_goal = 'AD_LIFT_RECALL_GOAL' ad_lift_recall_goal_precreate = 'AD_LIFT_RECALL_GOAL_PRECREATE' ad_lift_recall_optimization_goal = 'AD_LIFT_RECALL_OPTIMIZATION_GOAL' ad_objective = 'AD_OBJECTIVE' @@ -88,6 +91,7 @@ class RecommendationType: auction_overlap_consolidation = 'AUCTION_OVERLAP_CONSOLIDATION' audience_expansion = 'AUDIENCE_EXPANSION' audience_expansion_georadius = 'AUDIENCE_EXPANSION_GEORADIUS' + audience_expansion_lookalike = 'AUDIENCE_EXPANSION_LOOKALIKE' audience_expansion_retargeting = 'AUDIENCE_EXPANSION_RETARGETING' audience_learning_limited = 'AUDIENCE_LEARNING_LIMITED' autoflow_opt_in = 'AUTOFLOW_OPT_IN' @@ -99,6 +103,7 @@ class RecommendationType: background_generation = 'BACKGROUND_GENERATION' blended_ads = 'BLENDED_ADS' blended_ads_duplication = 'BLENDED_ADS_DUPLICATION' + blended_ads_for_shops_ads_duplication = 'BLENDED_ADS_FOR_SHOPS_ADS_DUPLICATION' broad_targeting = 'BROAD_TARGETING' budget_limited = 'BUDGET_LIMITED' capi = 'CAPI' @@ -134,6 +139,7 @@ class RecommendationType: ctx_budget_optimization = 'CTX_BUDGET_OPTIMIZATION' ctx_creation_package = 'CTX_CREATION_PACKAGE' ctx_cta_upgrade_in_duplication = 'CTX_CTA_UPGRADE_IN_DUPLICATION' + ctx_ctmpo_upgrade = 'CTX_CTMPO_UPGRADE' ctx_guidance = 'CTX_GUIDANCE' ctx_precreate = 'CTX_PRECREATE' da_advantage_plus_creative_info_labels = 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS' @@ -145,6 +151,7 @@ class RecommendationType: delivery_warning = 'DELIVERY_WARNING' dynamic_advantage_campaign_budget = 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET' ecosystem_bid_reduce_l1_cardinality = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY' + engaged_view_conversions_creation = 'ENGAGED_VIEW_CONVERSIONS_CREATION' evc_app_duplication_upgrade = 'EVC_APP_DUPLICATION_UPGRADE' evc_web_duplication_upgrade = 'EVC_WEB_DUPLICATION_UPGRADE' fragmentation = 'FRAGMENTATION' @@ -157,34 +164,44 @@ class RecommendationType: high_cost = 'HIGH_COST' historical_benchmark = 'HISTORICAL_BENCHMARK' ig_multi_ads = 'IG_MULTI_ADS' + landing_page_view = 'LANDING_PAGE_VIEW' landing_page_view_optimization_goal = 'LANDING_PAGE_VIEW_OPTIMIZATION_GOAL' landing_page_view_precreate = 'LANDING_PAGE_VIEW_PRECREATE' lead_ads_guidance = 'LEAD_ADS_GUIDANCE' learning_limited = 'LEARNING_LIMITED' learning_pause_friction = 'LEARNING_PAUSE_FRICTION' learning_phase_budget_edits = 'LEARNING_PHASE_BUDGET_EDITS' + low_budget_utilization = 'LOW_BUDGET_UTILIZATION' low_outcome = 'LOW_OUTCOME' merlin_guidance = 'MERLIN_GUIDANCE' + messaging_events = 'MESSAGING_EVENTS' messaging_events_precreate = 'MESSAGING_EVENTS_PRECREATE' + messaging_partners = 'MESSAGING_PARTNERS' messaging_partners_precreate = 'MESSAGING_PARTNERS_PRECREATE' meta_verified_ads_performance_guidance = 'META_VERIFIED_ADS_PERFORMANCE_GUIDANCE' + missing_or_invalid_parameters = 'MISSING_OR_INVALID_PARAMETERS' mixed_formats = 'MIXED_FORMATS' mixed_pa_combine_adsets = 'MIXED_PA_COMBINE_ADSETS' mmt_carousel_to_video = 'MMT_CAROUSEL_TO_VIDEO' mobile_first_creative = 'MOBILE_FIRST_CREATIVE' mobile_first_video = 'MOBILE_FIRST_VIDEO' mr_aemv2sub_kconsolidation = 'MR_AEMV2SUB_KCONSOLIDATION' + multi_advertiser_ads = 'MULTI_ADVERTISER_ADS' multi_text = 'MULTI_TEXT' music = 'MUSIC' not_applicable = 'NOT_APPLICABLE' no_delivery_status = 'NO_DELIVERY_STATUS' offsite_conversion = 'OFFSITE_CONVERSION' optimal_bau = 'OPTIMAL_BAU' + outcome_forecaster_shadow_logging = 'OUTCOME_FORECASTER_SHADOW_LOGGING' payment_method = 'PAYMENT_METHOD' performant_creative_reels_opt_in = 'PERFORMANT_CREATIVE_REELS_OPT_IN' pfr_l1_inline_mmt = 'PFR_L1_INLINE_MMT' + pixel_optimization_aam = 'PIXEL_OPTIMIZATION_AAM' pixel_optimization_aam_precreate = 'PIXEL_OPTIMIZATION_AAM_PRECREATE' + pixel_optimization_hie = 'PIXEL_OPTIMIZATION_HIE' pixel_optimization_hie_precreate = 'PIXEL_OPTIMIZATION_HIE_PRECREATE' + pixel_setup = 'PIXEL_SETUP' pixel_setup_precreate = 'PIXEL_SETUP_PRECREATE' pixel_upsell = 'PIXEL_UPSELL' placements_liquidity_automatic_guidance = 'PLACEMENTS_LIQUIDITY_AUTOMATIC_GUIDANCE' @@ -206,12 +223,14 @@ class RecommendationType: sales_conversion = 'SALES_CONVERSION' scale_good_campaign = 'SCALE_GOOD_CAMPAIGN' scale_good_campaign_duplication = 'SCALE_GOOD_CAMPAIGN_DUPLICATION' + scale_good_campaign_smb = 'SCALE_GOOD_CAMPAIGN_SMB' scale_good_ctx_campaign = 'SCALE_GOOD_CTX_CAMPAIGN' semantic_based_audience_duplication = 'SEMANTIC_BASED_AUDIENCE_DUPLICATION' semantic_based_audience_expansion = 'SEMANTIC_BASED_AUDIENCE_EXPANSION' setup_pixel = 'SETUP_PIXEL' shops_ads = 'SHOPS_ADS' shops_ads_duplication = 'SHOPS_ADS_DUPLICATION' + shops_ads_traffic_cap_settings = 'SHOPS_ADS_TRAFFIC_CAP_SETTINGS' shop_ads_v2 = 'SHOP_ADS_V2' signals_growth_capi = 'SIGNALS_GROWTH_CAPI' signals_growth_capi_precreate = 'SIGNALS_GROWTH_CAPI_PRECREATE' @@ -235,9 +254,11 @@ class RecommendationType: uneconomical_ads_throttling = 'UNECONOMICAL_ADS_THROTTLING' unified_inbox = 'UNIFIED_INBOX' unused_budget = 'UNUSED_BUDGET' + value_diagnostics_guidance = 'VALUE_DIAGNOSTICS_GUIDANCE' video_length = 'VIDEO_LENGTH' video_views_upsell = 'VIDEO_VIEWS_UPSELL' video_views_upsell_precreate = 'VIDEO_VIEWS_UPSELL_PRECREATE' + wa_messaging_partners = 'WA_MESSAGING_PARTNERS' wa_messaging_partners_precreate = 'WA_MESSAGING_PARTNERS_PRECREATE' web_engaged_view_conversions = 'WEB_ENGAGED_VIEW_CONVERSIONS' zero_conversion = 'ZERO_CONVERSION' diff --git a/facebook_business/adobjects/externaleventsourcedastatsresult.py b/facebook_business/adobjects/adaccountlivevideoadvertiser.py similarity index 50% rename from facebook_business/adobjects/externaleventsourcedastatsresult.py rename to facebook_business/adobjects/adaccountlivevideoadvertiser.py index 2b8b71b2..965fccfb 100644 --- a/facebook_business/adobjects/externaleventsourcedastatsresult.py +++ b/facebook_business/adobjects/adaccountlivevideoadvertiser.py @@ -14,30 +14,24 @@ pull request for this class. """ -class ExternalEventSourceDAStatsResult( +class AdAccountLiveVideoAdvertiser( AbstractObject, ): def __init__(self, api=None): - super(ExternalEventSourceDAStatsResult, self).__init__() - self._isExternalEventSourceDAStatsResult = True + super(AdAccountLiveVideoAdvertiser, self).__init__() + self._isAdAccountLiveVideoAdvertiser = True self._api = api class Field(AbstractObject.Field): - count_content_ids = 'count_content_ids' - count_content_ids_match_any_catalog = 'count_content_ids_match_any_catalog' - count_fires = 'count_fires' - count_fires_match_any_catalog = 'count_fires_match_any_catalog' - date = 'date' - percentage_missed_users = 'percentage_missed_users' + is_lva_toggle_on = 'is_lva_toggle_on' + lva_default_budget = 'lva_default_budget' + should_show_lva_toggle = 'should_show_lva_toggle' _field_types = { - 'count_content_ids': 'unsigned int', - 'count_content_ids_match_any_catalog': 'unsigned int', - 'count_fires': 'unsigned int', - 'count_fires_match_any_catalog': 'unsigned int', - 'date': 'string', - 'percentage_missed_users': 'float', + 'is_lva_toggle_on': 'bool', + 'lva_default_budget': 'int', + 'should_show_lva_toggle': 'bool', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/adaccounttargetingunified.py b/facebook_business/adobjects/adaccounttargetingunified.py index ef18b4bf..6f86458c 100644 --- a/facebook_business/adobjects/adaccounttargetingunified.py +++ b/facebook_business/adobjects/adaccounttargetingunified.py @@ -82,6 +82,7 @@ class LimitType: class RegulatedCategories: credit = 'CREDIT' employment = 'EMPLOYMENT' + financial_products_services = 'FINANCIAL_PRODUCTS_SERVICES' housing = 'HOUSING' issues_elections_politics = 'ISSUES_ELECTIONS_POLITICS' none = 'NONE' diff --git a/facebook_business/adobjects/adactivity.py b/facebook_business/adobjects/adactivity.py index 43229500..b6160eb4 100644 --- a/facebook_business/adobjects/adactivity.py +++ b/facebook_business/adobjects/adactivity.py @@ -50,10 +50,12 @@ class EventType: ad_account_remove_user_from_role = 'ad_account_remove_user_from_role' ad_account_reset_spend_limit = 'ad_account_reset_spend_limit' ad_account_set_business_information = 'ad_account_set_business_information' + ad_account_update_audience_type_url_parameter = 'ad_account_update_audience_type_url_parameter' ad_account_update_spend_limit = 'ad_account_update_spend_limit' ad_account_update_status = 'ad_account_update_status' ad_review_approved = 'ad_review_approved' ad_review_declined = 'ad_review_declined' + adaccount_update_audience_segment = 'adaccount_update_audience_segment' add_funding_source = 'add_funding_source' add_images = 'add_images' billing_event = 'billing_event' @@ -109,6 +111,7 @@ class EventType: update_campaign_budget_optimization_toggling_status = 'update_campaign_budget_optimization_toggling_status' update_campaign_budget_scheduling_state = 'update_campaign_budget_scheduling_state' update_campaign_conversion_goal = 'update_campaign_conversion_goal' + update_campaign_delivery_destination = 'update_campaign_delivery_destination' update_campaign_delivery_type = 'update_campaign_delivery_type' update_campaign_group_ad_scheduling = 'update_campaign_group_ad_scheduling' update_campaign_group_budget_scheduling_state = 'update_campaign_group_budget_scheduling_state' diff --git a/facebook_business/adobjects/adcreative.py b/facebook_business/adobjects/adcreative.py index 12db2826..adc00a27 100644 --- a/facebook_business/adobjects/adcreative.py +++ b/facebook_business/adobjects/adcreative.py @@ -70,6 +70,7 @@ class Field(AbstractObject.Field): link_destination_display_url = 'link_destination_display_url' link_og_id = 'link_og_id' link_url = 'link_url' + messenger_sponsored_message = 'messenger_sponsored_message' name = 'name' object_id = 'object_id' object_store_url = 'object_store_url' @@ -502,6 +503,7 @@ def get_previews(self, fields=None, params=None, batch=None, success=None, failu 'link_destination_display_url': 'string', 'link_og_id': 'string', 'link_url': 'string', + 'messenger_sponsored_message': 'string', 'name': 'string', 'object_id': 'string', 'object_store_url': 'string', diff --git a/facebook_business/adobjects/adcreativebrandedcontentads.py b/facebook_business/adobjects/adcreativebrandedcontentads.py index 1ff57982..589b2644 100644 --- a/facebook_business/adobjects/adcreativebrandedcontentads.py +++ b/facebook_business/adobjects/adcreativebrandedcontentads.py @@ -30,6 +30,8 @@ class Field(AbstractObject.Field): facebook_boost_post_access_token = 'facebook_boost_post_access_token' instagram_boost_post_access_token = 'instagram_boost_post_access_token' is_mca_internal = 'is_mca_internal' + parent_source_facebook_post_id = 'parent_source_facebook_post_id' + parent_source_instagram_media_id = 'parent_source_instagram_media_id' partners = 'partners' product_set_partner_selection_status = 'product_set_partner_selection_status' promoted_page_id = 'promoted_page_id' @@ -43,6 +45,8 @@ class Field(AbstractObject.Field): 'facebook_boost_post_access_token': 'string', 'instagram_boost_post_access_token': 'string', 'is_mca_internal': 'bool', + 'parent_source_facebook_post_id': 'string', + 'parent_source_instagram_media_id': 'string', 'partners': 'list', 'product_set_partner_selection_status': 'string', 'promoted_page_id': 'string', diff --git a/facebook_business/adobjects/adcreativebrandedcontentadspartners.py b/facebook_business/adobjects/adcreativebrandedcontentadspartners.py index d0b7d2cb..19ce714f 100644 --- a/facebook_business/adobjects/adcreativebrandedcontentadspartners.py +++ b/facebook_business/adobjects/adcreativebrandedcontentadspartners.py @@ -25,12 +25,14 @@ def __init__(self, api=None): class Field(AbstractObject.Field): fb_page_id = 'fb_page_id' + has_create_ads_access = 'has_create_ads_access' identity_type = 'identity_type' ig_asset_id = 'ig_asset_id' ig_user_id = 'ig_user_id' _field_types = { 'fb_page_id': 'string', + 'has_create_ads_access': 'bool', 'identity_type': 'string', 'ig_asset_id': 'string', 'ig_user_id': 'string', diff --git a/facebook_business/adobjects/adcreativefeaturesspec.py b/facebook_business/adobjects/adcreativefeaturesspec.py index 41b78f17..5cbe2d91 100644 --- a/facebook_business/adobjects/adcreativefeaturesspec.py +++ b/facebook_business/adobjects/adcreativefeaturesspec.py @@ -36,9 +36,17 @@ class Field(AbstractObject.Field): cv_transformation = 'cv_transformation' description_automation = 'description_automation' dha_optimization = 'dha_optimization' + dynamic_partner_content = 'dynamic_partner_content' enhance_cta = 'enhance_cta' + fb_feed_tag = 'fb_feed_tag' + fb_reels_tag = 'fb_reels_tag' + fb_story_tag = 'fb_story_tag' feed_caption_optimization = 'feed_caption_optimization' + ig_feed_tag = 'ig_feed_tag' ig_glados_feed = 'ig_glados_feed' + ig_reels_tag = 'ig_reels_tag' + ig_stream_tag = 'ig_stream_tag' + image_animation = 'image_animation' image_auto_crop = 'image_auto_crop' image_background_gen = 'image_background_gen' image_brightness_and_contrast = 'image_brightness_and_contrast' @@ -51,6 +59,7 @@ class Field(AbstractObject.Field): media_liquidity_animated_image = 'media_liquidity_animated_image' media_order = 'media_order' media_type_automation = 'media_type_automation' + pac_relaxation = 'pac_relaxation' product_extensions = 'product_extensions' product_metadata_automation = 'product_metadata_automation' product_tags = 'product_tags' @@ -63,6 +72,7 @@ class Field(AbstractObject.Field): video_auto_crop = 'video_auto_crop' video_filtering = 'video_filtering' video_highlight = 'video_highlight' + video_uncrop = 'video_uncrop' _field_types = { 'adapt_to_placement': 'AdCreativeFeatureDetails', @@ -77,9 +87,17 @@ class Field(AbstractObject.Field): 'cv_transformation': 'AdCreativeFeatureDetails', 'description_automation': 'AdCreativeFeatureDetails', 'dha_optimization': 'AdCreativeFeatureDetails', + 'dynamic_partner_content': 'AdCreativeFeatureDetails', 'enhance_cta': 'AdCreativeFeatureDetails', + 'fb_feed_tag': 'AdCreativeFeatureDetails', + 'fb_reels_tag': 'AdCreativeFeatureDetails', + 'fb_story_tag': 'AdCreativeFeatureDetails', 'feed_caption_optimization': 'AdCreativeFeatureDetails', + 'ig_feed_tag': 'AdCreativeFeatureDetails', 'ig_glados_feed': 'AdCreativeFeatureDetails', + 'ig_reels_tag': 'AdCreativeFeatureDetails', + 'ig_stream_tag': 'AdCreativeFeatureDetails', + 'image_animation': 'AdCreativeFeatureDetails', 'image_auto_crop': 'AdCreativeFeatureDetails', 'image_background_gen': 'AdCreativeFeatureDetails', 'image_brightness_and_contrast': 'AdCreativeFeatureDetails', @@ -92,6 +110,7 @@ class Field(AbstractObject.Field): 'media_liquidity_animated_image': 'AdCreativeFeatureDetails', 'media_order': 'AdCreativeFeatureDetails', 'media_type_automation': 'AdCreativeFeatureDetails', + 'pac_relaxation': 'AdCreativeFeatureDetails', 'product_extensions': 'AdCreativeFeatureDetails', 'product_metadata_automation': 'AdCreativeFeatureDetails', 'product_tags': 'AdCreativeFeatureDetails', @@ -104,6 +123,7 @@ class Field(AbstractObject.Field): 'video_auto_crop': 'AdCreativeFeatureDetails', 'video_filtering': 'AdCreativeFeatureDetails', 'video_highlight': 'AdCreativeFeatureDetails', + 'video_uncrop': 'AdCreativeFeatureDetails', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/adcreativeobjectstoryspec.py b/facebook_business/adobjects/adcreativeobjectstoryspec.py index 13e9ecb5..84c91458 100644 --- a/facebook_business/adobjects/adcreativeobjectstoryspec.py +++ b/facebook_business/adobjects/adcreativeobjectstoryspec.py @@ -28,9 +28,10 @@ class Field(AbstractObject.Field): link_data = 'link_data' page_id = 'page_id' photo_data = 'photo_data' + product_data = 'product_data' template_data = 'template_data' text_data = 'text_data' - threads_actor_id = 'threads_actor_id' + threads_user_id = 'threads_user_id' video_data = 'video_data' _field_types = { @@ -38,9 +39,10 @@ class Field(AbstractObject.Field): 'link_data': 'AdCreativeLinkData', 'page_id': 'string', 'photo_data': 'AdCreativePhotoData', + 'product_data': 'list', 'template_data': 'AdCreativeLinkData', 'text_data': 'AdCreativeTextData', - 'threads_actor_id': 'string', + 'threads_user_id': 'string', 'video_data': 'AdCreativeVideoData', } @classmethod diff --git a/facebook_business/adobjects/adcreativeproductdata.py b/facebook_business/adobjects/adcreativeproductdata.py new file mode 100644 index 00000000..9ff240e4 --- /dev/null +++ b/facebook_business/adobjects/adcreativeproductdata.py @@ -0,0 +1,39 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +from facebook_business.adobjects.abstractobject import AbstractObject + +""" +This class is auto-generated. + +For any issues or feature requests related to this class, please let us know on +github and we'll fix in our codegen framework. We'll not be able to accept +pull request for this class. +""" + +class AdCreativeProductData( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativeProductData, self).__init__() + self._isAdCreativeProductData = True + self._api = api + + class Field(AbstractObject.Field): + product_id = 'product_id' + product_source = 'product_source' + + _field_types = { + 'product_id': 'string', + 'product_source': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/adpreview.py b/facebook_business/adobjects/adpreview.py index db75ff72..72e27446 100644 --- a/facebook_business/adobjects/adpreview.py +++ b/facebook_business/adobjects/adpreview.py @@ -70,6 +70,7 @@ class AdFormat: instream_banner_immersive_mobile = 'INSTREAM_BANNER_IMMERSIVE_MOBILE' instream_banner_mobile = 'INSTREAM_BANNER_MOBILE' instream_video_desktop = 'INSTREAM_VIDEO_DESKTOP' + instream_video_fullscreen_ios = 'INSTREAM_VIDEO_FULLSCREEN_IOS' instream_video_fullscreen_mobile = 'INSTREAM_VIDEO_FULLSCREEN_MOBILE' instream_video_image = 'INSTREAM_VIDEO_IMAGE' instream_video_immersive_mobile = 'INSTREAM_VIDEO_IMMERSIVE_MOBILE' diff --git a/facebook_business/adobjects/adpromotedobject.py b/facebook_business/adobjects/adpromotedobject.py index a8211d38..8d0fd4f7 100644 --- a/facebook_business/adobjects/adpromotedobject.py +++ b/facebook_business/adobjects/adpromotedobject.py @@ -32,6 +32,7 @@ class Field(AbstractObject.Field): custom_event_type = 'custom_event_type' event_id = 'event_id' fundraiser_campaign_id = 'fundraiser_campaign_id' + lead_ads_form_event_source_type = 'lead_ads_form_event_source_type' mcme_conversion_id = 'mcme_conversion_id' object_store_url = 'object_store_url' offer_id = 'offer_id' @@ -49,6 +50,8 @@ class Field(AbstractObject.Field): product_set = 'product_set' product_set_id = 'product_set_id' retention_days = 'retention_days' + value_semantic_type = 'value_semantic_type' + variation = 'variation' whatsapp_phone_number = 'whatsapp_phone_number' class CustomEventType: @@ -91,6 +94,7 @@ class CustomEventType: 'custom_event_type': 'CustomEventType', 'event_id': 'string', 'fundraiser_campaign_id': 'string', + 'lead_ads_form_event_source_type': 'string', 'mcme_conversion_id': 'string', 'object_store_url': 'string', 'offer_id': 'string', @@ -108,6 +112,8 @@ class CustomEventType: 'product_set': 'ProductSet', 'product_set_id': 'string', 'retention_days': 'string', + 'value_semantic_type': 'string', + 'variation': 'string', 'whatsapp_phone_number': 'string', } @classmethod diff --git a/facebook_business/adobjects/adrule.py b/facebook_business/adobjects/adrule.py index daf180c6..dfcb69db 100644 --- a/facebook_business/adobjects/adrule.py +++ b/facebook_business/adobjects/adrule.py @@ -30,6 +30,7 @@ class Field(AbstractObject.Field): account_id = 'account_id' created_by = 'created_by' created_time = 'created_time' + disable_error_code = 'disable_error_code' evaluation_spec = 'evaluation_spec' execution_spec = 'execution_spec' id = 'id' @@ -281,6 +282,7 @@ def create_preview(self, fields=None, params=None, batch=None, success=None, fai 'account_id': 'string', 'created_by': 'User', 'created_time': 'datetime', + 'disable_error_code': 'int', 'evaluation_spec': 'AdRuleEvaluationSpec', 'execution_spec': 'AdRuleExecutionSpec', 'id': 'string', diff --git a/facebook_business/adobjects/adrulehistory.py b/facebook_business/adobjects/adrulehistory.py index c780e327..7e2c9a3b 100644 --- a/facebook_business/adobjects/adrulehistory.py +++ b/facebook_business/adobjects/adrulehistory.py @@ -37,13 +37,17 @@ class Action: budget_not_redistributed = 'BUDGET_NOT_REDISTRIBUTED' changed_bid = 'CHANGED_BID' changed_budget = 'CHANGED_BUDGET' + consolidate_asc_fragmentation = 'CONSOLIDATE_ASC_FRAGMENTATION' + convert_asc_cp_single_instance = 'CONVERT_ASC_CP_SINGLE_INSTANCE' email = 'EMAIL' enable_advantage_campaign_budget = 'ENABLE_ADVANTAGE_CAMPAIGN_BUDGET' enable_advantage_plus_creative = 'ENABLE_ADVANTAGE_PLUS_CREATIVE' enable_advantage_plus_placements = 'ENABLE_ADVANTAGE_PLUS_PLACEMENTS' enable_autoflow = 'ENABLE_AUTOFLOW' enable_gen_uncrop = 'ENABLE_GEN_UNCROP' + enable_landing_page_views = 'ENABLE_LANDING_PAGE_VIEWS' enable_music = 'ENABLE_MUSIC' + enable_reels_placements = 'ENABLE_REELS_PLACEMENTS' enable_semantic_based_audience_expansion = 'ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION' enable_shops_ads = 'ENABLE_SHOPS_ADS' endpoint_pinged = 'ENDPOINT_PINGED' diff --git a/facebook_business/adobjects/adset.py b/facebook_business/adobjects/adset.py index 2a279a44..f44fd381 100644 --- a/facebook_business/adobjects/adset.py +++ b/facebook_business/adobjects/adset.py @@ -72,6 +72,8 @@ class Field(AbstractObject.Field): lifetime_imps = 'lifetime_imps' lifetime_min_spend_target = 'lifetime_min_spend_target' lifetime_spend_cap = 'lifetime_spend_cap' + max_budget_spend_percentage = 'max_budget_spend_percentage' + min_budget_spend_percentage = 'min_budget_spend_percentage' multi_optimization_goal_weight = 'multi_optimization_goal_weight' name = 'name' optimization_goal = 'optimization_goal' @@ -249,10 +251,12 @@ class OptimizationSubEvent: class RegionalRegulatedCategories: value_0 = '0' value_1 = '1' + value_2 = '2' class TuneForCategory: credit = 'CREDIT' employment = 'EMPLOYMENT' + financial_products_services = 'FINANCIAL_PRODUCTS_SERVICES' housing = 'HOUSING' issues_elections_politics = 'ISSUES_ELECTIONS_POLITICS' none = 'NONE' @@ -396,6 +400,8 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure 'lifetime_imps': 'unsigned int', 'lifetime_min_spend_target': 'unsigned int', 'lifetime_spend_cap': 'unsigned int', + 'max_budget_spend_percentage': 'unsigned int', + 'min_budget_spend_percentage': 'unsigned int', 'multi_optimization_goal_weight': 'multi_optimization_goal_weight_enum', 'name': 'string', 'optimization_goal': 'optimization_goal_enum', @@ -1103,6 +1109,8 @@ def get_targeting_sentence_lines(self, fields=None, params=None, batch=None, suc 'lifetime_imps': 'int', 'lifetime_min_spend_target': 'string', 'lifetime_spend_cap': 'string', + 'max_budget_spend_percentage': 'string', + 'min_budget_spend_percentage': 'string', 'multi_optimization_goal_weight': 'string', 'name': 'string', 'optimization_goal': 'OptimizationGoal', diff --git a/facebook_business/adobjects/adsinsights.py b/facebook_business/adobjects/adsinsights.py index ccfaef6f..8b7048b3 100644 --- a/facebook_business/adobjects/adsinsights.py +++ b/facebook_business/adobjects/adsinsights.py @@ -44,6 +44,7 @@ class Field(AbstractObject.Field): auction_bid = 'auction_bid' auction_competitiveness = 'auction_competitiveness' auction_max_competitor_bid = 'auction_max_competitor_bid' + average_purchases_conversion_value = 'average_purchases_conversion_value' buying_type = 'buying_type' campaign_id = 'campaign_id' campaign_name = 'campaign_name' @@ -108,9 +109,6 @@ class Field(AbstractObject.Field): instant_experience_outbound_clicks = 'instant_experience_outbound_clicks' interactive_component_tap = 'interactive_component_tap' labels = 'labels' - landing_page_view_actions_per_link_click = 'landing_page_view_actions_per_link_click' - landing_page_view_per_purchase_rate = 'landing_page_view_per_purchase_rate' - link_clicks_per_results = 'link_clicks_per_results' location = 'location' marketing_messages_cost_per_delivered = 'marketing_messages_cost_per_delivered' marketing_messages_cost_per_link_btn_click = 'marketing_messages_cost_per_link_btn_click' @@ -124,7 +122,6 @@ class Field(AbstractObject.Field): outbound_clicks_ctr = 'outbound_clicks_ctr' place_page_name = 'place_page_name' purchase_roas = 'purchase_roas' - purchases_per_link_click = 'purchases_per_link_click' qualifying_question_qualify_answer_rate = 'qualifying_question_qualify_answer_rate' quality_ranking = 'quality_ranking' reach = 'reach' @@ -210,6 +207,7 @@ class Breakdowns: age = 'age' app_id = 'app_id' body_asset = 'body_asset' + breakdown_reporting_ad_id = 'breakdown_reporting_ad_id' call_to_action_asset = 'call_to_action_asset' coarse_conversion_value = 'coarse_conversion_value' conversion_destination = 'conversion_destination' @@ -237,6 +235,7 @@ class Breakdowns: media_format = 'media_format' media_origin_url = 'media_origin_url' media_text_content = 'media_text_content' + media_type = 'media_type' mmm = 'mmm' place_page_id = 'place_page_id' platform_position = 'platform_position' @@ -324,6 +323,7 @@ def get_endpoint(cls): 'auction_bid': 'string', 'auction_competitiveness': 'string', 'auction_max_competitor_bid': 'string', + 'average_purchases_conversion_value': 'list', 'buying_type': 'string', 'campaign_id': 'string', 'campaign_name': 'string', @@ -388,9 +388,6 @@ def get_endpoint(cls): 'instant_experience_outbound_clicks': 'list', 'interactive_component_tap': 'list', 'labels': 'string', - 'landing_page_view_actions_per_link_click': 'list', - 'landing_page_view_per_purchase_rate': 'list', - 'link_clicks_per_results': 'list', 'location': 'string', 'marketing_messages_cost_per_delivered': 'string', 'marketing_messages_cost_per_link_btn_click': 'string', @@ -404,7 +401,6 @@ def get_endpoint(cls): 'outbound_clicks_ctr': 'list', 'place_page_name': 'string', 'purchase_roas': 'list', - 'purchases_per_link_click': 'list', 'qualifying_question_qualify_answer_rate': 'string', 'quality_ranking': 'string', 'reach': 'string', diff --git a/facebook_business/adobjects/dognotificationsettings.py b/facebook_business/adobjects/adsquickviews.py similarity index 76% rename from facebook_business/adobjects/dognotificationsettings.py rename to facebook_business/adobjects/adsquickviews.py index 85b258f3..8c9d5277 100644 --- a/facebook_business/adobjects/dognotificationsettings.py +++ b/facebook_business/adobjects/adsquickviews.py @@ -18,18 +18,23 @@ pull request for this class. """ -class DogNotificationSettings( +class AdsQuickViews( AbstractCrudObject, ): def __init__(self, fbid=None, parent_id=None, api=None): - self._isDogNotificationSettings = True - super(DogNotificationSettings, self).__init__(fbid, parent_id, api) + self._isAdsQuickViews = True + super(AdsQuickViews, self).__init__(fbid, parent_id, api) class Field(AbstractObject.Field): - dog_check_key = 'dog_check_key' + attribution_windows = 'attribution_windows' + breakdowns = 'breakdowns' + column_fields = 'column_fields' + description = 'description' id = 'id' - subscription_status_per_channel = 'subscription_status_per_channel' + name = 'name' + permission = 'permission' + sort = 'sort' def api_get(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils @@ -45,7 +50,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No endpoint='/', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=DogNotificationSettings, + target_class=AdsQuickViews, api_type='NODE', response_parser=ObjectParser(reuse_object=self), ) @@ -62,9 +67,14 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No return request.execute() _field_types = { - 'dog_check_key': 'string', + 'attribution_windows': 'list', + 'breakdowns': 'list', + 'column_fields': 'list', + 'description': 'string', 'id': 'string', - 'subscription_status_per_channel': 'list>', + 'name': 'string', + 'permission': 'string', + 'sort': 'list', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/adsusersettings.py b/facebook_business/adobjects/adsusersettings.py index 359022a5..a240f62f 100644 --- a/facebook_business/adobjects/adsusersettings.py +++ b/facebook_business/adobjects/adsusersettings.py @@ -28,6 +28,7 @@ def __init__(self, fbid=None, parent_id=None, api=None): class Field(AbstractObject.Field): a_plus_c_survey_seen = 'a_plus_c_survey_seen' + add_overlays_opt_in_status = 'add_overlays_opt_in_status' adgroup_name_template = 'adgroup_name_template' ads_cs_catalog_opt_out_timestamp = 'ads_cs_catalog_opt_out_timestamp' ads_tool_visits = 'ads_tool_visits' @@ -49,6 +50,7 @@ class Field(AbstractObject.Field): focus_mode_default = 'focus_mode_default' gen_ai_alpha_test_status = 'gen_ai_alpha_test_status' id = 'id' + image_background_generation_opt_in_status = 'image_background_generation_opt_in_status' image_expansion_opt_in_status = 'image_expansion_opt_in_status' is_ads_ai_consented = 'is_ads_ai_consented' is_cbo_default_on = 'is_cbo_default_on' @@ -117,6 +119,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No _field_types = { 'a_plus_c_survey_seen': 'bool', + 'add_overlays_opt_in_status': 'string', 'adgroup_name_template': 'Object', 'ads_cs_catalog_opt_out_timestamp': 'list>', 'ads_tool_visits': 'list', @@ -138,6 +141,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No 'focus_mode_default': 'string', 'gen_ai_alpha_test_status': 'int', 'id': 'string', + 'image_background_generation_opt_in_status': 'string', 'image_expansion_opt_in_status': 'string', 'is_ads_ai_consented': 'bool', 'is_cbo_default_on': 'bool', diff --git a/facebook_business/adobjects/adsvalueadjustmentrulecollection.py b/facebook_business/adobjects/adsvalueadjustmentrulecollection.py index 1e6df1dc..30f1d9ed 100644 --- a/facebook_business/adobjects/adsvalueadjustmentrulecollection.py +++ b/facebook_business/adobjects/adsvalueadjustmentrulecollection.py @@ -60,7 +60,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No self.assure_call() return request.execute() - def get_personas(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + def get_rules(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') @@ -71,7 +71,7 @@ def get_personas(self, fields=None, params=None, batch=None, success=None, failu request = FacebookRequest( node_id=self['id'], method='GET', - endpoint='/personas', + endpoint='/rules', api=self._api, param_checker=TypeChecker(param_types, enums), target_class=AbstractCrudObject, diff --git a/facebook_business/adobjects/advideo.py b/facebook_business/adobjects/advideo.py index 15347421..d37e6c5a 100644 --- a/facebook_business/adobjects/advideo.py +++ b/facebook_business/adobjects/advideo.py @@ -98,7 +98,6 @@ class Field(AbstractObject.Field): fun_fact_toastee_id = 'fun_fact_toastee_id' guide = 'guide' guide_enabled = 'guide_enabled' - holiday_card = 'holiday_card' initial_heading = 'initial_heading' initial_pitch = 'initial_pitch' instant_game_entry_point_data = 'instant_game_entry_point_data' @@ -107,7 +106,6 @@ class Field(AbstractObject.Field): is_voice_clip = 'is_voice_clip' location_source_id = 'location_source_id' name = 'name' - offer_like_post_id = 'offer_like_post_id' og_action_type_id = 'og_action_type_id' og_icon_id = 'og_icon_id' og_object_id = 'og_object_id' @@ -491,7 +489,7 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure 'call_to_action': 'Object', 'content_category': 'content_category_enum', 'content_tags': 'list', - 'custom_labels': 'list', + 'custom_labels': 'string', 'description': 'string', 'direct_share_status': 'unsigned int', 'embeddable': 'bool', @@ -1200,11 +1198,10 @@ def get_video_insights(self, fields=None, params=None, batch=None, success=None, 'formatting': 'Formatting', 'fov': 'unsigned int', 'front_z_rotation': 'float', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'guide': 'list>', 'guide_enabled': 'bool', - 'holiday_card': 'string', 'initial_heading': 'unsigned int', 'initial_pitch': 'unsigned int', 'instant_game_entry_point_data': 'string', @@ -1213,7 +1210,6 @@ def get_video_insights(self, fields=None, params=None, batch=None, success=None, 'is_voice_clip': 'bool', 'location_source_id': 'string', 'name': 'string', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_icon_id': 'string', 'og_object_id': 'string', diff --git a/facebook_business/adobjects/almadaccountinfo.py b/facebook_business/adobjects/almadaccountinfo.py index 4bb5d989..221f536e 100644 --- a/facebook_business/adobjects/almadaccountinfo.py +++ b/facebook_business/adobjects/almadaccountinfo.py @@ -30,6 +30,7 @@ class Field(AbstractObject.Field): ad_account_id = 'ad_account_id' id = 'id' managed_by = 'managed_by' + owned_by = 'owned_by' parent_advertiser_id = 'parent_advertiser_id' sub_vertical = 'sub_vertical' tag = 'tag' @@ -70,6 +71,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No 'ad_account_id': 'string', 'id': 'string', 'managed_by': 'string', + 'owned_by': 'string', 'parent_advertiser_id': 'string', 'sub_vertical': 'string', 'tag': 'list', diff --git a/facebook_business/adobjects/application.py b/facebook_business/adobjects/application.py index f27f138d..77ba2e80 100644 --- a/facebook_business/adobjects/application.py +++ b/facebook_business/adobjects/application.py @@ -178,15 +178,6 @@ class PostMethod: codeless = 'CODELESS' eymt = 'EYMT' - class LoggingSource: - detection = 'DETECTION' - messenger_bot = 'MESSENGER_BOT' - - class LoggingTarget: - app = 'APP' - app_and_page = 'APP_AND_PAGE' - page = 'PAGE' - class OwnerPermissions: develop = 'DEVELOP' manage = 'MANAGE' @@ -448,6 +439,7 @@ def create_activity(self, fields=None, params=None, batch=None, success=None, fa 'data_processing_options_state': 'unsigned int', 'device_token': 'string', 'event': 'event_enum', + 'event_id': 'string', 'extinfo': 'Object', 'include_dwell_data': 'bool', 'include_video_data': 'bool', @@ -1486,6 +1478,37 @@ def get_linked_dataset(self, fields=None, params=None, batch=None, success=None, self.assure_call() return request.execute() + def get_message_templates(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'template_id': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/message_templates', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def create_mmp_auditing(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -1727,45 +1750,6 @@ def create_occludes_popup(self, fields=None, params=None, batch=None, success=No self.assure_call() return request.execute() - def create_page_activity(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - param_types = { - 'advertiser_tracking_enabled': 'bool', - 'application_tracking_enabled': 'bool', - 'custom_events': 'list', - 'logging_source': 'logging_source_enum', - 'logging_target': 'logging_target_enum', - 'page_id': 'unsigned int', - 'page_scoped_user_id': 'unsigned int', - } - enums = { - 'logging_source_enum': Application.LoggingSource.__dict__.values(), - 'logging_target_enum': Application.LoggingTarget.__dict__.values(), - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/page_activities', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=Application, - api_type='EDGE', - response_parser=ObjectParser(target_class=Application, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def create_payment_currency(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -2402,8 +2386,6 @@ def _get_field_enum_info(cls): field_enum_info['RequestType'] = Application.RequestType.__dict__.values() field_enum_info['MutationMethod'] = Application.MutationMethod.__dict__.values() field_enum_info['PostMethod'] = Application.PostMethod.__dict__.values() - field_enum_info['LoggingSource'] = Application.LoggingSource.__dict__.values() - field_enum_info['LoggingTarget'] = Application.LoggingTarget.__dict__.values() field_enum_info['OwnerPermissions'] = Application.OwnerPermissions.__dict__.values() field_enum_info['PartnerPermissions'] = Application.PartnerPermissions.__dict__.values() return field_enum_info diff --git a/facebook_business/adobjects/business.py b/facebook_business/adobjects/business.py index 401ba39c..a81ed786 100644 --- a/facebook_business/adobjects/business.py +++ b/facebook_business/adobjects/business.py @@ -4904,11 +4904,10 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'formatting': 'formatting_enum', 'fov': 'unsigned int', 'front_z_rotation': 'float', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'guide': 'list>', 'guide_enabled': 'bool', - 'holiday_card': 'string', 'initial_heading': 'unsigned int', 'initial_pitch': 'unsigned int', 'instant_game_entry_point_data': 'string', @@ -4916,7 +4915,6 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'is_group_linking_post': 'bool', 'is_voice_clip': 'bool', 'location_source_id': 'string', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_icon_id': 'string', 'og_object_id': 'string', diff --git a/facebook_business/adobjects/campaign.py b/facebook_business/adobjects/campaign.py index 4e94083f..dcf93ada 100644 --- a/facebook_business/adobjects/campaign.py +++ b/facebook_business/adobjects/campaign.py @@ -158,6 +158,7 @@ class SmartPromotionType: class SpecialAdCategories: credit = 'CREDIT' employment = 'EMPLOYMENT' + financial_products_services = 'FINANCIAL_PRODUCTS_SERVICES' housing = 'HOUSING' issues_elections_politics = 'ISSUES_ELECTIONS_POLITICS' none = 'NONE' @@ -423,6 +424,7 @@ class Operator: class SpecialAdCategory: credit = 'CREDIT' employment = 'EMPLOYMENT' + financial_products_services = 'FINANCIAL_PRODUCTS_SERVICES' housing = 'HOUSING' issues_elections_politics = 'ISSUES_ELECTIONS_POLITICS' none = 'NONE' diff --git a/facebook_business/adobjects/catalogitemrejectionreasons.py b/facebook_business/adobjects/catalogitemrejectionreasons.py index b1490575..c99011ca 100644 --- a/facebook_business/adobjects/catalogitemrejectionreasons.py +++ b/facebook_business/adobjects/catalogitemrejectionreasons.py @@ -27,22 +27,13 @@ class Field(AbstractObject.Field): capability = 'capability' rejection_information = 'rejection_information' - class Capability: - business_inbox_in_messenger = 'business_inbox_in_messenger' - shops = 'shops' - test_capability = 'test_capability' - universal_checkout = 'universal_checkout' - us_marketplace = 'us_marketplace' - whatsapp_marketing_message = 'whatsapp_marketing_message' - _field_types = { - 'capability': 'Capability', + 'capability': 'string', 'rejection_information': 'list', } @classmethod def _get_field_enum_info(cls): field_enum_info = {} - field_enum_info['Capability'] = CatalogItemRejectionReasons.Capability.__dict__.values() return field_enum_info diff --git a/facebook_business/adobjects/ctwawhatsappnumbersinfo.py b/facebook_business/adobjects/ctwawhatsappnumbersinfo.py index b6ef075b..228be7e1 100644 --- a/facebook_business/adobjects/ctwawhatsappnumbersinfo.py +++ b/facebook_business/adobjects/ctwawhatsappnumbersinfo.py @@ -27,6 +27,7 @@ class Field(AbstractObject.Field): can_manage_wa_flows = 'can_manage_wa_flows' formatted_whatsapp_number = 'formatted_whatsapp_number' is_business_number = 'is_business_number' + number_country_prefix = 'number_country_prefix' page_whatsapp_number_id = 'page_whatsapp_number_id' waba_id = 'waba_id' whatsapp_number = 'whatsapp_number' @@ -36,6 +37,7 @@ class Field(AbstractObject.Field): 'can_manage_wa_flows': 'bool', 'formatted_whatsapp_number': 'string', 'is_business_number': 'bool', + 'number_country_prefix': 'string', 'page_whatsapp_number_id': 'string', 'waba_id': 'string', 'whatsapp_number': 'string', diff --git a/facebook_business/adobjects/customaudience.py b/facebook_business/adobjects/customaudience.py index 13455a4d..11a35317 100644 --- a/facebook_business/adobjects/customaudience.py +++ b/facebook_business/adobjects/customaudience.py @@ -79,13 +79,17 @@ class Field(AbstractObject.Field): event_source_group = 'event_source_group' event_sources = 'event_sources' exclusions = 'exclusions' + facebook_page_id = 'facebook_page_id' inclusions = 'inclusions' list_of_accounts = 'list_of_accounts' + marketing_message_channels = 'marketing_message_channels' origin_audience_id = 'origin_audience_id' parent_audience_id = 'parent_audience_id' partner_reference_key = 'partner_reference_key' prefill = 'prefill' product_set_id = 'product_set_id' + subscription_info = 'subscription_info' + use_for_products = 'use_for_products' use_in_campaigns = 'use_in_campaigns' video_group_ids = 'video_group_ids' whats_app_business_phone_number_id = 'whats_app_business_phone_number_id' @@ -120,6 +124,10 @@ class CustomerFileSource: partner_provided_only = 'PARTNER_PROVIDED_ONLY' user_provided_only = 'USER_PROVIDED_ONLY' + class SubscriptionInfo: + messenger = 'MESSENGER' + whatsapp = 'WHATSAPP' + class Subtype: app = 'APP' bag_of_accounts = 'BAG_OF_ACCOUNTS' @@ -132,6 +140,7 @@ class Subtype: lookalike = 'LOOKALIKE' managed = 'MANAGED' measurement = 'MEASUREMENT' + messenger_subscriber_list = 'MESSENGER_SUBSCRIBER_LIST' offline_conversion = 'OFFLINE_CONVERSION' partner = 'PARTNER' primary = 'PRIMARY' @@ -141,6 +150,10 @@ class Subtype: video = 'VIDEO' website = 'WEBSITE' + class UseForProducts: + ads = 'ADS' + marketing_messages = 'MARKETING_MESSAGES' + class ActionSource: physical_store = 'PHYSICAL_STORE' website = 'WEBSITE' @@ -680,13 +693,17 @@ def create_users_replace(self, fields=None, params=None, batch=None, success=Non 'event_source_group': 'string', 'event_sources': 'list', 'exclusions': 'list', + 'facebook_page_id': 'string', 'inclusions': 'list', 'list_of_accounts': 'list', + 'marketing_message_channels': 'Object', 'origin_audience_id': 'string', 'parent_audience_id': 'unsigned int', 'partner_reference_key': 'string', 'prefill': 'bool', 'product_set_id': 'string', + 'subscription_info': 'list', + 'use_for_products': 'list', 'use_in_campaigns': 'bool', 'video_group_ids': 'list', 'whats_app_business_phone_number_id': 'string', @@ -697,7 +714,9 @@ def _get_field_enum_info(cls): field_enum_info['ClaimObjective'] = CustomAudience.ClaimObjective.__dict__.values() field_enum_info['ContentType'] = CustomAudience.ContentType.__dict__.values() field_enum_info['CustomerFileSource'] = CustomAudience.CustomerFileSource.__dict__.values() + field_enum_info['SubscriptionInfo'] = CustomAudience.SubscriptionInfo.__dict__.values() field_enum_info['Subtype'] = CustomAudience.Subtype.__dict__.values() + field_enum_info['UseForProducts'] = CustomAudience.UseForProducts.__dict__.values() field_enum_info['ActionSource'] = CustomAudience.ActionSource.__dict__.values() return field_enum_info diff --git a/facebook_business/adobjects/extendedcredit.py b/facebook_business/adobjects/extendedcredit.py index 9ad3d2f9..1d55934f 100644 --- a/facebook_business/adobjects/extendedcredit.py +++ b/facebook_business/adobjects/extendedcredit.py @@ -212,6 +212,69 @@ def create_owning_credit_allocation_config(self, fields=None, params=None, batch self.assure_call() return request.execute() + def create_whats_app_credit_attach(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'waba_currency': 'string', + 'waba_id': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/whatsapp_credit_attach', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def create_whats_app_credit_sharing(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'receiving_business_id': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/whatsapp_credit_sharing', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def create_whats_app_credit_sharing_and_attach(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): diff --git a/facebook_business/adobjects/group.py b/facebook_business/adobjects/group.py index 652719b7..2b38613b 100644 --- a/facebook_business/adobjects/group.py +++ b/facebook_business/adobjects/group.py @@ -296,49 +296,6 @@ def get_albums(self, fields=None, params=None, batch=None, success=None, failure self.assure_call() return request.execute() - def create_album(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - from facebook_business.adobjects.album import Album - param_types = { - 'contributors': 'list', - 'description': 'string', - 'is_default': 'bool', - 'location': 'string', - 'make_shared_album': 'bool', - 'message': 'string', - 'name': 'string', - 'place': 'Object', - 'privacy': 'string', - 'session_id': 'string', - 'tags': 'list', - 'visible': 'string', - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/albums', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=Album, - api_type='EDGE', - response_parser=ObjectParser(target_class=Album, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_docs(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -448,7 +405,7 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'android_key_hash': 'string', 'application_id': 'string', 'asked_fun_fact_prompt_id': 'unsigned int', - 'asset3d_id': 'unsigned int', + 'asset3d_id': 'string', 'associated_id': 'string', 'attach_place_suggestion': 'bool', 'attached_media': 'list', @@ -479,10 +436,9 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'expanded_width': 'unsigned int', 'feed_targeting': 'Object', 'formatting': 'formatting_enum', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'height': 'unsigned int', - 'holiday_card': 'string', 'home_checkin_city_id': 'Object', 'image_crops': 'map', 'implicit_with_tags': 'list', @@ -503,7 +459,6 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'name': 'string', 'nectar_module': 'string', 'object_attachment': 'string', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_hide_object_attachment': 'bool', 'og_icon_id': 'string', @@ -1057,11 +1012,10 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'formatting': 'formatting_enum', 'fov': 'unsigned int', 'front_z_rotation': 'float', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'guide': 'list>', 'guide_enabled': 'bool', - 'holiday_card': 'string', 'initial_heading': 'unsigned int', 'initial_pitch': 'unsigned int', 'instant_game_entry_point_data': 'string', @@ -1071,7 +1025,6 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'is_voice_clip': 'bool', 'location_source_id': 'string', 'manual_privacy': 'bool', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_icon_id': 'string', 'og_object_id': 'string', diff --git a/facebook_business/adobjects/hotel.py b/facebook_business/adobjects/hotel.py index 5aa304a4..01e13d2a 100644 --- a/facebook_business/adobjects/hotel.py +++ b/facebook_business/adobjects/hotel.py @@ -44,6 +44,11 @@ class Field(AbstractObject.Field): margin_level = 'margin_level' name = 'name' phone = 'phone' + product_priority_0 = 'product_priority_0' + product_priority_1 = 'product_priority_1' + product_priority_2 = 'product_priority_2' + product_priority_3 = 'product_priority_3' + product_priority_4 = 'product_priority_4' sale_price = 'sale_price' sanitized_images = 'sanitized_images' star_rating = 'star_rating' @@ -322,6 +327,11 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'margin_level': 'unsigned int', 'name': 'string', 'phone': 'string', + 'product_priority_0': 'float', + 'product_priority_1': 'float', + 'product_priority_2': 'float', + 'product_priority_3': 'float', + 'product_priority_4': 'float', 'sale_price': 'string', 'sanitized_images': 'list', 'star_rating': 'float', diff --git a/facebook_business/adobjects/igmedia.py b/facebook_business/adobjects/igmedia.py index 94ca064d..82116ebe 100644 --- a/facebook_business/adobjects/igmedia.py +++ b/facebook_business/adobjects/igmedia.py @@ -51,6 +51,8 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') param_types = { + 'ad_account_id': 'unsigned int', + 'business_id': 'string', 'primary_fb_page_id': 'string', 'primary_ig_user_id': 'string', 'secondary_fb_page_id': 'string', diff --git a/facebook_business/adobjects/igmediaforigonlyapi.py b/facebook_business/adobjects/igmediaforigonlyapi.py index d0d26f33..f9b4ec82 100644 --- a/facebook_business/adobjects/igmediaforigonlyapi.py +++ b/facebook_business/adobjects/igmediaforigonlyapi.py @@ -196,6 +196,46 @@ def create_comment(self, fields=None, params=None, batch=None, success=None, fai self.assure_call() return request.execute() + def get_insights(self, fields=None, params=None, is_async=False, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + from facebook_business.adobjects.insightsresult import InsightsResult + if is_async: + return self.get_insights_async(fields, params, batch, success, failure, pending) + param_types = { + 'breakdown': 'list', + 'metric': 'list', + 'period': 'list', + } + enums = { + 'breakdown_enum': InsightsResult.Breakdown.__dict__.values(), + 'metric_enum': InsightsResult.Metric.__dict__.values(), + 'period_enum': InsightsResult.Period.__dict__.values(), + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/insights', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=InsightsResult, + api_type='EDGE', + response_parser=ObjectParser(target_class=InsightsResult, api=self._api), + include_summary=False, + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + _field_types = { 'caption': 'string', 'comments_count': 'int', diff --git a/facebook_business/adobjects/iguserforigonlyapi.py b/facebook_business/adobjects/iguserforigonlyapi.py index f534ec26..969ffe29 100644 --- a/facebook_business/adobjects/iguserforigonlyapi.py +++ b/facebook_business/adobjects/iguserforigonlyapi.py @@ -699,6 +699,45 @@ def get_welcome_message_flows(self, fields=None, params=None, batch=None, succes self.assure_call() return request.execute() + def create_welcome_message_flow(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'eligible_platforms': 'list', + 'flow_id': 'string', + 'name': 'string', + 'welcome_message_flow': 'list', + } + enums = { + 'eligible_platforms_enum': [ + 'INSTAGRAM', + 'MESSENGER', + 'WHATSAPP', + ], + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/welcome_message_flows', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + _field_types = { 'account_type': 'string', 'biography': 'string', diff --git a/facebook_business/adobjects/insightsresult.py b/facebook_business/adobjects/insightsresult.py index 364669e2..552cd90d 100644 --- a/facebook_business/adobjects/insightsresult.py +++ b/facebook_business/adobjects/insightsresult.py @@ -35,6 +35,46 @@ class Field(AbstractObject.Field): title = 'title' values = 'values' + class Breakdown: + action_type = 'action_type' + follow_type = 'follow_type' + story_navigation_action_type = 'story_navigation_action_type' + surface_type = 'surface_type' + + class Metric: + clips_replays_count = 'clips_replays_count' + comments = 'comments' + follows = 'follows' + ig_reels_aggregated_all_plays_count = 'ig_reels_aggregated_all_plays_count' + ig_reels_avg_watch_time = 'ig_reels_avg_watch_time' + ig_reels_video_view_total_time = 'ig_reels_video_view_total_time' + impressions = 'impressions' + likes = 'likes' + navigation = 'navigation' + peak_concurrent_viewers = 'peak_concurrent_viewers' + plays = 'plays' + profile_activity = 'profile_activity' + profile_visits = 'profile_visits' + quotes = 'quotes' + reach = 'reach' + replies = 'replies' + reposts = 'reposts' + saved = 'saved' + shares = 'shares' + thread_replies = 'thread_replies' + thread_shares = 'thread_shares' + total_interactions = 'total_interactions' + video_views = 'video_views' + views = 'views' + + class Period: + day = 'day' + days_28 = 'days_28' + lifetime = 'lifetime' + month = 'month' + total_over_range = 'total_over_range' + week = 'week' + class DatePreset: data_maximum = 'data_maximum' last_14d = 'last_14d' @@ -57,23 +97,6 @@ class DatePreset: today = 'today' yesterday = 'yesterday' - class Period: - day = 'day' - days_28 = 'days_28' - lifetime = 'lifetime' - month = 'month' - total_over_range = 'total_over_range' - week = 'week' - - class Metric: - pages_fb_story_replies = 'PAGES_FB_STORY_REPLIES' - pages_fb_story_shares = 'PAGES_FB_STORY_SHARES' - pages_fb_story_sticker_interactions = 'PAGES_FB_STORY_STICKER_INTERACTIONS' - pages_fb_story_thread_lightweight_reactions = 'PAGES_FB_STORY_THREAD_LIGHTWEIGHT_REACTIONS' - page_story_impressions_by_story_id = 'PAGE_STORY_IMPRESSIONS_BY_STORY_ID' - page_story_impressions_by_story_id_unique = 'PAGE_STORY_IMPRESSIONS_BY_STORY_ID_UNIQUE' - story_interaction = 'STORY_INTERACTION' - _field_types = { 'description': 'string', 'description_from_api_doc': 'string', @@ -86,9 +109,10 @@ class Metric: @classmethod def _get_field_enum_info(cls): field_enum_info = {} - field_enum_info['DatePreset'] = InsightsResult.DatePreset.__dict__.values() - field_enum_info['Period'] = InsightsResult.Period.__dict__.values() + field_enum_info['Breakdown'] = InsightsResult.Breakdown.__dict__.values() field_enum_info['Metric'] = InsightsResult.Metric.__dict__.values() + field_enum_info['Period'] = InsightsResult.Period.__dict__.values() + field_enum_info['DatePreset'] = InsightsResult.DatePreset.__dict__.values() return field_enum_info diff --git a/facebook_business/adobjects/instagraminsightsresult.py b/facebook_business/adobjects/instagraminsightsresult.py index 4bbafad8..b892b0f2 100644 --- a/facebook_business/adobjects/instagraminsightsresult.py +++ b/facebook_business/adobjects/instagraminsightsresult.py @@ -62,6 +62,7 @@ class Metric: saved = 'saved' shares = 'shares' thread_replies = 'thread_replies' + thread_shares = 'thread_shares' total_interactions = 'total_interactions' video_views = 'video_views' views = 'views' diff --git a/facebook_business/adobjects/panelapireport.py b/facebook_business/adobjects/messengerbusinesstemplate.py similarity index 70% rename from facebook_business/adobjects/panelapireport.py rename to facebook_business/adobjects/messengerbusinesstemplate.py index 762649d7..ac1b0113 100644 --- a/facebook_business/adobjects/panelapireport.py +++ b/facebook_business/adobjects/messengerbusinesstemplate.py @@ -18,25 +18,26 @@ pull request for this class. """ -class PanelAPIReport( +class MessengerBusinessTemplate( AbstractCrudObject, ): def __init__(self, fbid=None, parent_id=None, api=None): - self._isPanelAPIReport = True - super(PanelAPIReport, self).__init__(fbid, parent_id, api) + self._isMessengerBusinessTemplate = True + super(MessengerBusinessTemplate, self).__init__(fbid, parent_id, api) class Field(AbstractObject.Field): - checksum = 'checksum' - download_url = 'download_url' - end_date = 'end_date' - export_file_type = 'export_file_type' + category = 'category' + components = 'components' + creation_time = 'creation_time' id = 'id' - index = 'index' + language = 'language' + language_count = 'language_count' + last_updated_time = 'last_updated_time' + library_template_name = 'library_template_name' name = 'name' - number_of_chunks = 'number_of_chunks' - start_date = 'start_date' - upload_date = 'upload_date' + rejected_reason = 'rejected_reason' + status = 'status' def api_get(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils @@ -52,7 +53,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No endpoint='/', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=PanelAPIReport, + target_class=MessengerBusinessTemplate, api_type='NODE', response_parser=ObjectParser(reuse_object=self), ) @@ -69,16 +70,17 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No return request.execute() _field_types = { - 'checksum': 'string', - 'download_url': 'string', - 'end_date': 'datetime', - 'export_file_type': 'string', + 'category': 'string', + 'components': 'list', + 'creation_time': 'int', 'id': 'string', - 'index': 'int', + 'language': 'string', + 'language_count': 'int', + 'last_updated_time': 'datetime', + 'library_template_name': 'string', 'name': 'string', - 'number_of_chunks': 'int', - 'start_date': 'datetime', - 'upload_date': 'datetime', + 'rejected_reason': 'string', + 'status': 'string', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/page.py b/facebook_business/adobjects/page.py index ed14bbcb..d38fb4c9 100644 --- a/facebook_business/adobjects/page.py +++ b/facebook_business/adobjects/page.py @@ -1753,6 +1753,37 @@ def get_crosspost_whitelisted_pages(self, fields=None, params=None, batch=None, self.assure_call() return request.execute() + def get_ctx_optimization_eligibility(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + from facebook_business.adobjects.ctxoptimizationeligibility import CTXOptimizationEligibility + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/ctx_optimization_eligibility', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=CTXOptimizationEligibility, + api_type='EDGE', + response_parser=ObjectParser(target_class=CTXOptimizationEligibility, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_custom_labels(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -2126,7 +2157,7 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'android_key_hash': 'string', 'application_id': 'string', 'asked_fun_fact_prompt_id': 'unsigned int', - 'asset3d_id': 'unsigned int', + 'asset3d_id': 'string', 'associated_id': 'string', 'attach_place_suggestion': 'bool', 'attached_media': 'list', @@ -2158,10 +2189,9 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'expanded_width': 'unsigned int', 'feed_targeting': 'Object', 'formatting': 'formatting_enum', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'height': 'unsigned int', - 'holiday_card': 'string', 'home_checkin_city_id': 'Object', 'image_crops': 'map', 'implicit_with_tags': 'list', @@ -2182,7 +2212,6 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'name': 'string', 'nectar_module': 'string', 'object_attachment': 'string', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_hide_object_attachment': 'bool', 'og_icon_id': 'string', @@ -4914,11 +4943,10 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'formatting': 'formatting_enum', 'fov': 'unsigned int', 'front_z_rotation': 'float', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'guide': 'list>', 'guide_enabled': 'bool', - 'holiday_card': 'string', 'initial_heading': 'unsigned int', 'initial_pitch': 'unsigned int', 'instant_game_entry_point_data': 'string', @@ -4930,7 +4958,6 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'manual_privacy': 'bool', 'multilingual_data': 'list', 'no_story': 'bool', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_icon_id': 'string', 'og_object_id': 'string', diff --git a/facebook_business/adobjects/partnershipadcontentsearchmedia.py b/facebook_business/adobjects/partnershipadcontentsearchmedia.py index 506ac28a..90d82a7c 100644 --- a/facebook_business/adobjects/partnershipadcontentsearchmedia.py +++ b/facebook_business/adobjects/partnershipadcontentsearchmedia.py @@ -24,13 +24,19 @@ def __init__(self, api=None): self._api = api class Field(AbstractObject.Field): + ig_ad_code_sponsor_count = 'ig_ad_code_sponsor_count' + ig_ad_code_sponsors = 'ig_ad_code_sponsors' ig_media = 'ig_media' ig_media_has_product_tags = 'ig_media_has_product_tags' + is_ad_code_eligible_for_boosting_by_two_sponsors = 'is_ad_code_eligible_for_boosting_by_two_sponsors' is_ad_code_entry = 'is_ad_code_entry' _field_types = { + 'ig_ad_code_sponsor_count': 'int', + 'ig_ad_code_sponsors': 'list', 'ig_media': 'IGMedia', 'ig_media_has_product_tags': 'bool', + 'is_ad_code_eligible_for_boosting_by_two_sponsors': 'bool', 'is_ad_code_entry': 'bool', } @classmethod diff --git a/facebook_business/adobjects/placement.py b/facebook_business/adobjects/placement.py new file mode 100644 index 00000000..be97c47a --- /dev/null +++ b/facebook_business/adobjects/placement.py @@ -0,0 +1,81 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +from facebook_business.adobjects.abstractobject import AbstractObject + +""" +This class is auto-generated. + +For any issues or feature requests related to this class, please let us know on +github and we'll fix in our codegen framework. We'll not be able to accept +pull request for this class. +""" + +class Placement( + AbstractObject, +): + + def __init__(self, api=None): + super(Placement, self).__init__() + self._isPlacement = True + self._api = api + + class Field(AbstractObject.Field): + audience_network_positions = 'audience_network_positions' + device_platforms = 'device_platforms' + effective_audience_network_positions = 'effective_audience_network_positions' + effective_device_platforms = 'effective_device_platforms' + effective_facebook_positions = 'effective_facebook_positions' + effective_instagram_positions = 'effective_instagram_positions' + effective_messenger_positions = 'effective_messenger_positions' + effective_oculus_positions = 'effective_oculus_positions' + effective_publisher_platforms = 'effective_publisher_platforms' + effective_threads_positions = 'effective_threads_positions' + effective_whatsapp_positions = 'effective_whatsapp_positions' + facebook_positions = 'facebook_positions' + instagram_positions = 'instagram_positions' + messenger_positions = 'messenger_positions' + oculus_positions = 'oculus_positions' + publisher_platforms = 'publisher_platforms' + threads_positions = 'threads_positions' + whatsapp_positions = 'whatsapp_positions' + + class DevicePlatforms: + desktop = 'desktop' + mobile = 'mobile' + + class EffectiveDevicePlatforms: + desktop = 'desktop' + mobile = 'mobile' + + _field_types = { + 'audience_network_positions': 'list', + 'device_platforms': 'list', + 'effective_audience_network_positions': 'list', + 'effective_device_platforms': 'list', + 'effective_facebook_positions': 'list', + 'effective_instagram_positions': 'list', + 'effective_messenger_positions': 'list', + 'effective_oculus_positions': 'list', + 'effective_publisher_platforms': 'list', + 'effective_threads_positions': 'list', + 'effective_whatsapp_positions': 'list', + 'facebook_positions': 'list', + 'instagram_positions': 'list', + 'messenger_positions': 'list', + 'oculus_positions': 'list', + 'publisher_platforms': 'list', + 'threads_positions': 'list', + 'whatsapp_positions': 'list', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['DevicePlatforms'] = Placement.DevicePlatforms.__dict__.values() + field_enum_info['EffectiveDevicePlatforms'] = Placement.EffectiveDevicePlatforms.__dict__.values() + return field_enum_info + + diff --git a/facebook_business/adobjects/productcatalog.py b/facebook_business/adobjects/productcatalog.py index 7066fd65..75df6732 100644 --- a/facebook_business/adobjects/productcatalog.py +++ b/facebook_business/adobjects/productcatalog.py @@ -1333,6 +1333,37 @@ def create_localized_items_batch(self, fields=None, params=None, batch=None, suc self.assure_call() return request.execute() + def create_market_place_partner_sellers_detail(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'requests': 'map', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/marketplace_partner_sellers_details', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=ProductCatalog, + api_type='EDGE', + response_parser=ObjectParser(target_class=ProductCatalog, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_pricing_variables_batch(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): diff --git a/facebook_business/adobjects/productcatalogdiagnosticgroup.py b/facebook_business/adobjects/productcatalogdiagnosticgroup.py index f2ffac58..c46bd24c 100644 --- a/facebook_business/adobjects/productcatalogdiagnosticgroup.py +++ b/facebook_business/adobjects/productcatalogdiagnosticgroup.py @@ -36,22 +36,6 @@ class Field(AbstractObject.Field): title = 'title' type = 'type' - class AffectedChannels: - b2c_marketplace = 'b2c_marketplace' - c2c_marketplace = 'c2c_marketplace' - da = 'da' - daily_deals = 'daily_deals' - daily_deals_legacy = 'daily_deals_legacy' - ig_product_tagging = 'ig_product_tagging' - marketplace = 'marketplace' - marketplace_ads_deprecated = 'marketplace_ads_deprecated' - marketplace_shops = 'marketplace_shops' - mini_shops = 'mini_shops' - offline_conversions = 'offline_conversions' - shops = 'shops' - universal_checkout = 'universal_checkout' - whatsapp = 'whatsapp' - class AffectedEntity: product_catalog = 'product_catalog' product_event = 'product_event' @@ -79,6 +63,22 @@ class Type: policy_violation = 'POLICY_VIOLATION' shops_visibility_issues = 'SHOPS_VISIBILITY_ISSUES' + class AffectedChannels: + b2c_marketplace = 'b2c_marketplace' + c2c_marketplace = 'c2c_marketplace' + da = 'da' + daily_deals = 'daily_deals' + daily_deals_legacy = 'daily_deals_legacy' + ig_product_tagging = 'ig_product_tagging' + marketplace = 'marketplace' + marketplace_ads_deprecated = 'marketplace_ads_deprecated' + marketplace_shops = 'marketplace_shops' + mini_shops = 'mini_shops' + offline_conversions = 'offline_conversions' + shops = 'shops' + universal_checkout = 'universal_checkout' + whatsapp = 'whatsapp' + class AffectedEntities: product_catalog = 'product_catalog' product_event = 'product_event' @@ -103,7 +103,7 @@ class Types: shops_visibility_issues = 'SHOPS_VISIBILITY_ISSUES' _field_types = { - 'affected_channels': 'list', + 'affected_channels': 'list', 'affected_entity': 'AffectedEntity', 'affected_features': 'list', 'diagnostics': 'list', @@ -118,11 +118,11 @@ class Types: @classmethod def _get_field_enum_info(cls): field_enum_info = {} - field_enum_info['AffectedChannels'] = ProductCatalogDiagnosticGroup.AffectedChannels.__dict__.values() field_enum_info['AffectedEntity'] = ProductCatalogDiagnosticGroup.AffectedEntity.__dict__.values() field_enum_info['AffectedFeatures'] = ProductCatalogDiagnosticGroup.AffectedFeatures.__dict__.values() field_enum_info['Severity'] = ProductCatalogDiagnosticGroup.Severity.__dict__.values() field_enum_info['Type'] = ProductCatalogDiagnosticGroup.Type.__dict__.values() + field_enum_info['AffectedChannels'] = ProductCatalogDiagnosticGroup.AffectedChannels.__dict__.values() field_enum_info['AffectedEntities'] = ProductCatalogDiagnosticGroup.AffectedEntities.__dict__.values() field_enum_info['Severities'] = ProductCatalogDiagnosticGroup.Severities.__dict__.values() field_enum_info['Types'] = ProductCatalogDiagnosticGroup.Types.__dict__.values() diff --git a/facebook_business/adobjects/productfeed.py b/facebook_business/adobjects/productfeed.py index 3b60ec58..6a00f8fb 100644 --- a/facebook_business/adobjects/productfeed.py +++ b/facebook_business/adobjects/productfeed.py @@ -81,6 +81,7 @@ class Encoding: class FeedType: automotive_model = 'AUTOMOTIVE_MODEL' + collection = 'COLLECTION' destination = 'DESTINATION' flight = 'FLIGHT' home_listing = 'HOME_LISTING' diff --git a/facebook_business/adobjects/productitem.py b/facebook_business/adobjects/productitem.py index 5010183e..fbd32a05 100644 --- a/facebook_business/adobjects/productitem.py +++ b/facebook_business/adobjects/productitem.py @@ -149,6 +149,13 @@ class Availability: pending = 'pending' preorder = 'preorder' + class CapabilityToReviewStatus: + approved = 'APPROVED' + no_review = 'NO_REVIEW' + outdated = 'OUTDATED' + pending = 'PENDING' + rejected = 'REJECTED' + class Condition: cpo = 'cpo' new = 'new' @@ -474,6 +481,7 @@ class ErrorType: invalid_subscription_disable_params = 'INVALID_SUBSCRIPTION_DISABLE_PARAMS' invalid_subscription_enable_params = 'INVALID_SUBSCRIPTION_ENABLE_PARAMS' invalid_subscription_params = 'INVALID_SUBSCRIPTION_PARAMS' + invalid_tax_extension_state = 'INVALID_TAX_EXTENSION_STATE' invalid_vehicle_state = 'INVALID_VEHICLE_STATE' invalid_virtual_tour_url_domain = 'INVALID_VIRTUAL_TOUR_URL_DOMAIN' inventory_zero_availability_in_stock = 'INVENTORY_ZERO_AVAILABILITY_IN_STOCK' @@ -1143,7 +1151,7 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'brand': 'string', 'bundle_items': 'list', 'bundle_retailer_ids': 'list', - 'capability_to_review_status': 'list>', + 'capability_to_review_status': 'list>', 'category': 'string', 'category_specific_fields': 'CatalogSubVerticalList', 'color': 'string', @@ -1243,6 +1251,7 @@ def _get_field_enum_info(cls): field_enum_info = {} field_enum_info['AgeGroup'] = ProductItem.AgeGroup.__dict__.values() field_enum_info['Availability'] = ProductItem.Availability.__dict__.values() + field_enum_info['CapabilityToReviewStatus'] = ProductItem.CapabilityToReviewStatus.__dict__.values() field_enum_info['Condition'] = ProductItem.Condition.__dict__.values() field_enum_info['Gender'] = ProductItem.Gender.__dict__.values() field_enum_info['ImageFetchStatus'] = ProductItem.ImageFetchStatus.__dict__.values() diff --git a/facebook_business/adobjects/savedmessageresponse.py b/facebook_business/adobjects/savedmessageresponse.py index 212334ab..6a61d895 100644 --- a/facebook_business/adobjects/savedmessageresponse.py +++ b/facebook_business/adobjects/savedmessageresponse.py @@ -27,7 +27,6 @@ def __init__(self, fbid=None, parent_id=None, api=None): super(SavedMessageResponse, self).__init__(fbid, parent_id, api) class Field(AbstractObject.Field): - category = 'category' id = 'id' image = 'image' is_enabled = 'is_enabled' @@ -65,7 +64,6 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No return request.execute() _field_types = { - 'category': 'string', 'id': 'string', 'image': 'string', 'is_enabled': 'bool', diff --git a/facebook_business/adobjects/user.py b/facebook_business/adobjects/user.py index ed39a202..0bc5d695 100644 --- a/facebook_business/adobjects/user.py +++ b/facebook_business/adobjects/user.py @@ -228,9 +228,9 @@ def create_access_token(self, fields=None, params=None, batch=None, success=None if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') param_types = { - 'business_app': 'int', + 'business_app': 'string', 'page_id': 'string', - 'scope': 'list', + 'scope': 'list', 'set_token_expires_in_60_days': 'bool', } enums = { @@ -1041,7 +1041,7 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'android_key_hash': 'string', 'application_id': 'string', 'asked_fun_fact_prompt_id': 'unsigned int', - 'asset3d_id': 'unsigned int', + 'asset3d_id': 'string', 'associated_id': 'string', 'attach_place_suggestion': 'bool', 'attached_media': 'list', @@ -1072,10 +1072,9 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'expanded_width': 'unsigned int', 'feed_targeting': 'Object', 'formatting': 'formatting_enum', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'height': 'unsigned int', - 'holiday_card': 'string', 'home_checkin_city_id': 'Object', 'image_crops': 'map', 'implicit_with_tags': 'list', @@ -1096,7 +1095,6 @@ def create_feed(self, fields=None, params=None, batch=None, success=None, failur 'name': 'string', 'nectar_module': 'string', 'object_attachment': 'string', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_hide_object_attachment': 'bool', 'og_icon_id': 'string', @@ -2085,11 +2083,10 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'formatting': 'formatting_enum', 'fov': 'unsigned int', 'front_z_rotation': 'float', - 'fun_fact_prompt_id': 'unsigned int', + 'fun_fact_prompt_id': 'string', 'fun_fact_toastee_id': 'unsigned int', 'guide': 'list>', 'guide_enabled': 'bool', - 'holiday_card': 'string', 'initial_heading': 'unsigned int', 'initial_pitch': 'unsigned int', 'instant_game_entry_point_data': 'string', @@ -2100,7 +2097,6 @@ def create_video(self, fields=None, params=None, batch=None, success=None, failu 'location_source_id': 'string', 'manual_privacy': 'bool', 'no_story': 'bool', - 'offer_like_post_id': 'unsigned int', 'og_action_type_id': 'string', 'og_icon_id': 'string', 'og_object_id': 'string', diff --git a/facebook_business/adobjects/vehicle.py b/facebook_business/adobjects/vehicle.py index f578b8d2..dc76f669 100644 --- a/facebook_business/adobjects/vehicle.py +++ b/facebook_business/adobjects/vehicle.py @@ -59,6 +59,11 @@ class Field(AbstractObject.Field): previous_currency = 'previous_currency' previous_price = 'previous_price' price = 'price' + product_priority_0 = 'product_priority_0' + product_priority_1 = 'product_priority_1' + product_priority_2 = 'product_priority_2' + product_priority_3 = 'product_priority_3' + product_priority_4 = 'product_priority_4' sale_currency = 'sale_currency' sale_price = 'sale_price' sanitized_images = 'sanitized_images' @@ -404,6 +409,11 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'previous_currency': 'string', 'previous_price': 'string', 'price': 'string', + 'product_priority_0': 'float', + 'product_priority_1': 'float', + 'product_priority_2': 'float', + 'product_priority_3': 'float', + 'product_priority_4': 'float', 'sale_currency': 'string', 'sale_price': 'string', 'sanitized_images': 'list', diff --git a/facebook_business/adobjects/vehicleoffer.py b/facebook_business/adobjects/vehicleoffer.py index 164e76e5..2030fcd8 100644 --- a/facebook_business/adobjects/vehicleoffer.py +++ b/facebook_business/adobjects/vehicleoffer.py @@ -59,6 +59,11 @@ class Field(AbstractObject.Field): offer_disclaimer = 'offer_disclaimer' offer_type = 'offer_type' price = 'price' + product_priority_0 = 'product_priority_0' + product_priority_1 = 'product_priority_1' + product_priority_2 = 'product_priority_2' + product_priority_3 = 'product_priority_3' + product_priority_4 = 'product_priority_4' sanitized_images = 'sanitized_images' start_date = 'start_date' start_time = 'start_time' @@ -244,6 +249,11 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'offer_disclaimer': 'string', 'offer_type': 'string', 'price': 'string', + 'product_priority_0': 'float', + 'product_priority_1': 'float', + 'product_priority_2': 'float', + 'product_priority_3': 'float', + 'product_priority_4': 'float', 'sanitized_images': 'list', 'start_date': 'string', 'start_time': 'int', diff --git a/facebook_business/adobjects/whatsappbusinessaccount.py b/facebook_business/adobjects/whatsappbusinessaccount.py index 493120e4..f8d9450c 100644 --- a/facebook_business/adobjects/whatsappbusinessaccount.py +++ b/facebook_business/adobjects/whatsappbusinessaccount.py @@ -75,6 +75,7 @@ class SubCategory: order_status = 'ORDER_STATUS' class ProviderName: + billdesk = 'BILLDESK' payu = 'PAYU' razorpay = 'RAZORPAY' upi_vpa = 'UPI_VPA' @@ -297,6 +298,66 @@ def get_audiences(self, fields=None, params=None, batch=None, success=None, fail self.assure_call() return request.execute() + def get_call_analytics(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'country_codes': 'list', + 'dimensions': 'list', + 'directions': 'list', + 'end': 'unsigned int', + 'granularity': 'granularity_enum', + 'metric_types': 'list', + 'phone_numbers': 'list', + 'start': 'unsigned int', + } + enums = { + 'dimensions_enum': [ + 'COUNTRY', + 'DIRECTION', + 'PHONE', + 'UNKNOWN', + ], + 'directions_enum': [ + 'BUSINESS_INITIATED', + 'UNKNOWN', + 'USER_INITIATED', + ], + 'granularity_enum': [ + 'DAILY', + 'HALF_HOUR', + 'MONTHLY', + ], + 'metric_types_enum': [ + 'AVERAGE_DURATION', + 'COST', + 'COUNT', + 'UNKNOWN', + ], + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/call_analytics', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_conversation_analytics(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -746,6 +807,7 @@ def create_message_template(self, fields=None, params=None, batch=None, success= 'cta_url_link_tracking_opted_out': 'bool', 'display_format': 'display_format_enum', 'language': 'string', + 'library_template_body_inputs': 'map', 'library_template_button_inputs': 'list', 'library_template_name': 'string', 'message_send_ttl_seconds': 'unsigned int', diff --git a/facebook_business/apiconfig.py b/facebook_business/apiconfig.py index e3d8c9c9..67d4aeea 100644 --- a/facebook_business/apiconfig.py +++ b/facebook_business/apiconfig.py @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. ads_api_config = { - 'API_VERSION': 'v20.0', - 'SDK_VERSION': 'v20.0.3', + 'API_VERSION': 'v21.0', + 'SDK_VERSION': 'v21.0.0', 'STRICT_MODE': False } diff --git a/setup.py b/setup.py index 32df0307..7a05ca6f 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ requirements_filename = os.path.join(this_dir, 'requirements.txt') PACKAGE_NAME = 'facebook_business' -PACKAGE_VERSION = '20.0.3' +PACKAGE_VERSION = '21.0.0' PACKAGE_AUTHOR = 'Facebook' PACKAGE_AUTHOR_EMAIL = 'shuotian@meta.com' PACKAGE_URL = 'https://github.com/facebook/facebook-python-business-sdk'