2016-07-11 20 views
-4

我正在開發一個使用podio網站數據的應用程序。在這裏,我的需要是將Podio API集成到我的應用程序中,並使用用戶憑證對應用程序進行身份驗證。Podio Integratioon

這是怎麼做到的? 請放一些示例代碼。 < < < 由於事先>>>>>

+3

我建議閱讀[旅遊]。 – yellowantphil

+0

*有太多可能的答案,或者對於這種格式,好的答案太長。請添加詳細信息以縮小答案集或隔離幾個段落中可以回答的問題。* – BSMP

回答

1

波迪奧具有良好的維護/詳細API documentation

波迪奧支持認證的四種不同的方式取決於你正在構建什麼樣的應用:

你可以得到的AUTH結構和示例代碼here

+0

我嘗試此muhammad身份驗證已完成,但我無法從podio獲取任何數據到我的應用程序中如何解決此問題 這是我的應用程序的身份驗證響應: 07-13 17:24:38.505 30397-30498/com.sermonseries V/response:>>>>>>>>>>>>>>>>>>> { 「的access_token」: 「4c0e0087dd524c9884db095cf3f9f94a」, 「expires_in」:28800 「token_type」: 「承載」, 「範圍」: 「全局:所有」, 「REF」:{ 「類型」: 「用戶」, 「ID」:2857528 },「refresh_token」:「4e41bae948854f8cb3c2dfe9acfc6042」} – NagaRaju

+0

Hi @NagaRaju,您需要從跑道中提取哪些數據? –

+0

我需要提取在我的podio帳戶中創建的應用程序信息的數據 – NagaRaju

0

對於使用應用程序進行身份驗證,我在Angular JS中編寫了此代碼。它很好地連接並驗證了API。

function apiService($http,$q){ 

var authEndPoint = 'https://podio.com/oauth/token?' 
var contactFormEndpoint = 'https://api.podio.com/item/app/' 

let YOUR_APP_ID = '*****'; 
let YOUR_PODIO_APP_ID = '******'; 
let YOUR_URL = 'http://localhost:9001'; 
let YOUR_APP_SECRET = '*******'; 
let YOUR_PODIO_APP_TOKEN = '**********'; 
let params = 'grant_type=app&app_id=' + YOUR_PODIO_APP_ID + '&app_token='         
YOUR_PODIO_APP_TOKEN + '&client_id=' + YOUR_APP_ID + '&redirect_uri=' + 
YOUR_URL + '&client_secret=' + YOUR_APP_SECRET; 



let access_token; 

var options = 
     { 
      "external_id": "itemID", 
      "fields": "fields", 
     }; 
var payload = 
     { 
     "name": "Mohammad", 
     "email": "[email protected]", 
     "your-message": "test", 
     "options":options   

     }; 
    payload = JSON.stringify(payload); 

// Promise-based API 
return { 
    auth : function() { 
    return $http.post(authEndPoint + params, { 
    cache: false, 

    }).then(function successCallback(response) { 
     access_token = response.data.access_token; 
     console.log("access t", access_token); 
     // let refresh_token = response.data.refresh_token; 
     // let token_type = response.data.token_type; 
     // let scope = response.data.scope; 
    }, function errorCallback(response) { 
     return access_token; 
    }); 

    }, 
    sendContactDetails: function() { 

     return $http.post(
     contactFormEndpoint + '******'+'/' ,payload, { 
     headers: { 
     'Authorization': 'oauth_token' + access_token 
     }, 
     }).then(function successCallback(response) { 

     console.log("sucess" + response); 
    }, 
    function errorCallback(response) { 
    console.log("failed" + response); 

    }) 

    } 
+0

謝謝你的回答Aalam可以在java或android中獲得這個代碼,並且還可以添加示例代碼來檢索從podio到android應用程序的數據 – NagaRaju