Post

1 follower Follow
0
Avatar

Can't get the filters to work

Hi guys, i am having some issues with getting all items from my app using the new php client, my code looks like this:

<?php

ini_set('display_errors', '1');

require_once 'podio-php/PodioAPI.php';

Podio::$debug = true;

Podio::setup(CLIENT_ID, CLIENT_SECRET);

Podio::authenticate('app', array('app_id' => YOUR_APP_ID, 'app_token' => YOUR_APP_TOKEN));

try {

$item_collection = PodioItem::filter(2382740);

} catch (PodioBadRequestError $e) {

var_dump($e);

}

print $item_collection['total']; // The total amount of items in the app

print $item_collection['filtered']; // Number of items matching the current filter

print_r($item_collection['items']); // Array of PodioItem instances

and it gives me:

Invalid value []: Must be Mapping (at body)

Carl Cedergren Answered

Please sign in to leave a comment.

1 comment

0
Avatar

I had a problem in the client (it was generating an empty array for the body instead of an empty object). It's all fixed now if you pull a fresh version of the client. Sorry about that.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink