2

does anyone knows what's wrong with the below code that I have?

I just couldn't seem to be able to get the name, caption, description and image shown on the Facebook user's news feed but the link and message show up and they worked.

WebClient wc= new WebClient();
wc.Encoding = Encoding.UTF8;
wc.UploadString("https://graph.facebook.com/me/links", null, "access_token=" + <facebookAccessToken> + "&link=" + <a valid url> + "&message=" + <a valid message> + "&name=SomeName" + "&caption=SomeCaption" + "&description=SomeDescription" +"&picture=http://mywebsite.com/photo.jpg");

Is there another way to do it (post a Link to the News Feed of Facebook) in ASP.NET code-behind?

bkaid
  • 51,465
  • 22
  • 112
  • 128
FBLover2011
  • 261
  • 4
  • 17

3 Answers3

2

Even though the graph api specifies that https://graph.facebook.com/me/links accepts name, description and picture as parameters, these parameters do nothing. There is a bug filed (http://bugs.developers.facebook.net/show_bug.cgi?id=14782, you will need to sign up or login to view the page) to fix this issue.

You can also post links using https://graph.facebook.com/me/feed and passing the same parameters. Doing this yields the behavior you expected with the links method.

  • 1
    This is a good solution, though I've found that when I do this, my "update" doesn't have a "Share" link on it and does not appeared to be shared Globally. – Bradley Nov 12 '11 at 00:15
2

This appears to be an issue with the Facebook Graph API. I have filed a bug here and would appreciate any support from fellow SO'ers that come across this:

https://developers.facebook.com/bugs/194522957295380

Tom
  • 1,191
  • 1
  • 13
  • 24
0

see how does one post a thumbnail picture to a Facebook /links object?. posting a link to /links will not allow you to specify a picture, but posting to /feed will.

Community
  • 1
  • 1
jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
  • well, that's just the picture, however, my trouble is that even the name, caption and description are not showing up and this is making me mad... – FBLover2011 Jul 04 '11 at 03:42
  • you'll see that the same solution also works for caption and name. I haven't tried description. – jcomeau_ictx Jul 04 '11 at 03:52
  • what do u mean by "As a workaround, one could embed the desired content on a server under his own control, in a frameset or iframe, and embed the desired thumbnail in that page, posting that link to the desired facebook id's /links object." could u elaborate further? – FBLover2011 Jul 04 '11 at 03:55
  • I can't elaborate much because I haven't tried it. It might not even work. What part isn't clear to you? Have you used framesets or iframes? Do you have access to a server where you can publish webpages? – jcomeau_ictx Jul 04 '11 at 04:00