Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

OperationDescription
createLikeCreates a like.
getLikesGet likes for an object.
deleteLikeDeletes a like.

...

  • resourceId: This is the ID of the resource such as a post, video, etc.
        
Anchor
request
request
Sample request

...

Code Block
languagehtml/xml
titleSample Request for createLike
{
"apiUrl":"https://graph.facebook.com",
"apiVersion":"v2.4",
"accessToken":"CAAD8biEgxBIBAOt0XA4FdFFQXg8hzVtYHdrDpeeRa1nHmCylWoOiFmZAWmDYMXnZCZC2akkuIsIM2tEXZBZC1JbhFFZAqRZBRKKvTZCfnhSpojHW0BG3nVKBOGYJCKEcNT7T6onY2poZBrZBZB0FtgZB89ZCSr2THH48eZC5xcNcTjU0QxKZAjJj8cQjebmzm8883RhbErPEF5OcLUpdwZDZD",
"resourceId":"1402049403394184"
} 

Anchor
createLike
createLike
Get likes

This method allows you to get likes for an object such as video, posts, status, note, photo, album and comment.

Code Block
languagehtml/xml
titlecreateLike
<facebook.getLikes>
	<resourceId>{$ctx:resourceId}</resourceId>
	<summary>{$ctx:summary}</summary>
</facebook.getLikes>
Properties
  • resourceId: This is the ID of the resource.
        
Anchor
request
request
Sample request

Following is a sample REST request for the getLikes method. 

Code Block
titleSample Request for getLikes
{
"apiUrl":"https://graph.facebook.com",
"apiVersion":"v2.4",
"accessToken":"CAAD8biEgxBIBAOt0XA4FdFFQXg8hzVtYHdrDpeeRa1nHmCylWoOiFmZAWmDYMXnZCZC2akkuIsIM2tEXZBZC1JbhFFZAqRZBRKKvTZCfnhSpojHW0BG3nVKBOGYJCKEcNT7T6onY2poZBrZBZB0FtgZB89ZCSr2THH48eZC5xcNcTjU0QxKZAjJj8cQjebmzm8883RhbErPEF5OcLUpdwZDZD",
"resourceId":"1402049403394184"
} 

Anchor
deleteLike
deleteLike
Deleting a like

...

Code Block
languagehtml/xml
titledeleteLike
<facebook.deleteLike>
	<resourceId>{$ctx:resourceId}</resourceId>
</facebook.deleteLike> 
Properties
  • resourceId: This is the ID of the resource such as a post, video, etc.
        
Sample request

Following is a sample REST request for the deleteLike method.

...

Code Block
languagehtml/xml
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="facebook_createLike"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
		 <property name="apiVersion"  expression="json-eval($.apiVersion)"/>
         <property name="accessToken" expression="json-eval($.accessToken)"/>
         <property name="resourceId" expression="json-eval($.resourceId)"/>
         <facebook.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
			<apiVersion>{$ctx:apiVersion}</apiVersion>
            <accessToken>{$ctx:accessToken}</accessToken>
         </facebook.init>
         <facebook.createLike>
            <resourceId>{$ctx:resourceId}</resourceId>
         </facebook.createLike>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>