Search code examples
rgoogle-apipassport-google-oauth

Connecting using RAdwords library and using doAuth gives error


I have been trying to connect to Adwords Account using RAdwords, but I get the following error on doAuth():

Error in rjson::fromJSON(RCurl::postForm("https://accounts.google.com/o/oauth2/token", : STRING_ELT() can only be applied to a 'character vector', not a 'raw'

I have the correct credentials and Developer's token, but I am still unable to resolve the problem. I am using windows 7. The traceback is as follows:

> traceback()
    4: .Call("fromJSON", json_str, unexpected.escape, simplify, PACKAGE = "rjson")
    3: rjson::fromJSON(RCurl::postForm("https://accounts.google.com/o/oauth2/token", 
       .opts = opts, code = credlist$c.token, client_id = credlist$c.id, 
       client_secret = credlist$c.secret, redirect_uri = "urn:ietf:wg:oauth:2.0:oob", 
       grant_type = "authorization_code", style = "POST"))
    2: loadToken(credentials)
    1: doAuth()

Looked and tried all options from other similar questions, e.g.: using suggestions), I have also installed this version of RAdwords.

install_github('jburkhardt/RAdwords', ref = "refresh_token_raw_data")

Solution

  • Install the RAdwords package from the following GitHub branch containing a bug fix for your issue:

    require(devtools)
    install_github('jburkhardt/RAdwords', ref = "bugfix_char_to_raw")