Post

21 followers Follow
15
Avatar

Has anyone tried integrating Google Spreadsheets with Podio? Yes!

This thread was also on the old API developer forum on Gougle Groups. ( https://groups.google.com/forum/?fromgroups#!topic/podio-api/lRYSiUxPs2w)

Still it needs an answer though.

Apparently the implementation of oAuth by Podio is different then Google Apps Script with oAuthConfig expects.

I managed to make a work around by implementing my own method in Apps Script to work with oAuth.

What it does, is it shows a flowpanel with a link to Podio. (function authenticate()) Using that link you can authenticate. If you grant access, you get redirected to a simple html-page that shows another link. (function doGet(e))

Using that link you return to your spreadsheet, but now authenticated.

I didn't get much further than that. I created a simple function to get some data out of an app and dump it in a spreadsheet. If you would want this code to work for yourself you would have to edit this function, to reference one of your own podio apps:

function podioApiTest()

In the end it would be far easier if Podio could play well with oAuthConfig.

The enitre Google script is attached.

Gijs van Dam

Please sign in to leave a comment.

15 comments

0
Avatar

I am also interested in this as i would like to manage my app items from a spreadsheet if possible

Zane Tootell 0 votes
0
Avatar

@Phil Any news on this? Once The Podio API plays nice with Google's  oAuthConfig, it'll be so easy to make cool stuff with Google Docs.

Gijs van Dam 0 votes
0
Avatar

I have made some small improvements, after initial setup with the link, the script will refresh its token when it gets a 401 status code. You can easily filter that out. 

Put your authentication token and refresh token in the Scriptproperties, and Google Apps is a damn easy way to get info out of Podio (and IN).

Callserver 0 votes
0
Avatar

Hi there,

I'm quite interested in seeing this podioAPITest() script code... it does not seem to be attached to this post?? Well I managed to authenticate the google script as follows:

function PODIOMakeComment() {

var options =
{
"method" : "post"
};

var result = UrlFetchApp.fetch("https://podio.com/oauth/token?grant_type=app&app_id=APPID&app_token=APPTOKEN&client_id=CLIENTID&redirect_uri=MYURL&client_secret=CLIENTSECRET",options);

Logger.log(result.getContentText());

var json = result.getContentText();
var data = JSON.parse(json);

}

But then trying to use data.access_token as the token in an API call such as this one to get comments from an item gives a http 403 error, and I'm not sure why:

var headers2 =
{
"Authorization": "OAuth2 "+data.access_token,
"Content-type": "application/json"
};

var url = "https://api.podio.com/comment/item/itemID/";

var options2 = {
//"contentType":"application/json",
"method": "get",
"headers": headers2
};
var response2 = UrlFetchApp.fetch(url,options2);

Anyone have some ideas on this?

Michal Nejthardt 0 votes