I authenticated and built my request and received a 403 response as Forbidden.
I am authenticated using httr example
# 1. Find OAuth settings for google: google <- oauth_endpoint(NULL, "auth", "token", base_url = "https://accounts.google.com/o/oauth2")
After authorization in the browser, the R-console prints "Full Authentication".
Request
query <- "https://www.googleapis.com/youtube/analytics/v1/reports? ids=channel%3D%3D{my channel id} &start-date=2013-01-01 &end-date=2013-07-31 &metrics=views &dimensions=day"
The token for authorization is transferred in the header as
token <- paste("Authorization: Bearer ",cred[[1]], sep="")
I tried the request using httr and RCurl
# RCurl api.response <- getURL(query, httpheader = token)
Api.response is unfortunately not very descriptive
{ "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Forbidden" } ], "code": 403, "message": "Forbidden" } }
I'm not sure where else to look and read the documentation.
source share