嗨,我一直使用oDesk API很長一段時間,但現在我需要授權來獲取一些數據,但我無法弄清楚。這是我正在使用的代碼,並獲得oAuth錯誤。如果你知道什麼,你的幫助將會非常有用。谷歌腳本oAuth + Odesk API
function debug() {
var oAuthConfig = UrlFetchApp.addOAuthService("odeskapi");
oAuthConfig.setConsumerKey("xxxxxxxxxxxxxxxxxxxxxxxxxxxx");
oAuthConfig.setConsumerSecret("xxxxxxxxxxxx");
oAuthConfig.setRequestTokenUrl("https://www.odesk.com/api/auth/v1/oauth/token/request");
oAuthConfig.setAccessTokenUrl("https://www.odesk.com/api/auth/v1/oauth/token/access");
oAuthConfig.setAuthorizationUrl("https://www.odesk.com/services/api/auth");
var options = {
"method" : "GET",
"oAuthServiceName" : "odeskapi",
"oAuthUseToken" : "always"
};
var request = UrlFetchApp.fetch("https://www.odesk.com/api/profiles/v1/search/jobs.json", options);
}
什麼錯誤你好嗎?這是非常重要的分享 - 否則我們將不得不註冊oDesk API來獲取密鑰並運行此代碼! –
谷歌只是說「OAuth錯誤」。沒有更多的細節。即使我不知道如何檢查它發生了什麼。 – Max