I'm trying to get the album content list but Facebook GraphAPI doesn't returns the videos in an album.
curl -i -X GET \
"https://graph.facebook.com/v3.2/ALBUM_ID/?fields=video_count&access_token=TOKEN"
Returns:
{
"video_count": 1,
"id": "1234567890"
}
But I can't request the video or every content list beside photos. How could I get the album content list with all videos and photos?
Related
Hi i am trying to get the Facebook video views (Videos)uploaded by user to his timeline using Facebook graph api.
I am in the Facebook graph api explorer in my access token i also have permissions for user_videos and read_insights
My request for getting the total video views count is this.
879235328905006/video_insights/total_video_views/lifetime
but when i make the request it gives me empty response every time in the explorer
{
"data": [
]
}
879235328905006 is my video id which i have uploaded to my timeline and i am also the owner of the video.
I have tried this request with my different video ids but still it gives me empty response.
is their a way we can get the views count of the videos uploaded by the user to his timeline using facebook graph api...?
Assume that I have know about FB API, I just want to ask "any way to upload album to FB from my website?".
Ex: xkcn.info/archive is my website, I develop a checkbox function that allow user can mark pictures and upload to facebook, it create an album or photo...;).
Thank a lot.
Yes of course it is possible.
First of all you need the permissions:
user_photos to get the access to the user's album
publish_stream to post photos to an album
You can create an empty album of a page by issuing an HTTP Post request to me/albums with following parameters:
name- The name of the album
message- The description of the album
In return you will get the album_id which you can use to post photos into
You can add photos to an album by issuing an HTTP POST request to ALBUM_ID/photos with following parameters:
source- Photo content (multipart/form-data)
message- Photo description string
Reference: Album
Given the following OpenGraph request:
/me/photos?fields=name_tags,tags.fields(id),id&type=tagged
(Returns all the images I am tagged in)
How do I tell FB to only return the images that another friend is tagged in?
I have an Android app from which I'd like to post photos directly to the timeline of a Facebook Page. I don't want the photos to go into an album, but rather directly onto the timeline.
Has anyone done this before?
I saw the answer at http://facebook.stackoverflow.com/questions/8662460/android-app-how-to-upload-photo-from-sdcard-to-facebook-wall that describes posting the photo to a Wall Photos album; however, when I try get the list of albums for the Page, I don't get any albums back. This page does have least one timeline post with a picture, so I would expect it to have a Wall Photos album, but I don't get it back. Do the albums work differently for Pages as opposed to a regular Facebook user, or would the Page need to grant the app some permissions? Here is the code I'm using to get the Page's albums:
String wallAlbumID = null;
String response = getFacebook().request("<pageid>/albums");
JSONObject json = new JSONObject(response);
JSONArray albums = json.getJSONArray("data");
for (int i =0; i < albums.length(); i++) {
JSONObject album = albums.getJSONObject(i);
if (album.getString("type").equalsIgnoreCase("wall")) {
wallAlbumID = album.getString("id");
Log.d("JSON", wallAlbumID);
break;
}
}
Does anyone know of a way to post a photo directly to a Page's timeline from an Android app? I can upload the photo to the user's album, then create a link to the photo on the Page's timeline, but that doesn't actually put the photo on the Page's timeline. I'd like to get the photo right on the timeline, like what happens from the Facebook web interface when you click "Upload Photo".
An photo posted to Facebook will always fall into an album. If you don't specify an album ID from the user's list of albums, uploading images will automatically get uploaded to the "Wall Photos" album instead.
Use the publish_stream method to post a photo to the timeline, and it will show up on the timeline and in the Wall Photos album. Or use the feed dialog with just a picture: https://developers.facebook.com/docs/reference/dialogs/feed/
I want to download all of my photos and albums from facebook in a programatic way.
I know its possible to push photos to fb through graph api. I was wondering if it is possible to pull photos as well.
Yes. First you would have to get all the albums:
https://graph.facebook.com/me/albums?access_token=
Then you would have to request the list of photos in each album:
https://graph.facebook.com/album_Id_here/photos?access_token=
The result of the last request will give you a JSON object that contains urls of each photo in the album.
See the documentation here: http://developers.facebook.com/docs/reference/api/