I would really appreciate some help here. I have a script with these functions:
function getOAuthService() {
return OAuth2.createService('Basecamp')
.setAuthorizationBaseUrl('https://launchpad.37signals.com/authorization/new')
.setTokenUrl('https://launchpad.37signals.com/authorization/token')
.setClientId('client_id')
.setClientSecret('secret')
.setCallbackFunction('authCallback')
.setPropertyStore(PropertiesService.getUserProperties())
.setScope('read')
.setParam('type', 'web_server')
.setRedirectUri('https://script.google.com/macros/d/SCRIPT_ID/usercallback');
}
function authorize() {
var basecampService = getOAuthService();
if (!basecampService.hasAccess()) {
var authorizationUrl = basecampService.getAuthorizationUrl();
Logger.log('Open the following URL and re-run the script: ' + authorizationUrl);
} else {
Logger.log('You are already authorized.');
}
}
The client_id, secret and script_id are actual ids and are legit. When I run the authorize() function I get the URL and open it and it takes me to the page where I can allow access and authorize. However, when I do, I just get this message:
Error: Error retrieving token: Unsupported type. Expected “web_server” or “refresh”. (line 605, file “Service”)
I have no idea why and can’t find a fix. Any ideas? Thanks!
I can’t really try a lot myself since I’m not a developer, just trying to do this to automate some stuff
Filip Spasic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.