0

I am using the latest PHP Podio library (4.0.1) and using PodioItem:get() to get an item from an app. I have found that I can retrieve the 'likes' (i.e. heart) ratings, but I cannot retrieve the voting ratings (e.g. five star or a custom vote I created). This seems to be a problem with newly created apps or adding rating fields to older apps. I can get the rating data from apps that have had the rating field for awhile, perhaps since before the 4.0 library change but not sure.

Besides the normal access attempts in code, I also tried printing out the ratings structure using a print_r and a var_dump and I am getting back no data other than the entries for the 'likes'.

Any thoughts as to why I can' retrieve this data as part of an item get() call?

aharkin
  • 15
  • 3

1 Answers1

0

podio-php don't have access to votes in the current release, but I've just added it to the library. So pull the latest dev version from github (4.0.2 is not good enough). The commit is here: https://github.com/podio/podio-php/commit/fd4f3d66307a26d0ecef961467e8aac47df759c7

Then you can request votes using the fields option like so:

$item = PodioItem::get($YOU_ITEM_ID, array('fields' => 'votes'));
var_dump($item->votes);
  • Loading the new library worked. Thanks.However, this seems to be using an undocumented 2nd parameter to the PodioItem::get() function. Is there more information on this, can one include other fields to extend the info returned? – aharkin Nov 17 '14 at 02:29
  • You can see how to use `fields` in the last section of https://developers.podio.com/index/api – Andreas Haugstrup Pedersen Nov 19 '14 at 23:25
  • Thanks. The filter one is useful. Just to clarify for others reading this, to do multiple fields for a filter it would look something like this `items.fields(files,votes,comments)` – aharkin Nov 22 '14 at 05:20