xdevplatform/twitter-ruby-ads-sdk

Analytics#check_async_job_status takes a jobs_id param, not a job_id param

Closed this issue · 1 comments

Issue Type: Bug

Description: Per documentation at https://dev.twitter.com/ads/reference/1/get/stats/jobs/accounts/account_id, checking an analytics job's status takes an optional job_ids param, but the existing code submits a job_id param (no "s") which then gets ignored

Expected Result:

job1 = TwitterAds::OrganicTweet.create_async_job(
  ads_account,
  tweet_ids,
  metric_groups,
  args
)

job2 = TwitterAds::OrganicTweet.create_async_job(
  ads_account,
  tweet_ids,
  metric_groups,
  args
)

TwitterAds::OrganicTweet.check_async_job_status(
  ads_account,
  job_id: job1["id"]
)

=> #<TwitterAds::Cursor:0x70254933460400 count=1 fetched=1 exhausted=true>

Actual Result:

=> #<TwitterAds::Cursor:0x70254933460400 count=2 fetched=2 exhausted=true>

Steps to Reproduce:

  • create 2 async analytics jobs
  • check the status of only the first job using the job_id param
  • notice that statuses for both jobs are returned

fixed by #147