Permissions.grantApiAccess

From Facebook Developers Wiki

Jump to: navigation, search

Contents

[edit] Description

This method gives another application access to certain API calls on behalf of the application calling it. The application granted access is specified by permissions_apikey. Which methods or namespaces can be called are specified in method_arr.

Currently, the methods that can be called by an application on behalf of another are:

The only namespace that can be granted access at this time is admin.


[edit] Parameters

RequiredNameTypeDescription
required api_key string The application key associated with the calling application.
sig string An MD5 hash of the current request and your secret key, as described in the How Facebook Authenticates Your Application.
v string This must be set to 1.0 to use this version of the API.
permissions_apikey string The API key for the application that is being granted access.
optional method_arr json array The JSON array of methods and/or namespaces for which the access is granted. If this is not specified, access to all allowed methods is granted.


[edit] Example Requests

Example Call Using the PHP Library $ret = $facebook->api_client->permissions_grantApiAccess(<permissions-api-key>, array(‘admin.’));


[edit] Example Return XML

<?xml version="1.0" encoding="UTF-8"?> <permissions_grantApiAccess_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/http://api.facebook.com/1.0/facebook.xsd"> 1 </permissions_grantApiAccess_response>


[edit] Response

The method returns a bool value indicating whether the call succeeded or failed.


[edit] Error Codes

CodeDescription
1 An unknown error occurred. Please resubmit the request.
2 The service is not available at this time.
4 The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed.
5 The request came from a remote address not allowed by this application.
101 The API key submitted is not associated with any known application.
104 Incorrect signature.


[edit] Notes

  • This method does not require a session_key or call_id. However, specifying a call_id does not cause any problems.
  • Desktop applications cannot call this method.