PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 17, 2022

[FIXED] How to post gif on facebook using api

 July 17, 2022     api, facebook, facebook-graph-api, gif, json     No comments   

Issue

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


Solution

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 .



Answered By - regeme
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing