Search code examples
facebookfacebook-graph-api

Facebook API: Is it possible to upload thubnail along with CTA?


I am trying to post a CTA url along with a custom thumbnail with my facebook post. I am using /feed api. I am aware that when CTA is passed along with the post, facebook will scrape the image from the URL's Open Graph image tag. Here my question is can we pass a custom image instead of facebook scraping the image from OG tag.

I tried uploading image and passing the media id but it didn't work. Also posted the same on facebook community as well and got no response.

Can someone please suggest if someone has tried this?


Solution

  • We are using asp.net webforms application. Here we have added the OG image tag into default.master page.

    The URL to the image is updated when we want to post a CTA. This is done dynamically using a utility. Before posting the social post, we update the OG image URL. Then call the scrape image API. And then post the social post. I am aware that this is not a perfect solution but anyway it helps and solves the problem for now till facebook provides some solution to this.

    Note: Need to scrape image every time a new social post with CTA is posted. Or else it will scrape the cached image.

    Note: You need to add complete image url and relative path to image is not supported by facebook