Skip to content

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

Open
@shaun10

Description

@shaun10
Contributor
  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.

Activity

smaeda-ks

smaeda-ks commented on Aug 13, 2019

@smaeda-ks
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.

self-assigned this
on Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @shaun10@smaeda-ks

      Issue actions

        Enttity type .all method parameter parsing incorrect, expected boolean got "True" · Issue #218 · xdevplatform/twitter-python-ads-sdk