2

I am trying to use redownload to download all fields of an AdSet but it doesn't seem to be working. Here is my code:

ad_set = AdSet('6049562095738')
response=ad_set.api_get(params={AdSet.Field.redownload:True})
print(response)

and I get

{ "id": "6049562095738" }

Piyush
  • 728
  • 1
  • 8
  • 11

1 Answers1

1

That looks like a GET request - the redownload param is on the POST path and returns some of the fields of the newly created or updated object

You should specify which fields you want via the fields parameter when reading ads

Igy
  • 43,710
  • 8
  • 89
  • 115
  • Thanks Igy. Is redownload param available only for POST requests ? I want to download all the fields and not any specific fields. I want to make my program forward compatible, in the sense that if new fields are added in future versions of the API, then program need not be changed. – Piyush Sep 01 '16 at 10:04
  • No, for GET requests you should request just the fields your app needs (i.e those that your business logic, reporting, etc uses); fetching all fields wouldn't add any value to your app, and you'd still need to change it for each new version of the API anyway to account for the backwards-incompatible changes - you'd also unnecessarily encounter slower API responses and be affected by field-specific bugs in fields you don't need, etc – Igy Sep 01 '16 at 11:23
  • Do you mind pointing me to the section in Facebook Documentation where it says that its meant only for GET requests – Piyush Sep 01 '16 at 11:25
  • 1
    It's only for POST requests, it's listed in the creation and editing sections of the relevant objects' documentation - e.g. 'Ad' here: https://developers.facebook.com/docs/marketing-api/reference/adgroup – Igy Sep 01 '16 at 13:12