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

Posting a line item that was received from the API causes an error #107

Open
scottmartinnet opened this issue Jun 15, 2016 · 2 comments
Open
Assignees

Comments

@scottmartinnet
Copy link
Contributor

Issue Type: Bug

Description:
When handling a line item, receiving data from the API and then attempting to save that item back to the API causes errors.

Expected Result:
An example of a requested line item:

id: 5fmcj
deleted: false
created_at: 2016-06-14 15:36:09.000000000 Z
updated_at: 2016-06-14 15:36:10.000000000 Z
name: Untitled
campaign_id: 58ctu
advertiser_domain:
categories: []
charge_by: ENGAGEMENT
include_sentiment: POSITIVE_ONLY
objective: TWEET_ENGAGEMENTS
optimization: DEFAULT
paused: true
primary_web_event_tag:
product_type: PROMOTED_TWEETS
placements:
- ALL_ON_TWITTER
bid_unit: ENGAGEMENT
automatically_select_bid: true
bid_amount_local_micro:
total_budget_amount_local_micro:
advertiser_user_id: 1115726696
bid_type: AUTO
tracking_tags: []

I'd expect that sending this data back to the API would not cause an error.

Actual Result:
When a line item is requested, I receive data that causes errors went saved back to the API.
But when saving the line item, two items cause errors:

  • Sending both automatically_set_bid and bid_type produces the error "automatically_select_bid and bid_type are exclusive parameters".
  • Sending advertiser_user_id produces the error "setting advertiser_user_id is not allowed".

Steps to Reproduce:
This line of Ruby code should reproduce the error when populated with the appropriate variables:

TwitterAds::Account.load(client, account_id).line_items(line_item_id).save

I've implemented a workaround in my private fork that simply excludes these parameters from being sent. I don't see an automated way to know whether the advertiser_user_id parameter is allowed, so I universally excluded it. But I think the real fix lies inside the actual API, to allow a bid_type of AUTO when automatically_set_bid is true, and to only allow the advertiser_user_id sent by the API (which appears to be implicitly set to the user_id of the account being used.

scottmartinnet pushed a commit to peoplepattern/twitter-ruby-ads-sdk that referenced this issue Jun 15, 2016
@kambayashia
Copy link
Contributor

👍

kambayashia pushed a commit to kambayashia/twitter-ruby-ads-sdk that referenced this issue Sep 23, 2016
kambayashia added a commit to kambayashia/twitter-ruby-ads-sdk that referenced this issue Sep 23, 2016
kambayashia pushed a commit to kambayashia/twitter-ruby-ads-sdk that referenced this issue Sep 28, 2016
kambayashia added a commit to kambayashia/twitter-ruby-ads-sdk that referenced this issue Sep 28, 2016
@kambayashia kambayashia mentioned this issue Sep 28, 2016
3 tasks
esakai added a commit to esakai/twitter-ruby-ads-sdk that referenced this issue Dec 7, 2017
xdevplatform#107

This patch of code has been incoprated from
kamabayashia/twitter-ruby-ads-sdk.
esakai added a commit to esakai/twitter-ruby-ads-sdk that referenced this issue Dec 8, 2017
xdevplatform#107

This patch of code has been incoprated from
kamabayashia/twitter-ruby-ads-sdk.
esakai added a commit to esakai/twitter-ruby-ads-sdk that referenced this issue Dec 8, 2017
xdevplatform#107

This patch of code has been incoprated from
kamabayashia/twitter-ruby-ads-sdk.
esakai added a commit to esakai/twitter-ruby-ads-sdk that referenced this issue Dec 11, 2017
xdevplatform#107

This patch of code has been incoprated from
kamabayashia/twitter-ruby-ads-sdk.
@smaeda-ks smaeda-ks self-assigned this Jul 31, 2019
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

4 participants
@kambayashia @scottmartinnet @smaeda-ks and others