Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enttity type .all method parameter parsing incorrect, expected boolean got "True" #218

Open
shaun10 opened this issue Aug 12, 2019 · 1 comment

Comments

@shaun10
Copy link
Contributor

shaun10 commented Aug 12, 2019

  File "process_twitter_ads_api/main.py", line 408, in main
    lookup_table_name = produce_lookup_data(ACCOUNTS, entity_name, entity_properties)
  File "process_twitter_ads_api/main.py", line 323, in produce_lookup_data
    entities_df = json_normalize([item.to_params() for item in entity_properties.get('object').all(acc
ount_object, with_deleted=True)], sep='_')
  File "/opt/conda/lib/python2.7/site-packages/twitter_ads/resource.py", line 94, in all
    return Cursor(klass, request, init_with=[account])
  File "/opt/conda/lib/python2.7/site-packages/twitter_ads/cursor.py", line 29, in __init__
    self.__from_response(request.perform())
  File "/opt/conda/lib/python2.7/site-packages/twitter_ads/http.py", line 69, in perform
    raise Error.from_response(response)
BadRequest: <BadRequest object at 0x7f3df76c2dc0 code=400 details=[{u'message':u'Expected Boolean, go
t "True" for with_deleted', u'code': u'INVALID_PARAMETER', u'parameter': u

I’m passing it like this X.all(account_object, with_deleted=True) with X being the type of object. such as PromotedTweet, MediaCreative, AccountMedia,
ImageAppDownloadCard, MediaLibrary, VideoConversationCard, PollCard, WebsiteCard from the SDK. Can you help me understand which of these objects could take this and which couldn’t? Also is there a way I can pass generally to avoid the error above?

With targeting criteria I use TargetingCriteria.all(account_object, line_items_subset_ids, with_deleted=True) as that is not a creative. The non-creative .all methods have a slightly different setup in the SDK.

@smaeda-ks
Copy link
Contributor

@shaun10

Also is there a way I can pass generally to avoid the error above?

The best you can do right now is to check our documentation as to which endpoint supports with_deleted request parameter.

I'm taking your feedback as my TODO but for now, please check our documentation. Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants