regeme regeme - 3 months ago 60
JSON Question

How to post gif on facebook using api

I am developing a web app and can be able to post images and videos to Facebook page which I already retrieved access token.

However things got complicated when posting a gif file.

I got the gif file from user and save under /content folder located in my server and I can display it properly when I call the following url http://www.mywebsite.com/content/example.gif

Now I want to be able to POST this url to Facebook page from mywebsite but it displayed as a static image file no any movement as it supposed to be.

When I look examples on the web people post gif urls via SHARE method but since the sharing works only for the logged Facebook account I couldnt post it to Facebook page that I already got and saved the access token.

How can I overcome this dilemma ? Is there any proper way to POST gif files/urls directly to Facebook account or page? Any suggestions ?

Thanks in advance

Answer
FB.api(
 'me/feed/',
 'POST',
 {
 message: 'This is a GIF',
 link:    'http://25.media.tumblr.com/08d54accc4beb56a50e752fd931c6b58/tumblr_mlsyqrzwWQ1s3g3ago1_400.gif'
},
 function(response) {
 console.log(response);
  }
);

For future generations, this code do the trick .

Comments