I am trying to develope a facebook application that allows the users to create an album in my application and upload photos to it. I read some articles but those were very confusing. Could anyone tell me where I can get some simple article regarding this. I have no idea where to start from.
Thanks in advance.
The first thing is getting the user authenticated and with the corresponding permissions into your app (you will need special permissions to upload a picture into his albums, or creating a new one).
Once you have the permissions and therefore, the auth token, you can upload pictures by making post requests to the Graph API.
http://developers.facebook.com/docs/reference/api/photo/
Look at the bottom where it shows you an example using cURL.
Related
I'm creating an app to show all the Google Photos albums of an account (like a gallery) and I want everyone to be able to access the album via a link. I create the albums directly in Google Photos and make them public (creating a sharing link).
I already set up the authentication via Oauth2.0 and created a photosLibraryClient. I am able to get all the albums, their ID's, their names, their cover photo, ... But I can just get it's link but not the shareable one (the public).
I read about the sharing options in the API documentation: https://developers.google.com/photos/library/guides/share-media
But, as far as I undertood, you can only retrieve a sharing Url if you created the album via the app.
I'm listing albums like this:
$photosLibraryClient->listAlbums()
I'm not sure if there is any accessible attribute or method that I don't know here...
I also tried to access the ShareInfo:
$albumUrl = $photosLibraryClient->shareAlbum($album->getId())->getShareInfo()->getShareableUrl();
But i get the error:
NO PERMISSION TO SHARE THIS ALBUM SINCE IT WAS NOT CREATED BY THIS APP
Any ideas on what to do?
It's not possible. In the Google Issue Tracker there's a couple of people asking for this same feature. One issue it's still marked as new though it's from 2019. The other one is closed due to "intended behaviour".
We'll have to wait until more people wants this feature or people at Google decide to make it available. Until then, I'll have to manually add a new record to a DB (with a table made for this single purpose) everytime I upload a new album...
I would like to give users the ability to download any accessible album's photos to their account (not their computer) and let them edit those photos. My problem isn't the edit part of the process but the browse-friends'-albums-select-some-photos-and-download-them part. In other words, i need something like Pick n' Zip download functionality.
Any suggestions, links, snippets?
I am totally new on Facebook interaction, i have no idea where to start from.
Thanks!
download on your app all the files and used one library like this https://github.com/Grandt/PHPZip for create de compress file for the user.
Oks John , you need add the Extended Permissions for access to this data, need the User Data Permissions in this User Data Permissions, in Friends Data Permissions you need friends_photos permissions and friends_about_me for the name of your friend etc.
After using the graph api you can access for your friend list.
{idprofile}/friends
this request response the name and id of your friend, here you can access using the idprofile of your friend you can obtain this the pictures
{idprofile-friend}/photos
I found this, but it is kinda confusing, and doesn't answer the question for me. I'm looking to upload images from my website to a Facebook page (my code works for users pages, not company pages), if there is a way to do it without having to make an application, I'd like that, but from what I've seen, that's not possible.
My code is here: http://pastebin.com/wBp1AQwG
Your link doesn't appear to go anywhere useful, I'm afraid.
Nonetheless, I'm guessing your problem here is that you need to use a Page access token not a user access token to publish to a page rather than a user feed.
See the section on Page Access Tokens at https://developers.facebook.com/docs/reference/api/page/
I've figured it out, here is a basic outline of the process for posting an image to an album that you own on a fanpage.
Get user authenticated
Get users accounts
Get albums, or create them
Post to the id of the album (ALBUM_ID/photos) with the image
It's pretty simple once I figured out the basics of the api.
How can I show website activity on the Facebook timeline?
I integrated Facebook API and Facebook Connect. Now, if any new user uploads a video on the website then I want to display this activity on the Facebook log. What function of Facebook API can I use for this?
You should use Open Graph Actions and Objects. I recommend you create:
A video object
An "uploaded" action as well as utilising the built-in "watch" action
There is a full and more than helpful tutorial right here. Things to consider:
You need to request publish_actions permission from users of your website, if you are already using Facebook Login, then this is a simple matter of adding it to the list of Permissions that you are requesting
Publish an uploaded action for every new video uploaded, make sure you get explicit consent from the user to do so, so that you can use the fb:explicitly_shared parameter.
Use the watch action for any videos that people watch on your website.
Good Afternoon,
Is there an api method/loop which will allow me to access all of a users photos? Keep in mind I do not want tags or albums, I want all pictures. Appreciate the help.
I have tried api photos method yet it does not do what I wish.
Make sure you got the user_photos permission and make a request with graphpath me/photos. You are gonna get all photos he uploaded and is tagged in. Although these are easily removed by just checking who uploaded the image (this is included in the response JSON).