Question

i have a problem with my google script to request to Bitbucket API with oAuth

Here is my code :

  var consumerKey = '***';
  var consumerSecret = '***';
  var request_token_url = 'https://bitbucket.org/!api/1.0/oauth/request_token';
  var acces_token_url = 'https://bitbucket.org/!api/1.0/oauth/access_token';
  var authorize_url = 'https://bitbucket.org/!api/1.0/oauth/authenticate';
  var oauthConfig = UrlFetchApp.addOAuthService('bitbucket');
  oauthConfig.setConsumerKey(consumerKey);
  oauthConfig.setConsumerSecret(consumerSecret);
  oauthConfig.setAccessTokenUrl(acces_token_url);
  oauthConfig.setRequestTokenUrl(request_token_url);
  oauthConfig.setAuthorizationUrl(authorize_url);

  var options = {
    'oAuthServiceName' : 'bitbucket',
    'oAuthUseToken' : 'always'
  };
  var url = 'https://bitbucket.org/api/1.0/repositories/MYURL';

The error is : error - oAuth error

Thanks

Was it helpful?

Solution

I think the exclamation marks in your oauth URLs should not be there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top