...
message: The main body of the post, otherwise called the status message. Either
link
ormessage
must be supplied.link: The URL of a link to attach to the post. Either
link
ormessage
link
picture: Determines the preview image associated with the link.
name: Overwrites the title of the link preview.
caption: Overwrites the caption under the title in the link preview.
description: Overwrites the description in the link preview
actions: The action links attached to the post.
place: Page ID of a location associated with this post.
tags: Comma-separated list of user IDs of people tagged in this post. You cannot specify this field without also specifying a
place
privacy: Determines the privacy settings of the post. If not supplied, this defaults to the privacy level granted to the app in the Login Dialog. This field cannot be used to set a more open privacy setting than the one granted.
objectAttachment: Facebook ID for an existing picture in the person's photo albums to be used as the thumbnail image. The person must be the owner of the photo, and the photo cannot be part of a message attachment.
Anchor request request
Sample request
request | |
request |
Following is a sample REST request for the createPost method.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "apiUrl":"https://graph.facebook.com", "apiVersion":"v2.4", "accessToken":"CAACEdEose0cBAELbf7L36EFqHJktqfWa75sOC92i0PiZC13cEmvL4wb2b6Oaz7m7V46QydCUVPTgE7Ouxu35RloyVcrdmFnpvkyp0CJZCR0oAGc1wZAP9yN4a49O53PkA7z8QG5mJNfvKggggG8Xdbgcl1w72NMZC7L7SIqht40bmW4iAaXhTkFUO0ybOkcZD", "message":"This week is not over" } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<facebook.createUserAchievement> <achievement>{$ctx:achievement}</achievement> </facebook.createUserAchievement> |
Properties
achievement: Required - The unique URL of the type of achievement that the person will receive.
Sample request
Following is a sample REST request for the createUserAchievement method.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "apiUrl":"https://graph.facebook.com", "apiVersion":"v2.4", "accessToken":"CAACEdEose0cBAGlDzIRGv0KAopxqBhmSKgQTbfvnROAZAwZBPSnH7OpqVeEP9t4eZCpO2xbIdIZAI4g6MayNwIgk3R7t4xqX2atZAKfxqJS8UnacJJjthuAsnr8eI7pyOuLojRtdzH2zNFdwt7K1QeJgH6isCYpAFg2ZBY6r3MqDssgTQ7fES5zCrPpopr3S29wAKiz089MgZDZD", "achievement":"http://www.krishantha.com/fbtest.html" } |
...
achievement: Required - The unique URL of the type of achievement you want to delete.
Sample request
Following is a sample REST request for the deleteUserAchievement method.
...
userAId: The ID of this person's user account.
userBId: The ID of the user's selected friend.
Sample request
Following is a sample REST request for the getMutualFriends method.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<facebook.getUserDetails/> |
Sample request
Following is a sample REST request for the getUserDetails method.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<facebook.isFriend> <sourceUserId>{$ctx:sourceUserId}</sourceUserId> <targetUserId>{$ctx:targetUserId}</targetUserId> </facebook.isFriend> |
Properties
- sourceUserId: ID of the person to be determined.
- targetUserId: ID of the user to be checked with.
...
Anchor | ||||
---|---|---|---|---|
|
Allows the user to upload photos. This does not require init to be called before the operation. Refer to multipart processing for detailed information.
...
- userId:The id of the user.
- apiUrl:The api url.
- apiVersion:Version of Facebook API.
- accessToken:accessToken.
- caption:The description of the photo.
- photoUrl:The URL of a photo that is already uploaded to the Internet.
- targetId:User id to post the photo to an object that's not the user in the access token.
- tags:Tags on this photo.
- place:Page ID of a place associated with the photo.
- isExplicitPlace:If set to true, the tag is a place, not a person.
- isExplicitLocation:Is this an explicit location or not.
- ogActionTypeId:The Open Graph action type.
- ogObjectId:The Open Graph object ID.
- ogPhrase:The Open Graph phrase.
- ogIconId:The Open Graph icon.
- ogSuggestionMechanism:The Open Graph suggestion.
- privacy:Determines the privacy settings of the photo.
- targeting:Allows you to target posts to specific audiences.
- feedTargeting:Object that controls news feed targeting for this post.
- noStory:If set to true, this will suppress feed and timeline story.
- published:Set to false if you don't want the photo to be published immediately.
- offlineId:Offline ID.
- backdatedTime:A user-specified creation time for this photo.
- backdatedTimeGranularity:Granularity. Default value: none.
- fullResIsComingLater:Full res is coming later.
- composerSessionId:Composer session ID.
- scheduledPublishTime:Time at which an unpublished post should be published.
- manualPrivacy:Manual privacy.
- audienceExp:Audience exp.
- applicationId:iTunes App ID.
Sample request
Refer to the multipart processing section.
Following is a sample REST request for the publishPhoto method.
Code Block | ||||
---|---|---|---|---|
| ||||
curl -X POST \ -d "source=%7Bimage-data%7D" \ http://localhost:8280/services/facebook_publishPhoto?user_id={userId} |
...
- message:The request message.
- idsInvitable:Friend IDs.
- actionType:Action Type.
- data:Additional data a developer may pass for tracking.
- objectId:Object ID.
- ref:Reference.
- from:From.
Sample request
Following is a sample REST request for the sendAppRequest method.
...
Following is a sample proxy service that illustrates how to connect to Facebook with the init operation and use the createFriendList operation to create an albumcreatePost operation to Users. The sample request for this proxy can be found in createFriendList createPost sample request. You can use this sample as a template for using other operations in this category.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<proxy xmlns="http://ws.apache.org/ns/synapse" name="facebook_createFriendListcreatePost" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="name" expression="json-eval($.name)"/> <facebook.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiVersion>{$url:apiVersion}</apiVersion> <accessToken>{$ctx:accessToken}</accessToken> </facebook.init> <facebook.createPost> <message>{$ctx:message}</message> <link>{$ctx:link}</link> <picture>{$ctx:picture}</picture> <name>{$ctx:name}</name> <caption>{$ctx:caption}</caption> <description>{$ctx:description}</description> <actions>{$ctx:actions}</actions> <place>{$ctx:place}</place> <tags>{$ctx:tags}</tags> <privacy>{$ctx:privacy}</privacy> <objectAttachment>{$ctx:objectAttachment}</objectAttachment> </facebook.createPost> <respond/> </inSequence> <outSequence> <property name="messageType" value="application/json" scope="axis2" /> <send/> </outSequence> </target> </proxy> |