Posting Photos Using An App Token To Facebook
Several people have asked how to post photos using an app token and the general response seems to be that they should use a user token instead.
However, according to https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/ : "[y]ou can use app tokens to publish or delete content on behalf of a user who gave your app permissions".
and according to https://developers.facebook.com/docs/reference/api/photo/ :
"To publish a 'photo' object you need -a valid access token -publish_stream permission "
The way I interpret those two statements is that I should be able to POST a photo to .../USER_ID/photos using a valid APP token. However, when I try to do that I get the message "A user access token is required to request this resource". At the same time I can easily publish to .../USER_ID/feed using nothing but the APP token. It is also possible to submit stories containing "User Generated Photos" with only an APP token.
So an App can do those things with an APP token, but needs a USER-specific token for .../USER_ID/photos? I wonder if this behavior is by design? So far I have not found anything in the documentation to indicate that is the case.
I too was stuck at the same point as mentioned. And the documentation barely helped.
The workaround I used was to take the 'offline_access' permission while logging in and storing that temporary user access token given to the user.
While publishing the photo I used that offline user access token since the app access token didn't work. It worked like it should've although offline_access has been discouraged to be used...it seemed to be the only way for now.
- → Import statement and Babel
- → Getting Comments of comments Facebook API
- → Facebook Developer API in reactjs code
- → Facebook PHP SDK - Graph Error "Authorization code has been used" on page refresh
- → How is possible to open website inside facebook mobile app like buzzfeed?
- → Laravel - set meta tag dynamically with @section
- → Do Flux (by Facebook) handle server side update with sockets
- → understanding of real example open graph protocol
- → flynsarmy-sociallogin (Facebook api) in octoberCMS - Authentication failed! Facebook returned an invalid user id
- → Open Graph data facebook
- → Putting Facebook photos on canvas, taint canvas when trying to send it toDataURL. Can I set Facebook's header for CORS?
- → OctoberCMS plugin SEO Meta Og image
- → Shopify + og:image resulting in "was not a valid URL."