KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've been trying to use oAuth in Google apps script to access trello data, but it seems that the OAuthService API makes some assumptions about the oAuth service and that trello doesn't work that way. The following code works. It get's access to twitter (this is from google's oauth tutorial): function authorizeToTwitter() { var oauthConfig = UrlFetchApp.addOAuthService("twitter"); oauthConfig.setAccessTokenUrl("https://api.twitter.com/oauth/access_token"); oauthConfig.setRequestTokenUrl("https://api.twitter.com/oauth/request_token"); oauthConfig.setAuthorizationUrl("https://api.twitter.com/oauth/authorize"); oauthConfig.setConsumerKey(<CONSUMER KEY>); oauthConfig.setConsumerSecret(<CONSUMER SECRET>); var requestData = { "method": "GET", "oAuthServiceName": "twitter", "oAuthUseToken": "always" }; var result = UrlFetchApp.fetch("https://api.twitter.com/1/statuses/mentions.json", requestData); } The following code will get me to the trello "press ok to get back" page, but trello doesn't know how to redirect back, so I get to a page that asks me to manually copy paste a token (but google doesn't provide me with a method of inserting that token) function authorizeToTrello() { var oauthConfig = UrlFetchApp.addOAuthService("trello"); oauthConfig.setAccessTokenUrl("https://trello.com/1/OAuthGetAccessToken"); oauthConfig.setRequestTokenUrl("https://trello.com/1/OAuthGetRequestToken"); oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken"); oauthConfig.setConsumerKey(<CONSUMER KEY>); oauthConfig.setConsumerSecret(<CONSUMER SECRET>); var requestData = { "method": "GET", "oAuthServiceName": "trello", "oAuthUseToken": "always" }; var result = UrlFetchApp.fetch( "https://api.trello.com/1/members/me/boards", requestData); } I t
Tags (comma-separated)
Save Edits
Cancel