Search code examples
facebookactionpublishfacebook-opengraph

Facebook Opengraph action publishing error


I'm trying to create a read button for my application. I have implemented the code as per the tutorial, but when i click publish button it says Error Occurred

    <script type="text/javascript">
  function postArticle()
  {
      FB.api(
        '/me/svolzesocial:news.reads?article=<?php the_permalink() ?>',
        'post',
        function(response) {
           if (!response || response.error) {
              alert('Error occured');
           } else {
              alert('Successful! Action ID: ' + response.id);
           }
        });
  }
  </script>

I also tried debugging, but its showing no error there. I have created publish button on this page Svolze post Please help me out to sort this problem!


Solution

  • You're posting to the wrong URL.

    If you're using the build in read action you should post to

    /me/news.reads
    

    If you're using a custom action you should post to

    /me/yournamespace:youractionname
    

    At the moment, you're convoluting the two.