def campaign_status_update(self, campaign_id): try: campaign = Campaign(campaign_id) campaign[Campaign.Field.status] = 'ACTIVE' campaign.remote_update() print("Sucussfully Campaign updated!") except Exception as e: print(e)
def update_campaign(request, campid, status): FacebookAdsApi.init(access_token=access_token, app_id=app_id, app_secret=app_secret) campaign = Campaign(campid) campaign[Campaign.Field.status] = status campaign.remote_update() return redirect('view-campaign')