Facebook Video Page Post with Call to Action - facebook

I want to post a video to facebook with call to action button but it seems the video was successfully posted on facebook page but call to action button was ignored. Anyone has any idea what could the problem please?
curl -F 'name=My Video' \
-F 'description=This is my first video' \
-F 'source=#myvideo.mp4' \
-F 'published=1' \
-F 'call_to_action={"type":"LEARN_MORE","value":{"link":"<LINK>","link_format":"VIDEO_LPP"}}' \
-F 'access_token=<PAGE_ACCESS_TOKEN>' https://graph-video.facebook.com/v2.8/<PAGE_ID>/videos

Related

Post photos to an album using a batch request and curl

I'm trying to post a number of photos to an already created album using cURL with the following command:
curl -F 'access_token=<>' \
-F 'batch=[ \
{"method":"POST","relative_url":"/album_id/photos","url":"<photo_url>"}, \
{"method":"POST","relative_url":"/album_id/photos","url":"<photo_url>"}]' \
https://graph.facebook.com
The error I'm getting is (#324) Requires upload file. Is it even possible to post photos in a batch request to an album and if so what is the correct way to do it with cURL? Thanks!
Edit: the correct command thanks to CBroe is:
curl -F 'access_token=<>' \
-F 'batch=[ \
{"method":"POST","relative_url":"/album_id/photos","body":"url=<photo_url>"}, \
{"method":"POST","relative_url":"/album_id/photos","body":"url=<photo_url>"}]' \
https://graph.facebook.com

Post to a Facebook user's wall with curl PERL

I'm storing facebook userid's and access tokens. Can I post to a selected user's wall with this information? The following code is found at Facebook's developer reference.
I'm just not sure how to run it with Perl.
curl -F 'access_token=$accessToken' \
-F 'message=Check out this funny article' \
-F 'link=http://www.example.com/article.html' \
https://graph.facebook.com/$facebookid/feed
or this code:
curl -F 'access_token=$accessToken' \
-F 'photo=http://samples.ogp.me/$appID' \
'https://graph.facebook.com/me/$appNameSpace:$objectType'
Why not use the Facebook::Graph module to do what you need? It's a rich wrapper around the facebook API.
You need to perform a HTTP POST request with these form data, see method post in LWP::UserAgent.

Graph API bug - posting links, missing description

When posting a link on a page using the Graph API, the description is missing.
Might be related to this bug http://bugs.developers.facebook.net/show_bug.cgi?id=14782.
Is this going to be fixed? Now I'm posting as feed/ instead, here the description is shown - but then there is no "share" button.
Any known workaround?
I'm not sure why this is, and really it doesn't make much intuitive sense, but I've had success posting to the PAGE_ID/links feed, rather than identifying the page ID independently and then just posting to graph.facebook.com/links
Thus, I'm posting using:
curl -F 'access_token=ACCESS_TOKEN' \
-F 'link=LINK' \
-F 'name=TITLE' \
-F 'description=DESCRIPTION' \
https://graph.facebook.com/PAGE_ID/links
Rather than:
curl -F 'access_token=ACCESS_TOKEN' \
-F 'link=LINK' \
-F 'name=TITLE' \
-F 'description=DESCRIPTION' \
-F 'id=PAGE_ID' \
https://graph.facebook.com/links
In my testing, the former allows proper formatting of each of the elements, while the latter does not. Both surface the share link. I do not know why this is, but it works.
Hope this helps.

Facebook Application: Uploading multiple images in one post to wall

How to upload multiple images in one post via api?
Like here:
http://www.facebook.com/SocialCity?v=wall
I have managed to upload only one image via curl request.
curl
-F "access_token=token_here"
-F "message=message_here"
-F "picture=http://www.example.com/image.jpg"
https://graph.facebook.com/app_id_here/feed
Or it's not possible to post multiple images this way?
Anyone?
Thanks ;)
It's possible by now with the Open Graph however it seems to apply only to user generated fotos:
https://developers.facebook.com/docs/opengraph/usergeneratedphotos/
Multiple photo upload via one Graph API call is not supported. However you can create individual api calls and batch those in one request described here: https://developers.facebook.com/docs/reference/api/batch/
You can now publish multiple images in a single post to your feed or page:
For each photo in the story, upload it unpublished using the {user-id}/photos endpoint with the argument published=false
curl -i -X POST \
-d "url=https%3A%2F%2Fwww.facebook.com%2Fimages%2Ffb_icon_325x325.png" \
-d "caption=test%20photo%20upload" \
-d "published=false" \
-d "access_token=<user_photos_token>" \
"https://graph.facebook.com/v2.6/me/photos"
You'll get an ID for each photo you upload like this:
{
"id": "10153677042736789"
}
Publish a multi-photo story using the {user-id}/feed endpoint and using the ids returned by uploading a photo
curl -i -X POST \
-d "message=Testing%20multi-photo%20post!" \
-d "attached_media%5B0%5D=%7B%22media_fbid%22%3A%221002088839996%22%7D" \
-d "attached_media%5B1%5D=%7B%22media_fbid%22%3A%221002088840149%22%7D" \
-d "access_token=<publish_actions_token>" \
"https://graph.facebook.com/v2.6/me/feed"
Source: Publishing a multi-photo story

How to post a link with a picture to Facebook using the Graph API?

I have tried two different methods.
The first is to specify the link in the /PROFILE_ID/feed link argument (as described under "publishing" here). The problem is that if I specify anything other than my application URL i get an error saying the URL is invalid.
The second is to use the /PROFILE_ID/links method and specifying a picture URL. The problem is that when it posts it only shows the message and the URL. I've specified values for picture, name and message but none of them show.
How can I Post a link, with a name, message and picture?
Your first approach is the correct one. Is your url starting with http://? What SDK are you using?
As described on this page, the example suggest it should work.
http://developers.facebook.com/docs/reference/api/post
curl -F 'access_token=...' \
-F 'message=Check out this funny article' \
-F 'link=http://www.example.com/article.html' \
-F 'picture=http://www.example.com/article-thumbnail.jpg' \
-F 'name=Article Title' \
-F 'caption=Caption for the link' \
-F 'description=Longer description of the link' \
-F 'actions={"name": "View on Zombo", "link": "http://www.zombo.com"}' \
-F 'privacy={"value": "ALL_FRIENDS"}' \
-F 'targeting= {"countries":"US","regions":"6,53","locales":"6"}' \
https://graph.facebook.com/me/feed
I ended up solving this problem by using the /PROFILE_ID/feed method and then disabling Stream post URL security in my application security settings. Hope this helps someone!