I’m building a whole family of applications, and I’m writing an additional one for myself that is going to aggregate all of the daily metrics and allocations from its siblings into one convenient place. How can I have one app gather stats for another?
(How’s that for a contrived example? There aren’t many times when you’ll need these calls otherwise, but maybe you have more imagination than I do.)
The Permissions API, which was still in beta at the time of this
writing, enables you to grant and revoke permissions for one app to
Admin methods on behalf
of another app. The three available methods are:
You’ll need to know the API key of the application you’re
granting permissions to. You can grant on the
Admin namespace in general if you want to
give permission to call any of the methods:
$permissions = array('admin.'); $result = $facebook->api_client->permissions_grantApiAccess ('456eaf416a25820f18568b7cb0848c3c', $permissions);
That would grant permission for my Super Disco Napping app to have access to your stuff, which I highly recommend you do so that I can sneak peaks at what’s going on. If you decided you wanted to limit me to getting just allocations and metrics, you could modify the call to narrow the permissions:
$permissions = ...