xdevplatform / twitter-ruby-ads-sdk

A Twitter supported and maintained Ads API SDK for Ruby.
https://twitterdev.github.io/twitter-ruby-ads-sdk/
MIT License
67 stars 71 forks source link

TwitterAds::NotAuthorized when PUT accounts/:account_id/cards/website/:card_id #227

Closed koki-miyazaki closed 4 years ago

koki-miyazaki commented 4 years ago

Issue Type: Bug

Description: twitter-ruby-ads-sdk v7.0.0

there seems to be some bug in the SDK that we cannot add asterisk in parameter I tested in UI and postman and they allowed me to use asterisk in card name

TwitterAds::NotAuthorized (#<TwitterAds::NotAuthorized:0x47446210089440 code=401 details="[{:code=>"UNAUTHORIZED_ACCESS", :message=>"This request is not properly authenticated"}]">)

Expected Result:

ads_account = TwitterAds::Client.new(
  consumer_token,
  consumer_secret,
  ads_access_token,
  ads_access_secret,
).accounts(ads_account_id)

card = TwitterAds::Creative::WebsiteCard.load(ads_account, card_id)
card.name = 'test'
card.save # it does not raise error
card.name = 'test*'
card.save # it should not raise error

Actual Result:

ads_account = TwitterAds::Client.new(
  consumer_token,
  consumer_secret,
  ads_access_token,
  ads_access_secret,
).accounts(ads_account_id)

card = TwitterAds::Creative::WebsiteCard.load(ads_account, card_id)
card.name = 'test'
card.save # it does not raise error
card.name = 'test*'
card.save # it raise error
osowskit commented 4 years ago

Great catch. I've submitted a PR #229 that should resolve this.

osowskit commented 4 years ago

This should be fixed in the latest release. Thank you for reporting this.

koki-miyazaki commented 4 years ago

thanks @osowskit ! :)