1

I am trying to connect to the Instagram API using R and want my code to run as a batch process on an Ubuntu server. Currently, I am using oauth2.0_token and running into an error when it needs to connect to the browser for authentication.

When I try to connect to the API on the server, I get this message

Waiting for authentication in browser...
Press Esc/Ctrl + C to abort

What would be a way to get around this? Or is there a better way to connect to the Instagram API?

Here is an example of the code I am currently using that is producing the error

app_name <- 'Testing'
client_id <- 'XXXXXXX'
client_secret <- 'XXXXXXX'
scope = 'basic'

instagram <- oauth_endpoint(
authorize = "https://api.instagram.com/oauth/authorize",
access = "https://api.instagram.com/oauth/access_token")
myapp <- oauth_app(app_name, client_id, client_secret)

ig_oauth <- ?oauth2.0_token(instagram, myapp,scope="basic",  
                       type = "application/x-www-form-urlencoded",cache=FALSE)
sam_eman
  • 23
  • 4
  • 1
    Please provide [a reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) of your code that produces this message. – Thomas Nov 20 '14 at 16:34
  • Hmm, if you are logging in via shell to a remote server, I imagine that won't work as it would need you an interactive component, right @Thomas ? Do they support a personal access token authentication scheme? If so, you could pass that in the request – sckott Nov 20 '14 at 18:21
  • 1
    Either cache, or use out-of-band (oob) auth. – hadley Nov 20 '14 at 23:47

0 Answers0