static
void
convert_simplexml_to_array
( $sxml)
Create the client.
FacebookRestClient
__construct
( $api_key, $secret, [string $session_key = null])
-
string
$session_key: if you haven't gotten a session key yet, leave this as null and then set it later by just directly accessing the $session_key member variable.
-
$api_key
-
$secret
Bans a list of users from the app. Banned users can't access the app's canvas page and forums.
bool
admin_banUsers
(array $uids)
-
array
$uids: an array of user ids
Returns the allocation limit value for a specified integration point name Integration point names are defined in lib/api/karma/constants.php in the limit_map.
int
&admin_getAllocation
(string $integration_point_name, [int $uid = null])
-
string
$integration_point_name: Name of an integration point (see developer wiki for list).
-
int
$uid: Specific user to check the limit.
Get the properties that you have set for an app.
array
admin_getAppProperties
(properties $properties)
-
properties
$properties: List of properties names to fetch
Gets the list of users that have been banned from the application.
$uids is an optional parameter that filters the result with the list of provided user ids. If $uids is provided, only banned user ids that are contained in $uids are returned.
bool
admin_getBannedUsers
([array $uids = null])
-
array
$uids: an array of user ids to filter by
Returns values for the specified metrics for the current application, in the given time range. The metrics are collected for fixed-length periods, and the times represent midnight at the end of each period.
array
&admin_getMetrics
(start_time $start_time, end_time $end_time, period $period, metrics $metrics)
-
start_time
$start_time: unix time for the start of the range
-
end_time
$end_time: unix time for the end of the range
-
period
$period: number of seconds in the desired period
-
metrics
$metrics: list of metrics to look up
Gets application restriction info.
Applications can restrict themselves to only a limited user demographic based on users' age and/or location or based on static predefined types specified by facebook for specifying diff age restriction for diff locations.
array
admin_getRestrictionInfo
()
Set properties for an app.
bool
admin_setAppProperties
(properties $properties)
-
properties
$properties: A map from property names to values
Sets application restriction info.
Applications can restrict themselves to only a limited user demographic based on users' age and/or location or based on static predefined types specified by facebook for specifying diff age restriction for diff locations.
bool
admin_setRestrictionInfo
([array $restriction_info = null])
-
array
$restriction_info: The age restriction settings to set.
Unban users that have been previously banned with admin_banUsers().
bool
admin_unbanUsers
(array $uids)
-
array
$uids: an array of user ids
Returns public information for an application (as shown in the application directory) by either application ID, API key, or canvas page name.
array
application_getPublicInfo
([int $application_id = null], [string $application_api_key = null], [string $application_canvas_name = null])
-
int
$application_id: (Optional) app id
-
string
$application_api_key: (Optional) api key
-
string
$application_canvas_name:
(Optional) canvas name
Exactly one argument must be specified, otherwise it is an error.
Creates an authentication token to be used as part of the desktop login flow. For more information, please see http://wiki.developers.facebook.com/index.php/Auth.createToken.
string
auth_createToken
()
Expires the session that is currently being used. If this call is successful, no further calls to the API (which require a session) can be made until a valid session is created.
bool
auth_expireSession
()
Get public key that is needed to verify digital signature an app may pass to other apps. The public key is only used by other apps for verification purposes.
string
auth_getAppPublicKey
(string $target_app_key)
-
string
$target_app_key: API key of an app
Returns the session information available after current user logs in.
array
auth_getSession
(string $auth_token, [bool $generate_session_secret = false])
-
string
$auth_token: the token returned by auth_createToken or passed back to your callback_url.
-
bool
$generate_session_secret: whether the session returned should include a session secret
Get a structure that can be passed to another app as proof of session. The other app can verify it using public key of this app.
signed
auth_getSignedPublicSessionData
()
Generates a session-specific secret. This is for integration with client-side API calls, such as the JS library.
array
auth_promoteSession
()
Revokes the user's agreement to the Facebook Terms of Service for your
application. If you call this method for one of your users, you will no longer be able to make API requests on their behalf until they again authorize your application. Use with care. Note that if this method is called without a user parameter, then it will revoke access for the current session's user.
bool
auth_revokeAuthorization
([int $uid = null])
-
int
$uid: (Optional) User to revoke
Revokes the given extended permission that the user granted at some prior time (for instance, offline_access or email). If no user is provided, it will be revoked for the user of the current session.
void
auth_revokeExtendedPermission
(string $perm, [int $uid = null])
-
string
$perm: The permission to revoke
-
int
$uid: The user for whom to revoke the permission.
Start a batch operation.
void
begin_batch
()
void
begin_permissions_mode
( $permissions_apikey)
Calls the specified normal POST method with the specified parameters.
mixed
&call_method
(string $method, [array $params = array()])
-
string
$method: Name of the Facebook method to invoke
-
array
$params: A map of param names => param values
Calls the specified file-upload POST method with the specified parameters
array
call_upload_method
(string $method, array $params, string $file, [ $server_addr = null])
-
string
$method: Name of the Facebook method to invoke
-
array
$params: A map of param names => param values
-
string
$file: A path to the file to upload (required)
-
$server_addr
Add a comment to a particular xid on behalf of a user. If called without an app_secret (with session secret), this will only work for the session user.
string
&comments_add
(string $xid, string $text, [int $uid = 0], [string $title = ''], [string $url = ''], [bool $publish_to_stream = false])
-
string
$xid: external id associated with the comments
-
string
$text: text of the comment
-
int
$uid: user adding the comment (def: session user)
-
string
$title: optional title for the stream story
-
string
$url: optional url for the stream story
-
bool
$publish_to_stream: publish a feed story about this comment? a link will be generated to title/url in the story
Gets the comments for a particular xid. This is essentially a wrapper around the comment FQL table.
array
&comments_get
(string $xid)
-
string
$xid: external id associated with the comments
Remove a particular comment.
boolean
&comments_remove
(string $xid, string $comment_id)
-
string
$xid: the external id associated with the comments
-
string
$comment_id: id of the comment to remove (returned by comments.add and comments.get)
Returns the number of unconnected friends that exist in this application.
This number is determined based on the accounts registered through connect.registerUsers() (see below).
void
connect_getUnconnectedFriendsCount
()
This method is used to create an association between an external user account and a Facebook user account, as per Facebook Connect.
This method takes an array of account data, including a required email_hash and optional account data. For each connected account, if the user exists, the information is added to the set of the user's connected accounts. If the user has already authorized the site, the connected account is added in the confirmed state. If the user has not yet authorized the site, the connected account is added in the pending state.
This is designed to help Facebook Connect recognize when two Facebook friends are both members of a external site, but perhaps are not aware of it. The Connect dialog (see fb:connect-form) is used when friends can be identified through these email hashes. See the following url for details:
http://wiki.developers.facebook.com/index.php/Connect.registerUsers
array
connect_registerUsers
(mixed $accounts)
-
mixed
$accounts: A (JSON-encoded) array of arrays, where each array has three properties: 'email_hash' (req) - public email hash of account 'account_id' (opt) - remote account id; 'account_url' (opt) - url to remote account;
Unregisters a set of accounts registered using connect.registerUsers.
array
connect_unregisterUsers
(array $email_hashes)
-
array
$email_hashes: The (JSON-encoded) list of email hashes to be unregistered.
void
convert_result
( $data, $method, $params)
void
convert_xml_to_result
( $xml, $method, $params)
execute a curl transaction -- this exists mostly so subclasses can add extra options and/or process the response, if they wish.
void
curl_exec
(resource $ch)
-
resource
$ch: a curl handle
Create a new object.
newly
&data_createObject
(obj_type $obj_type, [properties $properties = null])
-
obj_type
$obj_type: object type's name
-
properties
$properties: (optional) properties to set initially
Create a new object type.
void
&data_createObjectType
(name $name)
-
name
$name: object type's name
Define an object association.
void
&data_defineAssociation
(name $name, assoc_type $assoc_type, assoc_info1 $assoc_info1, assoc_info2 $assoc_info2, [inverse $inverse = null])
-
name
$name: name of this association
-
assoc_type
$assoc_type: 1: one-way 2: two-way symmetric 3: two-way asymmetric
-
assoc_info1
$assoc_info1: needed info about first object type
-
assoc_info2
$assoc_info2: needed info about second object type
-
inverse
$inverse: (optional) name of reverse association
Add a new property to an object type.
void
&data_defineObjectProperty
(obj_type $obj_type, prop_name $prop_name, prop_type $prop_type)
-
obj_type
$obj_type: object type's name
-
prop_name
$prop_name: name of the property to add
-
prop_type
$prop_type: 1: integer; 2: string; 3: text blob
Delete an existing object.
void
&data_deleteObject
(obj_id $obj_id)
-
obj_id
$obj_id: object's id
Delete a list of objects.
void
&data_deleteObjects
(obj_ids $obj_ids)
-
obj_ids
$obj_ids: objects to delete
Delete an object type.
void
&data_dropObjectType
(obj_type $obj_type)
-
obj_type
$obj_type: object type's name
Count associated objects.
associated
&data_getAssociatedObjectCount
(name $name, obj_id $obj_id)
-
name
$name: name of association
-
obj_id
$obj_id: who's association to retrieve
Get a list of associated object counts.
associated
&data_getAssociatedObjectCounts
(name $name, obj_ids $obj_ids)
-
name
$name: name of association
-
obj_ids
$obj_ids: whose association to retrieve
Retrieve a list of associated objects.
associated
&data_getAssociatedObjects
(name $name, obj_id $obj_id, [no_data $no_data = true])
-
name
$name: name of association
-
obj_id
$obj_id: who's association to retrieve
-
no_data
$no_data: only return object ids
Get definition of an object association.
specified
&data_getAssociationDefinition
(name $name)
-
name
$name: name of this association
Get definition of all associations.
all
&data_getAssociationDefinitions
()
Find all associations between two objects.
all
&data_getAssociations
(obj_id1 $obj_id1, obj_id2 $obj_id2, [no_data $no_data = true])
-
obj_id1
$obj_id1: id of first object
-
obj_id2
$obj_id2: id of second object
-
no_data
$no_data: only return association names without data
Returns cookies according to the filters specified.
array
data_getCookies
(int $uid, string $name)
-
int
$uid: User for which the cookies are needed.
-
string
$name: (Optional) A null parameter will get all cookies for the user.
Read hash value by key.
hash
&data_getHashValue
(obj_type $obj_type, key $key, [prop_name $prop_name = null])
-
obj_type
$obj_type: object type's name
-
key
$key: hash key
-
prop_name
$prop_name: (optional) individual property's name
Get properties of an object.
specified
&data_getObject
(obj_id $obj_id, [prop_names $prop_names = null])
-
obj_id
$obj_id: object's id
-
prop_names
$prop_names: (optional) properties to return; null for all.
Get a single property value of an object.
individual
&data_getObjectProperty
(obj_id $obj_id, prop_name $prop_name)
-
obj_id
$obj_id: object's id
-
prop_name
$prop_name: individual property's name
Get properties of a list of objects.
specified
&data_getObjects
(obj_ids $obj_ids, [prop_names $prop_names = null])
-
obj_ids
$obj_ids: object ids
-
prop_names
$prop_names: (optional) properties to return; null for all.
Get definitions of all properties of an object type.
pairs
&data_getObjectType
(obj_type $obj_type)
-
obj_type
$obj_type: object type's name
Retrieve a list of all object types that have defined for the application.
a
&data_getObjectTypes
()
Get a user preference.
preference's
&data_getUserPreference
(pref_id $pref_id, [uid $uid = null])
-
pref_id
$pref_id: preference identifier (0-200)
-
uid
$uid: the user id (defaults to current session user)
Get a user preference.
preference
&data_getUserPreferences
([uid $uid = null])
-
uid
$uid: the user id (defaults to current session user)
Increase a hash value by specified increment atomically.
incremented
&data_incHashValue
(obj_type $obj_type, key $key, prop_name $prop_name, [increment $increment = 1])
-
obj_type
$obj_type: object type's name
-
key
$key: hash key
-
prop_name
$prop_name: individual property's name
-
increment
$increment: (optional) default is 1
Remove associations between objects by specifying one object id.
void
&data_removeAssociatedObjects
(name $name, obj_id $obj_id)
-
name
$name: name of association
-
obj_id
$obj_id: who's association to remove
Remove an association between two objects.
void
&data_removeAssociation
(name $name, obj_id1 $obj_id1, obj_id2 $obj_id2)
-
name
$name: name of association
-
obj_id1
$obj_id1: id of first object
-
obj_id2
$obj_id2: id of second object
Remove associations between objects by specifying pairs of object ids.
void
&data_removeAssociations
(assocs $assocs, [name $name = null])
-
assocs
$assocs: associations to remove
-
name
$name: (optional) name of association
Remove a hash key and its values.
void
&data_removeHashKey
(obj_type $obj_type, key $key)
-
obj_type
$obj_type: object type's name
-
key
$key: hash key
Remove hash keys and their values.
void
&data_removeHashKeys
(obj_type $obj_type, keys $keys)
-
obj_type
$obj_type: object type's name
-
keys
$keys: hash keys
Rename an object association or aliases.
void
&data_renameAssociation
(name $name, new_name $new_name, [new_alias1 $new_alias1 = null], [new_alias2 $new_alias2 = null])
-
name
$name: name of this association
-
new_name
$new_name: (optional) new name of this association
-
new_alias1
$new_alias1: (optional) new alias for object type 1
-
new_alias2
$new_alias2: (optional) new alias for object type 2
Rename a previously defined property of an object type.
void
&data_renameObjectProperty
(obj_type $obj_type, prop_name $prop_name, new_name $new_name)
-
obj_type
$obj_type: object type's name
-
prop_name
$prop_name: name of the property to rename
-
new_name
$new_name: new name to use
Rename an object type.
void
&data_renameObjectType
(obj_type $obj_type, new_name $new_name)
-
obj_type
$obj_type: object type's name
-
new_name
$new_name: new object type's name
Create or modify an association between two objects.
void
&data_setAssociation
(name $name, obj_id1 $obj_id1, obj_id2 $obj_id2, [data $data = null], [assoc_time $assoc_time = null])
-
name
$name: name of association
-
obj_id1
$obj_id1: id of first object
-
obj_id2
$obj_id2: id of second object
-
data
$data: (optional) extra string data to store
-
assoc_time
$assoc_time: (optional) extra time data; default to creation time
Create or modify associations between objects.
void
&data_setAssociations
(assocs $assocs, [name $name = null])
-
assocs
$assocs: associations to set
-
name
$name: (optional) name of association
Sets cookies according to the params specified.
bool
data_setCookie
(int $uid, string $name, string $value, int $expires, string $path)
-
int
$uid: User for which the cookies are needed.
-
string
$name: Name of the cookie
-
string
$value: (Optional) if expires specified and is in the past
-
int
$expires: (Optional) Expiry time
-
string
$path: (Optional) Url path to associate with (default is /)
Write hash value by key.
void
&data_setHashValue
(obj_type $obj_type, key $key, value $value, [prop_name $prop_name = null])
-
obj_type
$obj_type: object type's name
-
key
$key: hash key
-
value
$value: hash value
-
prop_name
$prop_name: (optional) individual property's name
Set a single property value of an object.
void
&data_setObjectProperty
(obj_id $obj_id, prop_name $prop_name, prop_value $prop_value)
-
obj_id
$obj_id: object's id
-
prop_name
$prop_name: individual property's name
-
prop_value
$prop_value: new value to set
Set a user preference.
void
&data_setUserPreference
(pref_id $pref_id, value $value, [uid $uid = null])
-
pref_id
$pref_id: preference identifier (0-200)
-
value
$value: preferece's value
-
uid
$uid: the user id (defaults to current session user)
Set a user's all preferences for this application.
void
&data_setUserPreferences
(values $values, [replace $replace = false], [uid $uid = null])
-
values
$values: preferece values in an associative arrays
-
replace
$replace: whether to replace all existing preferences or merge into them.
-
uid
$uid: the user id (defaults to current session user)
Undefine an object association.
void
&data_undefineAssociation
(name $name)
-
name
$name: name of this association
Remove a previously defined property from an object type.
void
&data_undefineObjectProperty
(obj_type $obj_type, prop_name $prop_name)
-
obj_type
$obj_type: object type's name
-
prop_name
$prop_name: name of the property to remove
Update an existing object.
void
&data_updateObject
(obj_id $obj_id, properties $properties, [replace $replace = false])
-
obj_id
$obj_id: object's id
-
properties
$properties: new properties
-
replace
$replace: true for replacing existing properties; false for merging
void
end_permissions_mode
()
Cancels an event. Only works for events where application is the admin.
bool
&events_cancel
(int $eid, [string $cancel_message = ''])
-
int
$eid: event id
-
string
$cancel_message: (Optional) message to send to members of the event about why it is cancelled
Creates an event on behalf of the user is there is a session, otherwise on behalf of app. Successful creation guarantees app will be admin.
int
events_create
(assoc $event_info, [string $file = null])
-
string
$file: (Optional) filename of picture to set
-
assoc
$event_info: array $event_info json encoded event information
Edits an existing event. Only works for events where application is admin.
bool
events_edit
(int $eid, assoc $event_info, [string $file = null])
-
int
$eid: event id
-
string
$file: (Optional) filename of new picture to set
-
assoc
$event_info: array $event_info json encoded event information
Returns events according to the filters specified.
array
&events_get
([int $uid = null], [array/string $eids = null], [int $start_time = null], [int $end_time = null], [string $rsvp_status = null])
-
int
$uid: (Optional) User associated with events. A null parameter will default to the session user.
-
array/string
$eids: (Optional) Filter by these event ids. A null parameter will get all events for the user. (A csv list will work but is deprecated)
-
int
$start_time: (Optional) Filter with this unix time as lower bound. A null or zero parameter indicates no lower bound.
-
int
$end_time: (Optional) Filter with this UTC as upper bound. A null or zero parameter indicates no upper bound.
-
string
$rsvp_status: (Optional) Only show events where the given uid has this rsvp status. This only works if you have specified a value for $uid. Values are as in events.getMembers. Null indicates to ignore rsvp status when filtering.
Returns membership list data associated with an event.
array
&events_getMembers
(int $eid)
RSVPs the current user to this event.
bool
&events_rsvp
(int $eid, string $rsvp_status)
-
int
$eid: event id
-
string
$rsvp_status: 'attending', 'unsure', or 'declined'
Delete custom tags the application has registered. If $tag_names is null, all the application's custom tags will be deleted.
IMPORTANT: If your application has registered public tags that other applications may be using, don't delete those tags! Doing so can break the FBML ofapplications that are using them.
bool
&fbml_deleteCustomTags
([array $tag_names = null])
-
array
$tag_names: the names of the tags to delete (optinal)
Get the custom tags for an application. If $app_id is not specified, the calling app's tags are returned.
If $app_id is different from the id of the calling app, only the app's public tags are returned. The return value is an array of the same type as the $tags parameter of fbml_registerCustomTags().
mixed
&fbml_getCustomTags
([int $app_id = null])
-
int
$app_id: the application's id (optional)
Fetches and re-caches the image stored at the given URL, for use in images published to non-canvas pages via the API (for example, to user profiles via profile.setFBML, or to News Feed via feed.publishUserAction).
bool
&fbml_refreshImgSrc
(string $url)
-
string
$url: The absolute URL from which to refresh the image.
Fetches and re-caches the content stored at the given URL, for use in an fb:ref FBML tag.
bool
&fbml_refreshRefUrl
(string $url)
-
string
$url: The absolute URL from which to fetch content. This URL should be used in a fb:ref FBML tag.
Register custom tags for the application. Custom tags can be used to extend the set of tags available to applications in FBML markup.
Before you call this function, make sure you read the full documentation at
http://wiki.developers.facebook.com/index.php/Fbml.RegisterCustomTags
IMPORTANT: This function overwrites the values of existing tags if the names match. Use this function with care because it may break the FBML of any application that is using the existing version of the tags.
int
&fbml_registerCustomTags
(mixed $tags)
-
mixed
$tags: an array of tag objects (the full description is on the wiki page)
Associates a given "handle" with FBML markup so that the handle can be
used within the fb:ref FBML tag. A handle is unique within an application and allows an application to publish identical FBML to many user profiles and do subsequent updates without having to republish FBML on behalf of each user.
bool
&fbml_setRefHandle
(string $handle, string $fbml)
-
string
$handle: The handle to associate with the given FBML.
-
string
$fbml: The FBML to associate with the given handle.
Lets you insert text strings in their native language into the Facebook Translations database so they can be translated.
int
&fbml_uploadNativeStrings
(array $native_strings)
-
array
$native_strings: An array of maps, where each map has a 'text' field and a 'description' field.
Deactivates a previously registered template bundle.
bool
&feed_deactivateTemplateBundleByID
(string $template_bundle_id)
-
string
$template_bundle_id: The template bundle id
For the current user, retrieves stories generated by the user's friends while using this application. This can be used to easily create a "News Feed" like experience.
array
&feed_getAppFriendStories
()
Retrieves information about a specified template bundle previously registered by the requesting application.
array
&feed_getRegisteredTemplateBundleByID
(string $template_bundle_id)
-
string
$template_bundle_id: The template bundle id
Retrieves the full list of active template bundles registered by the requesting application.
array
&feed_getRegisteredTemplateBundles
()
This method is deprecated for calls made on behalf of users. This method works only for publishing stories on a Facebook Page that has installed your application. To publish stories to a user's profile, use feed.publishUserAction instead.
For more details on this call, please visit the wiki page:
http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction
void
&feed_publishTemplatizedAction
( $title_template, $title_data, $body_template, $body_data, $body_general, [ $image_1 = null], [ $image_1_link = null], [ $image_2 = null], [ $image_2_link = null], [ $image_3 = null], [ $image_3_link = null], [ $image_4 = null], [ $image_4_link = null], [ $target_ids = ''], [ $page_actor_id = null])
-
$title_template
-
$title_data
-
$body_template
-
$body_data
-
$body_general
-
$image_1
-
$image_1_link
-
$image_2
-
$image_2_link
-
$image_3
-
$image_3_link
-
$image_4
-
$image_4_link
-
$target_ids
-
$page_actor_id
Publishes a story on behalf of the user owning the session, using the specified template bundle. This method requires an active session key in order to be called.
The parameters to this method ($templata_data in particular) are somewhat involved. It's recommended you visit the wiki for details:
http://wiki.developers.facebook.com/index.php/Feed.publishUserAction
bool
&feed_publishUserAction
(int $template_bundle_id, array $template_data, [array $target_ids = ''], [string $body_general = ''], [int $story_size = FacebookRestClient::STORY_SIZE_ONE_LINE], [string $user_message = ''])
-
int
$template_bundle_id: A template bundle id previously registered
-
array
$template_data: See wiki article for syntax
-
array
$target_ids: (Optional) An array of friend uids of the user who shared in this action.
-
string
$body_general: (Optional) Additional markup that extends the body of a short story.
-
int
$story_size: (Optional) A story size (see above)
-
string
$user_message: (Optional) A user message for a short story.
Registers a template bundle. Template bundles are somewhat involved, so it's recommended you check out the wiki for more details:
http://wiki.developers.facebook.com/index.php/Feed.registerTemplateBundle
string
&feed_registerTemplateBundle
( $one_line_story_templates, [ $short_story_templates = array()], [ $full_story_template = null], [ $action_links = array()])
-
$one_line_story_templates
-
$short_story_templates
-
$full_story_template
-
$action_links
void
finalize_params
( $method, $params)
Makes a set of FQL queries in parallel. This method takes a dictionary
of FQL queries where the keys are names for the queries. Results from one query can be used within another query to fetch additional data. More info about FQL queries at http://wiki.developers.facebook.com/index.php/FQL
array
&fql_multiquery
(string $queries)
-
string
$queries: JSON-encoded dictionary of queries to evaluate
Makes an FQL query. This is a generalized way of accessing all the data in the API, as an alternative to most of the other method calls. More info at http://wiki.developers.facebook.com/index.php/FQL
array
&fql_query
(string $query)
-
string
$query: the query to evaluate
Returns whether or not pairs of users are friends.
Note that the Facebook friend relationship is symmetric.
array
&friends_areFriends
(array/string $uids1, array/string $uids2)
-
array/string
$uids1: list of ids (id_1, id_2,...) of some length X (csv is deprecated)
-
array/string
$uids2: list of ids (id_A, id_B,...) of SAME length X (csv is deprecated)
Returns the friends of the current session user.
array
&friends_get
([int $flid = null], [int $uid = null])
-
int
$flid: (Optional) Only return friends on this friend list.
-
int
$uid: (Optional) Return friends for this user.
Returns the friends of the session user, who are also users of the calling application.
array
&friends_getAppUsers
()
Returns the set of friend lists for the current session user.
array
&friends_getLists
()
Returns the mutual friends between the target uid and a source uid or the current session user.
array
&friends_getMutualFriends
(int $target_uid, [int $source_uid = null])
-
int
$target_uid: Target uid for which mutual friends will be found.
-
int
$source_uid: (optional) Source uid for which mutual friends will be found. If no source_uid is specified, source_id will default to the session user.
get the current response serialization format
string
getFormat
()
Returns groups according to the filters specified.
array
&groups_get
(int $uid, array/string $gids)
-
int
$uid: (Optional) User associated with groups. A null parameter will default to the session user.
-
array/string
$gids: (Optional) Array of group ids to query. A null parameter will get all groups for the user. (csv is deprecated)
Returns the membership list of a group.
array
&groups_getMembers
(int $gid)
Retrieves links posted by the given user.
array
&links_get
(int $uid, int $limit, [array $link_ids = null])
-
int
$uid: The user whose links you wish to retrieve
-
int
$limit: The maximimum number of links to retrieve
-
array
$link_ids: (Optional) Array of specific link IDs to retrieve by this user
Posts a link on Facebook.
bool
&links_post
(string $url, [string $comment = ''], [int $uid = null])
-
string
$url: URL/link you wish to post
-
string
$comment: (Optional) A comment about this link
-
int
$uid: (Optional) User ID that is posting this link; defaults to current session user
Create/modify a Marketplace listing for the loggedinuser.
int
marketplace_createListing
(int $listing_id, show_on_profile $show_on_profile, listing_attrs $attrs, [ $uid = null])
-
int
$listing_id: listing_id The id of a listing to be modified, 0 for a new listing.
-
show_on_profile
$show_on_profile: bool Should we show this listing on the user's profile
-
listing_attrs
$attrs: array An array of the listing data
-
$uid
Get all the marketplace categories.
array
marketplace_getCategories
()
Get listings by either listing_id or user.
array
marketplace_getListings
(listing_ids $listing_ids, uids $uids)
-
listing_ids
$listing_ids: An array of listing_ids (optional)
-
uids
$uids: An array of user ids (optional)
Get all the marketplace subcategories for a particular category.
array
marketplace_getSubCategories
(category $category)
-
category
$category: The category for which we are pulling subcategories
Remove a listing from Marketplace.
bool
marketplace_removeListing
(listing_id $listing_id, [status $status = 'DEFAULT'], [ $uid = null])
-
listing_id
$listing_id: The id of the listing to be removed
-
status
$status: 'SUCCESS', 'NOT_SUCCESS', or 'DEFAULT'
-
$uid
Search for Marketplace listings. All arguments are optional, though at least one must be filled out to retrieve results.
array
marketplace_search
(category $category, subcategory $subcategory, query $query)
-
category
$category: The category in which to search (optional)
-
subcategory
$subcategory: The subcategory in which to search (optional)
-
query
$query: A query string (optional)
Creates a note with the specified title and content.
int
¬es_create
(string $title, string $content, [int $uid = null])
-
string
$title: Title of the note.
-
string
$content: Content of the note.
-
int
$uid: (Optional) The user for whom you are creating a note; defaults to current session user
Deletes the specified note.
bool
¬es_delete
(int $note_id, [int $uid = null])
-
int
$note_id: ID of the note you wish to delete
-
int
$uid: (Optional) Owner of the note you wish to delete; defaults to current session user
Edits a note, replacing its title and contents with the title and contents specified.
bool
¬es_edit
(int $note_id, string $title, string $content, [int $uid = null])
-
int
$note_id: ID of the note you wish to edit
-
string
$title: Replacement title for the note
-
string
$content: Replacement content for the note
-
int
$uid: (Optional) Owner of the note you wish to edit; defaults to current session user
Retrieves all notes by a user. If note_ids are specified, retrieves only those specific notes by that user.
array
¬es_get
(int $uid, [array $note_ids = null])
-
int
$uid: User whose notes you wish to retrieve
-
array
$note_ids: (Optional) List of specific note IDs by this user to retrieve
Returns the outstanding notifications for the session user.
array
¬ifications_get
()
Sends a notification to the specified users.
A
¬ifications_send
( $to_ids, $notification, $type)
-
$to_ids
-
$notification
-
$type
Sends an email to the specified user of the application.
string
¬ifications_sendEmail
(array/string $recipients, string $subject, string $text, string $fbml)
-
array/string
$recipients: array of ids of the recipients (csv is deprecated)
-
string
$subject: subject of the email
-
string
$text: (plain text) body of the email
-
string
$fbml: fbml markup for an html version of the email
Returns the requested info fields for the requested set of pages.
array
&pages_getInfo
(array/string $page_ids, array/string $fields, int $uid, string $type)
-
array/string
$page_ids: an array of page ids (csv is deprecated)
-
array/string
$fields: an array of strings describing the info fields desired (csv is deprecated)
-
int
$uid: (Optional) limit results to pages of which this user is a fan.
-
string
$type: type limits results to a particular type of page.
Returns true if the given user is an admin for the passed page.
bool
&pages_isAdmin
(int $page_id, [int $uid = null])
-
int
$page_id: target page id
-
int
$uid: (Optional) user id (defaults to the logged-in user)
Returns whether or not the given page has added the application.
bool
&pages_isAppAdded
(int $page_id)
-
int
$page_id: target page id
Returns true if logged in user is a fan for the passed page.
bool
&pages_isFan
(int $page_id, [int $uid = null])
-
int
$page_id: target page id
-
int
$uid: user to compare. If empty, the logged in user.
void
payments_getOrderDetails
( $order_id)
void
payments_getOrders
( $status, $start_time, $end_time, [ $test_mode = false])
-
$status
-
$start_time
-
$end_time
-
$test_mode
Set Payments properties for an app.
true
payments_setProperties
(properties $properties)
-
properties
$properties: a map from property names to values
void
payments_updateOrder
( $order_id, $status, $params)
-
$order_id
-
$status
-
$params
are we currently queueing up calls for a batch?
void
pending_batch
()
Checks API-access granted to self by the specified application.
array
permissions_checkAvailableApiAccess
(string $permissions_apikey)
-
string
$permissions_apikey: Other application key
Checks API-access granted by self to the specified application.
array
permissions_checkGrantedApiAccess
(string $permissions_apikey)
-
string
$permissions_apikey: Other application key
Grant API-access to the specified methods/namespaces to the specified application.
array
permissions_grantApiAccess
(string $permissions_apikey, array(string) $method_arr)
-
string
$permissions_apikey: Other application key
-
array(string)
$method_arr: (Optional) API methods/namespaces allowed
Revoke API-access granted to the specified application.
bool
permissions_revokeApiAccess
(string $permissions_apikey)
-
string
$permissions_apikey: Other application key
Adds a tag with the given information to a photo. See the wiki for details:
http://wiki.developers.facebook.com/index.php/Photos.addTag
bool
&photos_addTag
(int $pid, int $tag_uid, string $tag_text, float $x, float $y, array $tags, [int $owner_uid = 0])
-
int
$pid: The ID of the photo to be tagged
-
int
$tag_uid: The ID of the user being tagged. You must specify either the $tag_uid or the $tag_text parameter (unless $tags is specified).
-
string
$tag_text: Some text identifying the person being tagged. You must specify either the $tag_uid or $tag_text parameter (unless $tags is specified).
-
float
$x: The horizontal position of the tag, as a percentage from 0 to 100, from the left of the photo.
-
float
$y: The vertical position of the tag, as a percentage from 0 to 100, from the top of the photo.
-
array
$tags: (Optional) An array of maps, where each map can contain the tag_uid, tag_text, x, and y parameters defined above. If specified, the individual arguments are ignored.
-
int
$owner_uid: (Optional) The user ID of the user whose photo you are tagging. If this parameter is not specified, then it defaults to the session user.
Creates and returns a new album owned by the specified user or the current session user.
array
&photos_createAlbum
(string $name, [string $description = ''], [string $location = ''], [string $visible = ''], [int $uid = 0])
-
string
$name: The name of the album.
-
string
$description: (Optional) A description of the album.
-
string
$location: (Optional) A description of the location.
-
string
$visible: (Optional) A privacy setting for the album. One of 'friends', 'friends-of-friends', 'networks', or 'everyone'. Default 'everyone'.
-
int
$uid: (Optional) User id for creating the album; if not specified, the session user is used.
Returns photos according to the filters specified.
array
&photos_get
(int $subj_id, int $aid, array/string $pids)
-
int
$subj_id: (Optional) Filter by uid of user tagged in the photos.
-
int
$aid: (Optional) Filter by an album, as returned by photos_getAlbums.
-
array/string
$pids:
(Optional) Restrict to an array of pids (csv is deprecated)
Note that at least one of these parameters needs to be specified, or an error is returned.
Returns the albums created by the given user.
an
&photos_getAlbums
(int $uid, string $aids)
-
int
$uid: (Optional) The uid of the user whose albums you want. A null will return the albums of the session user.
-
string
$aids:
(Optional) An array of aids to restrict the query. (csv is deprecated)
Note that at least one of the (uid, aids) parameters must be specified.
Returns the tags on all photos specified.
array
&photos_getTags
(string $pids)
-
string
$pids: A list of pids to query
Uploads a photo.
array
photos_upload
(string $file, [int $aid = null], [string $caption = null], [int $uid = null])
-
string
$file: The location of the photo on the local filesystem.
-
int
$aid: (Optional) The album into which to upload the photo.
-
string
$caption: (Optional) A caption for the photo.
-
int
$uid: uid (Optional) The user ID of the user whose photo you are uploading
void
post_request
( $method, $params)
Gets the FBML for the profile box that is currently set for a user's profile (your application set the FBML previously by calling the profile.setFBML method).
string
&profile_getFBML
([int $uid = null], [int $type = null])
-
int
$uid: (Optional) User id to lookup; defaults to session.
-
int
$type: (Optional) 1 for original style, 2 for profile_main boxes
Returns the specified user's application info section for the calling application. These info sections have either been set via a previous profile.setInfo call or by the user editing them directly.
array
&profile_getInfo
([int $uid = null])
-
int
$uid: (Optional) User id to lookup; defaults to session.
Returns the options associated with the specified info field for an application info section.
array
&profile_getInfoOptions
(string $field)
-
string
$field: The title of the field
Sets the FBML for the profile of the user attached to this session.
array
profile_setFBML
(string $markup, [int $uid = null], [string $profile = ''], [string $profile_action = ''], [string $mobile_profile = ''], [string $profile_main = ''])
-
string
$markup: The FBML that describes the profile presence of this app for the user
-
int
$uid: The user
-
string
$profile: Profile FBML
-
string
$profile_action: Profile action FBML (deprecated)
-
string
$mobile_profile: Mobile profile FBML
-
string
$profile_main: Main Tab profile FBML
Configures an application info section that the specified user can install on the Info tab of her profile. For details on the structure of an info field, please see:
http://wiki.developers.facebook.com/index.php/Profile.setInfo
bool
&profile_setInfo
(string $title, int $type, array $info_fields, [int $uid = null])
-
string
$title: Title / header of the info section
-
int
$type:
- for text-only, 5 for thumbnail views
-
array
$info_fields: An array of info fields. See wiki for details.
-
int
$uid: (Optional)
Specifies the objects for a field for an application info section. These options populate the typeahead for a thumbnail.
bool
profile_setInfoOptions
(string $field, array $options)
-
string
$field: The title of the field
-
array
$options: An array of items for a thumbnail, including 'label', 'link', and optionally 'image', 'description' and 'sublabel'
Change the response format
void
setFormat
(string $format)
-
string
$format: The response format (json, xml)
Set the default user id for methods that allow the caller to pass an uid parameter to identify the target user instead of a session key. This currently applies to the user preferences methods.
void
set_user
($uid $uid)
-
$uid
$uid: int the user id
Normally, if the cURL library/PHP extension is available, it is used for HTTP transactions. This allows that behavior to be overridden, falling back to a vanilla-PHP implementation even if cURL is installed.
void
set_use_curl_if_available
($use_curl_if_available $use_curl_if_available)
-
$use_curl_if_available
$use_curl_if_available: bool whether or not to use cURL if available
void
set_use_ssl_resources
([ $is_ssl = true])
Add a comment to a stream post
string
stream_addComment
($post_id $post_id, $comment $comment, [$uid $uid = null])
-
$post_id
$post_id: the post id
-
$comment
$comment: the comment text
-
$uid
$uid: the actor (defaults to session user)
Add a like to a stream post
bool
stream_addLike
($post_id $post_id, [$uid $uid = null])
-
$post_id
$post_id: the post id
-
$uid
$uid: the actor (defaults to session user)
Gets the stream on behalf of a user using a set of users. This call will return the latest $limit queries between $start_time and $end_time.
array(
&stream_get
([int $viewer_id = null], [array $source_ids = null], [int $start_time = 0], [int $end_time = 0], [int $limit = 30], [string $filter_key = ''], array $metadata)
-
int
$viewer_id: user making the call (def: session)
-
array
$source_ids: users/pages to look at (def: all connections)
-
int
$start_time: start time to look for stories (def: 1 day ago)
-
int
$end_time: end time to look for stories (def: now)
-
int
$limit: number of stories to attempt to fetch (def: 30)
-
string
$filter_key: key returned by stream.getFilters to fetch
-
array
$metadata: metadata to include with the return, allows requested metadata to be returned, such as profiles, albums, photo_tags
Gets the full comments given a post_id from stream.get or the stream FQL table. Initially, only a set of preview comments are returned because some posts can have many comments.
array
&stream_getComments
(string $post_id)
-
string
$post_id: id of the post to get comments for
Gets the filters (with relevant filter keys for stream.get) for a particular user. These filters are typical things like news feed, friend lists, networks. They can be used to filter the stream without complex queries to determine which ids belong in which groups.
array
&stream_getFilters
([int $uid = null])
-
int
$uid: user to get filters for
Publish a post to the user's stream.
string
stream_publish
($message $message, [$attachment $attachment = null], [$action $action_links = null], [$target_id $target_id = null], [$uid $uid = null])
-
$message
$message: the user's message
-
$attachment
$attachment: the post's attachment (optional)
-
$action
$action_links: links the post's action links (optional)
-
$target_id
$target_id: the user on whose wall the post will be posted (optional)
-
$uid
$uid: the actor (defaults to session user)
Remove a post from the user's stream.
Currently, you may only remove stories you application created.
bool
stream_remove
($post_id $post_id, [$uid $uid = null])
-
$post_id
$post_id: the post id
-
$uid
$uid: the actor (defaults to session user)
Remove a comment from a stream post
bool
stream_removeComment
($comment_id $comment_id, [$uid $uid = null])
-
$comment_id
$comment_id: the comment id
-
$uid
$uid: the actor (defaults to session user)
Remove a like from a stream post
bool
stream_removeLike
($post_id $post_id, [$uid $uid = null])
-
$post_id
$post_id: the post id
-
$uid
$uid: the actor (defaults to session user)
Returns the requested info fields for the requested set of users.
array
&users_getInfo
(array/string $uids, array/string $fields)
-
array/string
$uids: An array of user ids (csv is deprecated)
-
array/string
$fields: An array of info field names desired (csv is deprecated)
Returns the user corresponding to the current session object.
integer
&users_getLoggedInUser
()
Returns the requested info fields for the requested set of users. A session key must not be specified. Only data about users that have authorized your application will be returned.
Check the wiki for fields that can be queried through this API call. Data returned from here should not be used for rendering to application users, use users.getInfo instead, so that proper privacy rules will be applied.
array
&users_getStandardInfo
(array/string $uids, array/string $fields)
-
array/string
$uids: An array of user ids (csv is deprecated)
-
array/string
$fields: An array of info field names desired (csv is deprecated)
Returns 1 if the user has the specified permission, 0 otherwise.
http://wiki.developers.facebook.com/index.php/Users.hasAppPermission
integer
&users_hasAppPermission
( $ext_perm, [ $uid = null])
Returns whether or not the user corresponding to the current session object has the give the app basic authorization.
boolean
&users_isAppUser
([ $uid = null])
Returns whether or not the user corresponding to the current session object is verified by Facebook. See the documentation for Users.isVerified for details.
boolean
&users_isVerified
()
Sets the users' current status message. Message does NOT contain the word "is" , so make sure to include a verb.
Example: setStatus("is loving the API!") will produce the status "Luke is loving the API!"
boolean
&users_setStatus
(string $status, [int $uid = null], [bool $clear = false], [bool $status_includes_verb = true])
-
string
$status: text-only message to set
-
int
$uid: user to set for (defaults to the logged-in user)
-
bool
$clear: whether or not to clear the status, instead of setting it
-
bool
$status_includes_verb: if true, the word "is" will *not* be prepended to the status message
Returns an array with the video limitations imposed on the current session's associated user. Maximum length is measured in seconds; maximum size is measured in bytes.
array
&video_getUploadLimits
()
Uploads a video.
array
video_upload
(string $file, [string $title = null], [string $description = null])
-
string
$file: The location of the video on the local filesystem.
-
string
$title: (Optional) A title for the video. Titles over 65 characters in length will be truncated.
-
string
$description: (Optional) A description for the video.