I'm currently using google scripts to upload an images to an imgur account. However, when I use this URL: https://api.imgur.com/oauth2/authorize?client_id=*clientID*&response_type=token I don't get a valid JSON response. When I paste it directly into the browser I go to the oAuth page. How do I avoid the oauth page and get a valid response when trying to get an access token.
function authorizeTokenGET () {
url = "https://api.imgur.com/oauth2/authorize?client_id="+clientID+"&response_type=token";
response = UrlFetchApp.fetch(url);
console.log(url);
console.log(JSON.parse(response))
}
The error: SyntaxError: Unexpected token < in JSON at position 0
(Yes I did register my application with the anonymous usage without user authorization option)