Hi @JBabichJapan,
This is what I tried, with no success, I am using the credential associated with the app I created, and my app was listed for ads API, I can get it working through Twurl, but not in R.
my code:
library(twitteR)
library(ROAuth)
library(RCurl)
library(parsedate)
library(BBmisc)
library(httr)
appname <- “xxxxx”
api_key <- “xxxxxxx”
api_secret <- “xxxxxxxx”
access_token <- “xxxxxxx”
access_secret <- “xxxxxx”
account_id <- “xxxxxxx”
setup_twitter_oauth(api_key,api_secret, access_token, access_secret)
campaign_id <- itostr(18257572,base=36)
reach_campaign.request <- GET(“https://ads-api.twitter.com/1/stats/accounts/xxxxxxx/reach/campaigns?start_time=2018-06-10T00:00:00+01:00Z&campaign_ids=xxxxx&end_time=2018-06-15T00:00:00+01:00Z”,
query = list(granularity = “DAY”,
metric_groups = “ENGAGEMENT”,
placement = “ALL_ON_TWITTER”),
accept_json(),
config(token = access_secret))
Any ideas?
Thanks,
Gld_data_team