banboo-data / RBingAds

R API wrapper for the Bing Ads API
Other
2 stars 0 forks source link

redirect_uri not valid #29

Open ReinhardSchmidbauer opened 1 year ago

ReinhardSchmidbauer commented 1 year ago

Hello,

I have a problem with the redirect_uri. After entering the client_id, client_secret and developer_token I was not redirected to the URL with code but I get the following error message:

"invalid_request: The specified value for the input parameter 'redirect_uri' is not valid. The expected value is a URI that matches a redirect URI registered for this client application."

This is the URL where I am redirected to: https://login.live.com/oauth20_authorize.srf?client_id=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx&scope=bingads.manage&response_type=code&redirect_uri=http://localhost&state=ClientStateGoesHere

This is the code I have used:

library(RBingAds)
bing_auth <- authenticate(save = T,
                           path = "/bi_ge/scripts/bing/.bingauth",
                           gitignore = T)
data <- load_bing_data(bing_auth = bing_auth,
                       account_id = "xxxxxxxx",
                       report = "CampaignPerformanceReport",
                       columns = c("AccountName", "CampaignName",
                                   "TimePeriod", "Impressions",
                                   "Clicks", "Spend", "Conversions"),
                       start = "2023-01-01",
                       end = `"2023-01-31")
────────────────────────────── Session info ──────────────────────────────
 setting  value
 version  R version 3.5.2 (2018-12-20)
 os       Debian GNU/Linux 10 (buster)
 system   x86_64, linux-gnu
 ui       RStudio
 language (EN)
 collate  de_DE.UTF-8
 ctype    de_DE.UTF-8
 tz       Europe/Berlin
 date     2023-07-04

Can you please help me? Thanks in advance!