Methods Summary |
---|
public java.lang.String | auth_createToken()Call this function and store the result, using it to generate the
appropriate login url and then to retrieve the session information.
|
public java.lang.String | auth_getSession(java.lang.String authToken)Call this function to retrieve the session information after your user has
logged in.
|
public long | auth_getUserId(java.lang.String authToken)Call this function to get the user ID.
|
public java.lang.String | data_getUserPreference(java.lang.Integer prefId)Lookup a single preference value for the current user.
|
public java.util.Map | data_getUserPreferences()Get a map containing all preference values set for the current user.
|
public void | data_setUserPreference(java.lang.Integer prefId, java.lang.String value)Set a user-preference value. The value can be any string up to 127 characters in length,
while the preference id can only be an integer between 0 and 200. Any preference set applies
only to the current user of the application.
To clear a user-preference, specify null as the value parameter. The values of "0" and "" will
be stored as user-preferences with a literal value of "0" and "" respectively.
|
public void | data_setUserPreferences(java.util.Map values, boolean replace)Set multiple user-preferences values. The values can be strings up to 127 characters in length,
while the preference id can only be an integer between 0 and 200. Any preferences set apply
only to the current user of the application.
To clear a user-preference, specify null as its value in the map. The values of "0" and "" will
be stored as user-preferences with a literal value of "0" and "" respectively.
|
public T | events_get(java.lang.Long userId, java.util.Collection eventIds, java.lang.Long startTime, java.lang.Long endTime)Returns all visible events according to the filters specified. This may be used to find all events of a user, or to query specific eids.
|
public T | events_getMembers(java.lang.Number eventId)Retrieves the membership list of an event
|
public boolean | fbml_refreshImgSrc(java.net.URL imageUrl)Recaches the image with the specified imageUrl.
|
public boolean | fbml_refreshImgSrc(java.lang.String imageUrl)Recaches the image with the specified imageUrl.
|
public boolean | fbml_refreshRefUrl(java.lang.String url)Recaches the referenced url.
|
public boolean | fbml_refreshRefUrl(java.net.URL url)Recaches the referenced url.
|
public void | fbml_setRefHandle(java.lang.String handle, java.lang.String markup)Associates the specified FBML markup with the specified handle/id. The markup can then be referenced using the fb:ref FBML
tag, to allow a given snippet to be reused easily across multiple users, and also to allow the application to update
the fbml for multiple users more easily without having to make a seperate call for each user, by just changing the FBML
markup that is associated with the handle/id.
|
public boolean | feed_PublishTemplatizedAction(com.facebook.api.TemplatizedAction action)Publishes a templatized action for the current user. The action will appear in their minifeed,
and may appear in their friends' newsfeeds depending upon a number of different factors. When
a template match exists between multiple distinct users (like "Bob recommends Bizou" and "Sally
recommends Bizou"), the feed entries may be combined in the newfeed (to something like "Bob and sally
recommend Bizou"). This happens automatically, and *only* if the template match between the two
feed entries is identical.
Feed entries are not aggregated for a single user (so "Bob recommends Bizou" and "Bob recommends Le
Charm" *will not* become "Bob recommends Bizou and Le Charm").
If the user's action involves one or more of their friends, list them in the 'targetIds' parameter.
For example, if you have "Bob says hi to Sally and Susie", and Sally's UID is 1, and Susie's UID is 2,
then pass a 'targetIds' paramters of "1,2". If you pass this parameter, you can use the "{target}" token
in your templates. Probably it also makes it more likely that Sally and Susie will see the feed entry
in their newsfeed, relative to any other friends Bob might have. It may be a good idea to always send
a list of all the user's friends, and avoid using the "{target}" token, to maximize distribution of the
story through the newsfeed.
The only strictly required parameter is 'titleTemplate', which must contain the "{actor}" token somewhere
inside of it. All other parameters, options, and tokens are optional, and my be set to null if
being omitted.
Not that stories will only be aggregated if *all* templates match and *all* template parameters match, so
if two entries have the same templateTitle and titleData, but a different bodyTemplate, they will not
aggregate. Probably it's better to use bodyGeneral instead of bodyTemplate, for the extra flexibility
it provides.
Note that this method is replacing 'feed_publishActionOfUser', which has been deprecated by Facebook.
For specific details, visit http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction
|
public boolean | feed_publishActionOfUser(java.lang.CharSequence title, java.lang.CharSequence body, java.util.Collection images)Publish the notification of an action taken by a user to newsfeed.
|
public boolean | feed_publishActionOfUser(java.lang.CharSequence title, java.lang.CharSequence body)Publish the notification of an action taken by a user to newsfeed.
|
public boolean | feed_publishStoryToUser(java.lang.CharSequence title, java.lang.CharSequence body, java.util.Collection images, java.lang.Integer priority)Publish a story to the logged-in user's newsfeed.
|
public boolean | feed_publishStoryToUser(java.lang.CharSequence title, java.lang.CharSequence body)Publish a story to the logged-in user's newsfeed.
|
public boolean | feed_publishStoryToUser(java.lang.CharSequence title, java.lang.CharSequence body, java.lang.Integer priority)Publish a story to the logged-in user's newsfeed.
|
public boolean | feed_publishStoryToUser(java.lang.CharSequence title, java.lang.CharSequence body, java.util.Collection images)Publish a story to the logged-in user's newsfeed.
|
public boolean | feed_publishTemplatizedAction(java.lang.Long actorId, java.lang.CharSequence titleTemplate)Publishes a Mini-Feed story describing an action taken by a user, and
publishes aggregating News Feed stories to the friends of that user.
Stories are identified as being combinable if they have matching templates and substituted values.
|
public boolean | feed_publishTemplatizedAction(java.lang.Long actorId, java.lang.CharSequence titleTemplate, java.util.Map titleData, java.lang.CharSequence bodyTemplate, java.util.Map bodyData, java.lang.CharSequence bodyGeneral, java.util.Collection targetIds, java.util.Collection images)Publishes a Mini-Feed story describing an action taken by a user, and
publishes aggregating News Feed stories to the friends of that user.
Stories are identified as being combinable if they have matching templates and substituted values.
|
public boolean | feed_publishTemplatizedAction(java.lang.String titleTemplate, java.lang.String titleData, java.lang.String bodyTemplate, java.lang.String bodyData, java.lang.String bodyGeneral, java.util.Collection pictures, java.lang.String targetIds)Publishes a templatized action for the current user. The action will appear in their minifeed,
and may appear in their friends' newsfeeds depending upon a number of different factors. When
a template match exists between multiple distinct users (like "Bob recommends Bizou" and "Sally
recommends Bizou"), the feed entries may be combined in the newfeed (to something like "Bob and sally
recommend Bizou"). This happens automatically, and *only* if the template match between the two
feed entries is identical.
Feed entries are not aggregated for a single user (so "Bob recommends Bizou" and "Bob recommends Le
Charm" *will not* become "Bob recommends Bizou and Le Charm").
If the user's action involves one or more of their friends, list them in the 'targetIds' parameter.
For example, if you have "Bob says hi to Sally and Susie", and Sally's UID is 1, and Susie's UID is 2,
then pass a 'targetIds' paramters of "1,2". If you pass this parameter, you can use the "{target}" token
in your templates. Probably it also makes it more likely that Sally and Susie will see the feed entry
in their newsfeed, relative to any other friends Bob might have. It may be a good idea to always send
a list of all the user's friends, and avoid using the "{target}" token, to maximize distribution of the
story through the newsfeed.
The only strictly required parameter is 'titleTemplate', which must contain the "{actor}" token somewhere
inside of it. All other parameters, options, and tokens are optional, and my be set to null if
being omitted.
Not that stories will only be aggregated if *all* templates match and *all* template parameters match, so
if two entries have the same templateTitle and titleData, but a different bodyTemplate, they will not
aggregate. Probably it's better to use bodyGeneral instead of bodyTemplate, for the extra flexibility
it provides.
Note that this method is replacing 'feed_publishActionOfUser', which has been deprecated by Facebook.
For specific details, visit http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction
|
public T | fql_query(java.lang.CharSequence query)Retrieves the results of a Facebook Query Language query
|
public T | friends_areFriends(long userId1, long userId2)Retrieves whether two users are friends.
|
public T | friends_areFriends(java.util.Collection userIds1, java.util.Collection userIds2)Retrieves whether pairs of users are friends.
Returns whether the first user in userIds1 is friends with the first user in
userIds2 , the second user in userIds1 is friends with the second user in
userIds2 , etc.
|
public T | friends_get()Retrieves the friends of the currently logged in user.
|
public T | friends_getAppUsers()Retrieves the friends of the currently logged in user, who are also users
of the calling application.
|
public java.lang.String | getRawResponse()Returns a string representation for the last API response recieved from Facebook, exactly as sent by the API server.
Note that calling this method consumes the data held in the internal buffer, and thus it may only be called once per API
call.
|
public java.lang.Object | getResponsePOJO()Returns a JAXB object of the type that corresponds to the last API call made on the client. Each
Facebook Platform API call that returns a Document object has a JAXB response object associated
with it. The naming convention is generally intuitive. For example, if you invoke the
'user_getInfo' API call, the associated JAXB response object is 'UsersGetInfoResponse'.
An example of how to use this method:
FacebookRestClient client = new FacebookRestClient("apiKey", "secretKey", "sessionId");
client.friends_get();
FriendsGetResponse response = (FriendsGetResponse)client.getResponsePOJO();
List friends = response.getUid();
This is particularly useful in the case of API calls that return a Document object, as working
with the JAXB response object is generally much simple than trying to walk/parse the DOM by
hand.
This method can be safely called multiple times, though note that it will only return the
response-object corresponding to the most recent Facebook Platform API call made.
Note that you must cast the return value of this method to the correct type in order to do anything
useful with it.
|
public T | groups_get(java.lang.Long userId, java.util.Collection groupIds)Retrieves the groups associated with a user
|
public T | groups_getMembers(java.lang.Number groupId)Retrieves the membership list of a group
|
public boolean | isDebug()Check to see if debug mode is enabled.
|
public boolean | isDesktop()Check to see if the client is running in desktop-app mode
|
public java.lang.Long | marketplace_createListing(java.lang.Boolean showOnProfile, com.facebook.api.MarketplaceListing attrs)Create a marketplace listing. The create_listing extended permission is required.
|
public java.lang.Long | marketplace_createListing(java.lang.Long listingId, boolean showOnProfile, java.lang.String attributes)Create a new marketplace listing, or modify an existing one.
|
public java.lang.Long | marketplace_createListing(java.lang.Long listingId, boolean showOnProfile, com.facebook.api.MarketListing listing)Create a new marketplace listing, or modify an existing one.
|
public java.lang.Long | marketplace_createListing(boolean showOnProfile, com.facebook.api.MarketListing listing)Create a new marketplace listing.
|
public java.lang.Long | marketplace_editListing(java.lang.Long listingId, java.lang.Boolean showOnProfile, com.facebook.api.MarketplaceListing attrs)Modify a marketplace listing. The create_listing extended permission is required.
|
public java.lang.Long | marketplace_editListing(java.lang.Long listingId, java.lang.Boolean showOnProfile, com.facebook.api.MarketListing attrs)Modify a marketplace listing
|
public java.util.List | marketplace_getCategories()Get the categories available in marketplace.
|
public T | marketplace_getCategoriesObject()Get the categories available in marketplace.
|
public T | marketplace_getListings(java.util.Collection listingIds, java.util.Collection userIds)Fetch marketplace listings, filtered by listing IDs and/or the posting users' IDs.
|
public java.util.List | marketplace_getListings(java.util.List listingIds, java.util.List uids)Retrieve listings from the marketplace. The listings can be filtered by listing-id or user-id (or both).
|
public T | marketplace_getSubCategories(java.lang.CharSequence category)Get the subcategories available for a category.
|
public java.util.List | marketplace_getSubCategories()Return a list of all valid Marketplace subcategories.
|
public boolean | marketplace_removeListing(java.lang.Long listingId)Remove a marketplace listing. The create_listing extended permission is required.
|
public boolean | marketplace_removeListing(java.lang.Long listingId, java.lang.CharSequence status)Remove a marketplace listing. The create_listing extended permission is required.
|
public boolean | marketplace_removeListing(java.lang.Long listingId, com.facebook.api.MarketListingStatus status)Remove a listing from the marketplace by id.
|
public T | marketplace_search(java.lang.CharSequence category, java.lang.CharSequence subCategory, java.lang.CharSequence query)Search for marketplace listings, optionally by category, subcategory, and/or query string.
|
public java.util.List | marketplace_search(com.facebook.api.MarketListingCategory category, com.facebook.api.MarketListingSubcategory subcategory, java.lang.String searchTerm)Search the marketplace listings by category, subcategory, and keyword.
|
public T | notifications_get()Retrieves the outstanding notifications for the session user.
|
public java.net.URL | notifications_send(java.util.Collection recipientIds, java.lang.CharSequence notification, java.lang.CharSequence email)Send a notification message to the specified users.
|
public boolean | photos_addTag(java.lang.Long photoId, java.lang.Long taggedUserId, java.lang.Double xPct, java.lang.Double yPct)Adds a tag to a photo.
|
public boolean | photos_addTag(java.lang.Long photoId, java.lang.CharSequence tagText, java.lang.Double xPct, java.lang.Double yPct)Adds a tag to a photo.
|
public T | photos_addTags(java.lang.Long photoId, java.util.Collection tags)Adds several tags to a photo.
|
public T | photos_createAlbum(java.lang.String albumName)Creates an album.
|
public T | photos_createAlbum(java.lang.String name, java.lang.String description, java.lang.String location)Creates an album.
|
public T | photos_get(java.lang.Long subjId, java.lang.Long albumId, java.util.Collection photoIds)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_get(java.lang.Long subjId, java.util.Collection photoIds)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_get(java.lang.Long subjId, java.lang.Long albumId)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_get(java.util.Collection photoIds)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_get(java.lang.Long subjId)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_getAlbums(java.lang.Long userId, java.util.Collection albumIds)Retrieves album metadata. Pass a user id and/or a list of album ids to specify the albums
to be retrieved (at least one must be provided)
|
public T | photos_getAlbums(java.lang.Long userId)Retrieves album metadata for albums owned by a user.
|
public T | photos_getAlbums(java.util.Collection albumIds)Retrieves album metadata for a list of album IDs.
|
public T | photos_getByAlbum(java.lang.Long albumId, java.util.Collection photoIds)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_getByAlbum(java.lang.Long albumId)Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
|
public T | photos_getTags(java.util.Collection photoIds)Retrieves the tags for the given set of photos.
|
public T | photos_upload(java.io.File photo)Uploads a photo to Facebook.
|
public T | photos_upload(java.io.File photo, java.lang.String caption)Uploads a photo to Facebook.
|
public T | photos_upload(java.io.File photo, java.lang.Long albumId)Uploads a photo to Facebook.
|
public T | photos_upload(java.io.File photo, java.lang.String caption, java.lang.Long albumId)Uploads a photo to Facebook.
|
public T | profile_getFBML(java.lang.Long userId)Gets the FBML for a user's profile, including the content for both the profile box
and the profile actions.
|
public boolean | profile_setFBML(java.lang.CharSequence fbmlMarkup, java.lang.Long userId)Sets the FBML for a user's profile, including the content for both the profile box
and the profile actions.
|
public void | setDebug(boolean isDebug)Toggle debug mode.
|
public void | setIsDesktop(boolean isDesktop)Set the client to run in desktop-app mode.
|
public boolean | sms_canSend()Check to see if the application is permitted to send SMS messages to the current application user.
|
public boolean | sms_canSend(java.lang.Long userId)Check to see if the application is permitted to send SMS messages to the specified user.
|
public java.lang.Integer | sms_send(java.lang.String message, java.lang.Integer smsSessionId, boolean makeNewSession)Send an SMS message to the current application user.
|
public java.lang.Integer | sms_send(java.lang.Long userId, java.lang.String message, java.lang.Integer smsSessionId, boolean makeNewSession)Send an SMS message to the specified user.
|
public boolean | users_clearStatus()Clears the logged-in user's Facebook status.
Requires the status_update extended permission.
|
public T | users_getInfo(java.util.Collection userIds, java.util.EnumSet fields)Retrieves the requested info fields for the requested set of users.
|
public T | users_getInfo(java.util.Collection userIds, java.util.Set fields)Retrieves the requested info fields for the requested set of users.
|
public long | users_getLoggedInUser()Retrieves the user ID of the user logged in to this API session
|
public boolean | users_hasAppPermission(java.lang.CharSequence permission)Retrieves whether the logged-in user has granted the specified permission to this application.
|
public boolean | users_hasAppPermission(com.facebook.api.Permission perm)Check to see if the user has granted the app a specific external permission. In order to be granted a
permission, an application must direct the user to a URL of the form:
http://www.facebook.com/authorize.php?api_key=[YOUR_API_KEY]&v=1.0&ext_perm=[PERMISSION NAME]
|
public boolean | users_isAppAdded()Retrieves an indicator of whether the logged-in user has added the
application associated with the _apiKey.
|
public boolean | users_setStatus(java.lang.String status)Sets the logged-in user's Facebook status.
Requires the status_update extended permission.
|
public boolean | users_setStatus(java.lang.String newStatus, boolean clear)Set the user's profile status message. This requires that the user has granted the application the
'status_update' permission, otherwise the call will return an error. You can use 'users_hasAppPermission'
to check to see if the user has granted your app the abbility to update their status.
|