Connect multiple apps.
I am using the PHP Client Library to connect my wordpress site to Podio. How do I connect multiple apps at the same time? I have data stored in several apps and I need to get the data from all the apps to display on the page. Can anyone please help me with this.
Thank you.
-
Hi Indika,
You'll have to reset the authentication between fetching from the apps.
# prepare client
Podio::setup($client_id, $client_secret);
# fetch data for app_a
Podio::authenticate_with_app($app_a_id, $app_a_token);
$items_a = PodioItem::filter($app_a_id);
print "app A: ".count($items_a)."\n";
# reset Auth stuff
Podio::clear_authentication();
# fetch data for app_b
Podio::authenticate_with_app($app_b_id, $app_b_token);
$items_b = PodioItem::filter($app_b_id);
print "app B: ".count($items_b)."\n";This will print out the respective counts for both apps. Of course you can be a bit more clever on when to reset the auth in a real application.
Cheers,
Brian
Please sign in to leave a comment.
Comments
1 comment