Graph API - creating a new photo album for facebook application

I am trying to create an album in my Facebook application using the Graph API. It is very easy to create an album for a user account. We just need to have a user access token and send a message to

https://graph.facebook.com/USER_ID/albums { name :'my USER album' }

It seems logical to send the same post request for the application: https://graph.facebook.com/APP_ID/albums { name :'my APP album' }

However, this will not work. I use the application token from which I get: a token access tool .

Does anyone know how I can do this?

+7
source share
4 answers

I have found a solution. This is rather strange, but what can I do.

Only the user who is the administrator of the application can create new albums and photos. If you meet this criterion, your application should ask the user for another permission: manage_pages .

After that, you can request http://graph.facebook.com/ADMIN_USER_ID/accounts . There you will get an array of all pages managed by this user. Find the item containing your APP_ID . The same element contains access_token , which is required to complete album creation and upload photos.

+4
source

A fairly simple solution, described in detail on facebook authentication documentation . (Scroll down to "Sign in to the app")

You must request this URL:

 https://graph.facebook.com/oauth/access_token? client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET& grant_type=client_credentials 

the response will be an access token that you can use to perform actions on behalf of your application.

+1
source

Use the page access token instead of the user access token; for some operation, the page access token is required.

+1
source

It seems that the new API (GraphQL 2.9 today) is no longer able to create albums dedicated to the Application.

https://developers.facebook.com/docs/graph-api/reference/application/

Here I opened the question: Create photo albums in the Facebook application

0
source

All Articles