views:

38

answers:

1

Hi,

I am trying to post to the wall. It does not work when i add arguments like link, name and caption.

function graphStreamPublish(){
                var body = 'This is a test feed';
                var url = 'http://www.my-site.com';
                var heading = 'Check out the link.';
                var caption = 'I am trying to get it work.';  
                FB.api('/me/feed', 'post', { message: body, link: link, name: heading, caption: caption}, function(response) {
                    if (!response || response.error) {
                        alert('Error occured');
                    } else {
                        alert('Post ID: ' + response.id);
                    }
                });
            }

I understand the link, name and caption are cceptable parameters. Am i missing something. It works fine with just message argument.

I appreciate all your help.

Thanks.

+1  A: 

First of all your link variable name is url and you are sending link.

I think I know what's the problem. Facebook doesn't like posting a link without a description (undocumented feature?). I faced similar problem, when I added description to the message it went through.

serg