Post

1 follower Follow
1
Avatar

Google Maps API

I love Podio, but I must say it's probably the worst API documentation and tutorials I've ever seen.

I've been trying to pull items out of an app to plot in into a Google Maps (pretty much exactly like this example: https://github.com/podio/sample-gmap) but have so far to just authenticate correctly, let alone pull data. 

A few more tutorials and/or example codes would be helpful. It seems that the entire Podio Development effort is dead and long gone. 

Daniel Karpantschof Answered

Please sign in to leave a comment.

9 comments

0
Avatar

Indeed I have. 

I'm not a pro developer, but accustomed enough to build on other platforms (insert n00b comments here) – yet Podio's API is for some reason less accessible than any other thing I've seen to date.

Daniel Karpantschof 0 votes
0
Avatar

Which language are you using? We have clients for most languages where the OAuth2 part is already handled. That is much easier to start with if you are not comfortable with making HTTP requests.

Just saying that it is poor is not very constructive. It would help a lot if you:

a) wrote which language you are using

b) what you tried and what the error message is

Christian Holm 0 votes
0
Avatar

Oh, sorry! My bad.

PHP.

I tried authenticating to an app (see attached files)

Thanks :)

Daniel Karpantschof 0 votes
0
Avatar

Hi Daniel,

We have quite a bit of documentation available. The developer site has among other things tutorials on authentication that Christian linked to and an article on how to work with items that will be relevant if you want to place items on maps: https://developers.podio.com/examples/items

In addition the PHP client download comes with a ton of examples in the 'examples' folder: https://github.com/podio/podio-php/tree/master/examples

The sample-gmap repository you link to an 2 years old and many things have changed since then. There's a completely new PHP client library that is much easier to work with and I'm pretty sure there's a new Google Maps API as well. I wouldn't recommend looking as code that old for guidance. It's better if you stick to the developer site and the current release of the PHP client library.

As you can see it's very little Podio API work that's needed -- the examples I link to above will illustrate how to get a collection and work with the individual fields. That's all you need from the Podio side of things. I'll be removing the sample-gmap repository so others won't be confused about it.

We would love to hear specific suggestions about how to improve our documentation. It's hard to determine how to improve without knowing what you have tried, how it failed and your suggestion on how to make it better.

All the best,

Andreas 

Andreas Haugstrup Pedersen 0 votes
0
Avatar

Hi Andreas,

Thanks for helping out. Yeah the gmap example is pretty outdated.

I managed to authenticate properly and pull items through the filter call.

Using print_r($item_collection'), I end up with something along the following lines

Array ( [items] => Array ( [0] => PodioItem Object ( [\_attributes] => Array ( [item_id] => 32784523 [external_id] => [title] => Washington DC [link] => https://sandbox-network.podio.com/central-command/item/32784523 [rights] => Array ( [0] => add_task [1] => rate [2] => comment [3] => view [4] => add_conversation [5] => subscribe ) [initial_revision] => PodioItemRevision Object ( [__attributes] => Array ( [revision] => [created_on] => 2013-02-05 20:39:14 [created_by] => PodioByLine Object ( [__attributes] => Array ( [type] => user [id] => 1131599 [avatar_type] => file [avatar_id] => 26485291 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => ..._

How do I select which fields to pull, so I won't end up with the whole dump?

Thanks a billion!

//D

Daniel Karpantschof 0 votes
0
Avatar

Hi Daniel,

As you can see the result is a hash with the 'items' key holding an array of PodioItem instances. So loop over that to get to each item. For each individual items the PodioItem class has a number of methods you can use. You can see a bunch of examples in the examples folder inside podio-php. Specifically https://github.com/podio/podio-php/blob/master/examples/items.php

Does that help?

/Andreas

Andreas Haugstrup Pedersen 0 votes
0
Avatar

Hi Andreas,

Gotcha! Thanks! I thought the filtered array would return all items in the same format as getitem.

How would you structure it to return all items in an app, with only specific fields returned?

//D

Daniel Karpantschof 0 votes
0
Avatar

You always get all fields returned for each item. You can see in the examples I linked to how to easily get the value of specific fields using the ->field() method (starts on line 27)

Andreas Haugstrup Pedersen 0 votes