Permissions needed to upload photo for a Facebook app - facebook

There seems to have been a huge change in the way Facebook manages apps that access their API. Now it seems if you want to create any app that allows uploads to Facebook this application MUST be reviewed by Facebook. Am I wrong? has anyone actually managed to speak or correspond DIRECTLY with anyone at facebook to confirm this?
So my question is, after a week of hair pulling and trying to get a simple image uploading application working, what permissions are necessary to upload a photo to facebook?
Right now I have
publish_actions
email
pubic_profile
user_friends
I'm guessing I ALSO need user_photo permissions.
But the convoluted process that is required to add more permissions has me stumped.
First i click new submission. Then I select user_photos. But I then get an error saying 'It looks like you haven't made any API requests to access content with the user_photos permission in the last 30 days. You need to test this permission in your app with any account listed in Roles before you can submit for review. It looks like you havent tested this permission because no API request has been made against publish_actions in the last 30 days.
Which seems INCORRECT to me since in my signed GET request for image uploading I see the following
redirect_uri fbconnect://success
display touch
state {"is_open_session":true,"is_active_session":true,"com.facebook.sdk_client_state":true,"3_method":"fallback_auth","0_auth_logger_id":"foo"}
scope ****user_photos****
Ok, can any Facebook API experts confirm that
1) I definitely need to submit my app for review in order to upload photos to a facebook account
2) I need user_photo permissions
and
3) I must first set up a test user and test with user_photos BEFORE I submit the app
Addendum. After further testing am getting the image upload to work for all users, BUT only after logging in a 2nd time. ie after first login submit the user is presented with a new blank login popup. Only after logging in a 2nd time (the photo upload is done immediately after login) is the image uploaded successfully.
Can anyone suggest why this is happening? I've posted a 2nd question here
Facebook Image Uploads-required to login twice for first upload

do this and you problem will solve
go https://developers.facebook.com/tools/explorer/
select your Application and get access token and put this in field of submit "me/photos?fields=album" and press on submit >
that is done . that requests API to access content with the user_photos permission ..
Also can do that for every permission need to API requests just with some chage ...etc

It should be clear from the docs what is necessary and what not. I think I already answered questions 1) and 2) in your other question:
Latest Facebook Graph API > only admin user can login-upload photos
I doubt that 3) is necessary, because according to the docs user_photos is needed to retrieve photos, and publish_actions to upload photos...
References:
https://developers.facebook.com/docs/graph-api/reference/user/photos/#Reading
https://developers.facebook.com/docs/graph-api/reference/user/photos/#Creating

Related

Can't seem to figure out how to get the permissions to post to my app wall from my website with my admin token

All I want to do is post to my facebook app wall with my website after certain actions occur on the website...used to work however at some point I started neglecting my code and it stopped working..
So now I want to get it working again however I believe I am having an issue with permissions that I can't seem to get around, as when i attempt to post from my website it is returning the error:
*** GraphAPIError: (#200) The user hasn't authorized the application to perform this action
I applied for the following permissions:
manage_pages and publish_pages
But I am now told the following:
General You don't need any additional permissions to post to Pages or
blogs that you administer. You only need to submit your app for review
if your app will use a public-facing login.
So wondering if anybody can tell me the steps to submit my app for review. Not seeming to see how to do that seemingly most basic action.
Thanks.
You don’t need to submit for review, if you are the only one using the app.
https://developers.facebook.com/docs/apps/faq#roles

how to request permission to post ads on a page as an app?

I'm working on a facebook app that posts newsfeed ads, and I have been banging my head against the wall for the last few days, the work flow should go like this:
User provides his page id.
The App requests authorization to post ads on the page. stuck here
App verifies that the user authorized it.
App creates adcreatives using the user's page_id in the object_story_spec call to /adcreative using the app's ad account.
I went through How to post to page as an app?'s docs, couldn't figure it out.
the app is written in Go, however if you can provide a code sample it doesn't matter what language you use, I just need the basic work flow.
Not sure what you want to do exactly, but if you want to create ads (for am ad_account/user) via an app, you'll need the ads_management permission during Facebook Login.
How you manually create a login flow can be found in the docs as well.
See
https://developers.facebook.com/docs/facebook-login/permissions#reference-extended
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

ASP Classic: twitter and facebook autoposting without signing in

In work I got a task (we MUST work with ASP Classic by the way): when user posts a blog, a link to that blog should be posted automatically on user's facebook timeline and in his twitter. I made everything working, but there is one problem: user needs to be signed in to post. I've made the cheking if he's logged in, and if not he must log in.
But I need to avoid the logging-in step and make it automatic (by sending user's username and password as part of the data sent to twitter/facebook or something like that), but I can't figure out how to do that or if it's even possible at all.
Any ideas? Would greatly appreciate any help.
P.S.: for the twitter part I used http://scottdesapio.com/VBScriptOAuth/
for the facebook part I used a combination of: http://snipplr.com/view/61108/facebook-app-login--authorization-entirely-clientside/
Everything works, but is it possible to automatize the user's sign-in part?
Finally I managed to make the both things automated...
The problem with Twitter was that I didn't store request token in session, that's why I got "Could not authenticate you" error.
Can't remember what I did wrong with Facebook (some co-workers helped me out), but I guess I didn't make proper http requests...
So the answer is: yes, it is possible to automatically post to Twitter and Facebook without user sign in.
If I am not wrong then your logged in user in facebook for current browser is not authorize for your app.
I think you should try googling about "How to authorize users into app". OR
If you don't mind I am giving you the direct URL to go to that setting page for your app:
https://developers.facebook.com/apps and then go to your app then after from left side bar go to roles and then after click on test user tab from top of page and then click on add button it will opne one pop-up to add a user.
In app you have to add test user for testing purpose and have to login for that added test user, so added user will be authorize for that app and you will be able to test.
Thank you...

Uploading Photos to Facebook using Graph API

I would like to provide users of my application with ability to upload photos to their Facebook account. The application has a username and password form for the users to fill.
In Graph API, there's a method for uploading photos. But I'm unsure how to authenticate - it doesn't seem to provide a way to supply username and password. It requires access_token.
What's the right way to allow users authenticating and uploading photos using username and password?
It's hard to tell how you want to do this without a sample code or even stating what technology you are using..
Anyway, almost ALL interactions with facebook graph api require an access token and most likely an extended permission.
First of all, for you to post/upload a photo you need:
The publish_stream extended permission
A better understanding of how and where the photo will be uploaded to, this can be done by reading the publishing section in the photo documentation
Now that you have a general idea, in your destination/submission page of your form and when the image is successfully uploaded to your server and it's location is known (obviously), use one of the two answers in this question to upload the image.
P.S: I don't really understand why you need a username & password in first place, but it's your application...
To clarify, the access_token is what you receive after the user authorize your application. So , the provision of username and password only need to be done once, when user first access your app.
You need to redirect user browser or client to : https://www.facebook.com/dialog/oauth... (Refer to https://developers.facebook.com/docs/authentication/ )
Then after you have the access_token, you can just use that for the api call to upload photo to that user.
The authorization process need to be done again when the token is expired.

Update facebook status from site

In my site page one text box and publish button.
When i clicked on button which is a text in text box its published on facebook as status.
For this update status user have to allow this application on facebook.
Once user allow this application whenever user clicked publish that text will update status of facebook.
and also user need not to login agian and agian to facebook. Its done internally
like update facebook status from twitter.
I am new in php.
is there any easy solution?
If somebody is looking for a working script: You can also use:
http://360percents.com/posts/php-curl-status-update-working-example/
If you only want to update the user status information you don't need to create a Facebook application. You can do it with PHP Curl library. Look at the example here - http://codesnippets.joyent.com/posts/show/1204
There is this class http://www.barattalo.it/mini-bots-php-class/ that allows you also to post on a fan page wall with a small bot, without using the facebook API.
Since the offline_access permission has been removed recently (read about that here), you'll need to get a long-lived access_token. This will let you do status updates for your users on behalf of your applications for 60 days. After 60 days, you'll have to get your users to authenticate again, since your access token would be invalidated.
You can read about that here:
https://developers.facebook.com/roadmap/offline-access-removal/