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

LineItem retrieved with invalid attributes #262

Open
clevep opened this issue Aug 27, 2020 · 1 comment
Open

LineItem retrieved with invalid attributes #262

clevep opened this issue Aug 27, 2020 · 1 comment

Comments

@clevep
Copy link

clevep commented Aug 27, 2020

LineItem objects loaded from my Account contain invalid values for the attributes:

  • advertiser_user_id
  • bid_unit
  • charge_by

So if I load a LineItem and then immediately save it, I am greeted with errors like this:

>>> line_item = account.line_items().next()

>>> line_item.save()
BadRequest: <BadRequest object at 0x7fc24b5bd9a8 code=400 details=[{'message': 'Expected a value in APP_CLICK, APP_INSTALL, VIEW, VIEW_3S_100PCT, VIEW_6S, got "LINK_CLICK" for bid_unit', 'code': 'INVALID_PARAMETER', 'parameter': 'bid_unit'}, {'message': 'Expected a value in APP_CLICK, APP_INSTALL, got "LINK_CLICK" for charge_by', 'code': 'INVALID_PARAMETER', 'parameter': 'charge_by'}, {'message': 'setting advertiser_user_id is not allowed', 'code': 'INVALID_PARAMETER', 'parameter': 'advertiser_user_id'}]>

I am able to work around this by explicitly setting all of these attributes to None before saving, but it does not seem like they should populate with invalid values.

@osowskit
Copy link
Contributor

Over time, parameters and options can get deprecated between versions. This results in campaigns that may no longer be possible to modify or the previous values are not valid. In the above scenario, it seems that the line items attempted to save these incorrectly. Let us know if you find additional examples and we can attempt to work around these.

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

No branches or pull requests

2 participants