Note that there are some explanatory texts on larger screens.

plurals
  1. POGet Open Graph action ID from authenticated user
    primarykey
    data
    text
    <p>I'm taking a first shot at the Facebook Open Graph API. I've made a custom Action Type and Object Type. For this question I'll name them "myaction" and "myobject".</p> <pre><code>function postAction(){ FB.api( '/me/appnamespace:myaction?myobject=http://domain.com/page.php', 'post', function(response) { if (!response || response.error) { alert('Error: ' + response.error.type + ' - ' + response.error.message); } else { //alert('Like was successful! Action ID: ' + response.id); var likedId = response.id; alert('Action was successful! Action ID: ' + response.id + ' (var = ' + likedId + ')'); } } ); } </code></pre> <p>This works. The action is published to the user's timeline.</p> <p>But if that user wants to delete that action (or multiple actions) from my site in a different session? Is there a way to query the custom actions from the user and display them? I could work with a database, and store the actionId, but that will conflict when the user has already deleted the action on facebook</p> <p>The code for deleting the action would be:</p> <pre><code>function deleteAction(){ FB.api( 'xxxxxxxxxx', // Here the Action ID must be inserted 'delete', function(response) { alert('action deleted') } ); } </code></pre> <p><strong>Edit:</strong> </p> <p>This works for getting the action from a specific page (object):</p> <pre><code>function getAction(){ FB.api( '/me/appnamespace:myaction?myobject=http://domain.com/page.php', 'get', function(response) { if (!response || response.error) { alert('Error: ' + response.error.type + ' - ' + response.error.message); console.log(response); } else { console.log(response); } } ); } </code></pre> <p>This works for getting all the custom actions from the user:</p> <pre><code>function getAllAction(){ FB.api( '/me/appnamespace:myaction', 'get', function(response) { if (!response || response.error) { alert('Error: ' + response.error.type + ' - ' + response.error.message); console.log(response); } else { console.log(response); } } ); } </code></pre> <p>In short, is there a way to do this in FQL:</p> <ul> <li>query the Object ID from the current url?</li> <li>query the Action ID from the user (all custom Actions and/or specific action based on the Object ID)?</li> </ul> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload