Run Batch Process with Oauth2.0_token

825 Views Asked by At

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)
0

There are 0 best solutions below