I am newly entered into facebook application. I want to send the message to facebook's users without mailid. I didn't possible. because i found the error is manage_mailbox is not have permission.
Let you know, how to resolve this.. I need ASAP.\
I have tried below like this
$url = "/100003508406494/inbox/";
//100006378695734
$message="Hai";
$link='http://apps.facebook.com/jobsmate';
$face=$facebook->api($url,'POST',
array(
'access_token' => $face_token,
'method'=>'publish_streem',
'message'=>$message,
'link'=>$link,
'name'=>'jobsmate',
'description'=>"$link",
'picture'=>"http://jobsmate.wisdomjobs.com/images/jobsmateicon2.jpg"
));
manage_mailbox seems to be an incorrect error message from FB. I got the same message when i was trying to post a private message using Graph API which i found out later is not possible. You have to use either FB's send dialog or use XMPP chat interface to be able to send private messages now.
Related
I am trying to make bot using facebook messenger api. My bot is working perfectly for direct messages. Now i want to add a feature called comment bot. Like when someone comments on my page post. I would like my bot to reply to the person. I added a webhook url for feeds. When some one comments in a post i get a respone similar to the following:
{"changes":[{"field":"feed","value":{"item":"comment","sender_name":"6sense","comment_id":"127569201201434_137925500165804","sender_id":126557694635918,"post_id":"126557694635918_127569201201434","verb":"add","parent_id":"12655769463
5918_127569201201434","created_time":1507031347,"message":".."}}],"id":"126557694635918","time":1507031349}
Now from that webhook, i am trying to reply back to user using the sender_id. But i am getting a long error which is in short
{ error:
{ message: '(#100) No matching user found',
type: 'OAuthException',
code: 100,
error_subcode: 2018001,
fbtrace_id: 'EmEDxfdcnyF' } } }
I saw some sites implementing this feature. So i guess its possible. But i am not sure why its not working. I am using the same app for this.
Try private_replies API with comment_id to send private replies to user.
To use this API you need read_page_mailboxes permission.
I am currently developing an app with which visitors of an event can take pictures using a webcam and upload them to Facebook using an AS3-application. I know I can connect to Facebook, because I can log the user out using the API and I can get all the information. The problem is that I can't post to their wall for some reason. I keep getting the following error:
error #2032: stream error. url: https://graph.facebook.com/********/feed
I use the following code to post to Facebook:
private function postFB(e:Event=null):void {
var _params:Object = new Object();
_params.uid = Facebook.getAuthResponse().uid;
_params.access_token = Facebook.getAuthResponse().accessToken;
_params.message = "I was at the Thanksgiving Day Event.";
//_params.picture = _bitmap;
Facebook.api("/me/feed", postComplete, _params, "POST");
}
As I've said before, I know I am connected to facebook because if I change "POST" to "GET" in my api-call, I get all the information of my account. I have the correct permissions as far as I know (read_stream, publish_stream, user_photos). I use GraphAPI_Web_1_8_1.swc as an api.
The documentation on the entire api is very poor, so I am trying to figure out the problem. It's been a few years since I've tried any of this, so my code has probably aged too far by now. So, any ideas what I'm doing wrong?
publish_stream is deprecated (since years?), you need to use publish_actions.
If that does not work, make sure the Access Token includes all the permissions, you can test this in the Debugger: https://developers.facebook.com/tools/debug/
Side note: AS3 is not getting used very often anymore, the last version of the the AS3 SDK is from 2011. It may be a good idea to switch to the JavaScript SDK.
I'm trying to post a reply to an inbox message by sending a POST request to /message_id/comments. Is this the correct way to send a reply to an inbox message ?
I'm getting the following error:
"error": {
"type": "OAuthException",
"message": "(#3) App must be on whitelist"
}
The token has every possible permission.
Do I have to ask that my app is added on a whitelist ? how to do so ?
I'm doing this in javascript+jQuery:
var params = {
access_token: token
, method: 'post'
, message: 'hi'
};
$.getJSON('https://graph.facebook.com/$message_id/comments?callback=?', params, function(json) {
});
Facebook apps by default aren't allowed to send messages on behalf of users. There is no permission you are missing. This is an extra level to prevent spam (beyond prompting the user who). You will have to contact Facebook to get your application whitelisted. I would try their developer group.
opened a support ticket right here:
http://developers.facebook.com/bugs/183144141763793?browse=search_4e8b140cbf26e6040457329
Tried all I can think of and googled for, still getting this issue
Like others have pointed out, there isn't a way to do this programmatically unless you are on Facebook's whitelist. However, I did find a way around this for my app. What I do is use Oauth to display messages from a user's FB inbox like normal. When the user clicks 'Reply' on a message, I just send them to the reply page on Facebook Mobile, like this:
$('.reply').click(function() {
var popup_window = window.open('http://touch.facebook.com/messages/compose?ids='+message_id, '_blank');
popup_window.focus();
});
Where message id is the Facebook id for the message they are replying to. In my case, I use PHP to echo the message id into a javascript variable or data-attribute when the page loads. Since the Facebook mobile page opens in a new tab, they don't even really leave my app. Since Facebook mobile has a very streamlined interface it isn't too distracting. It's not perfect, but it works and it's easier than trying to get whitelisted.
Problem is, when a user clicks on FB Login button on my site, Facebook API throws him with a window which ask for access permissions(which is the usual flow). But when the user chooses the proxy mail address (anonymous), then I want to force the user to login only using his real email id.
How am I supposed to handle this ?
I can detect that user used proxy email and prevent him from registering, but then I can't remove my app from his list of authorized apps - meaning I can't get him to that initial dialog for choosing which email he will provide.
You can't force the user to go through the authorization dialog again, because as far as Facebook is concerned, the user has installed your application and nothing else needs to happen. The best thing you can do here is write your own form which informs the user that the Facebook proxy e-mail address is unacceptable and you need a real e-mail address. Unfortunately, this does not force the user to give you their Facebook account e-mail address, or even a real e-mail address. This is the best we have via Facebook though, and it's just something we have to deal with.
UPDATE 5/10/11
I was browsing around the Facebook documentation, and found a method that exists in the old Legacy REST API which actually allows you to remove extended permissions for your app from a user. I think you could use this exact API call to manage getting non-proxy addresses from your Facebook user, while still using the native install dialog.
I tested this using the FB JS SDK and it worked! The method you need to use is the auth.revokeExtendedPermission method. Here are 2 examples of calling that method via the JS SDK and the PHP SDK.
Javascript:
<script>
FB.api({
method: 'auth.revokeExtendedPermission',
perm: 'read_stream'
}, function(response)
{
console.log(response)
});
</script>
PHP:
<?php
$facebook->api(array(
'method' => 'auth.revokeExtendedPermission',
'perm' => 'email',
'uid' => $uid
));
Because these use the Legacy REST API they're not as "supported" as the new Graph API. I've not seen anything regarding migrating this feature to the Graph API. Hopefully they will.
Invoke revocation of the app through graph api (as below) with the php sdk then redirect user back through your dialog with this non-proxy requirement explained.
private function revokeAccess() {
$access_token = $this->facebook->getAccessToken();
$result = $this->facebook->api(array(
'method' => 'auth.revokeAuthorization',
'uid' => $this->{facebook id here},
'access_token' => $access_token
));
return $result;
}
This code is php.
This completely removes the app.
Returns 1 on success; 0 on failure.
$this->facebook == facebook object from the facebook php sdk.
Hi i'm new developer of fb apps and i want to know how can i send a message to the wall of my friends using the new facebook.php class http://github.com/facebook/php-sdk
I do it this
$result = $facebook->api('/me/feed/',
'post',
array($ids,'message' => 'Playing around with FB Graph..')
);
This code work for the firts time i can login in the application after i try to enter again and the application sending and error The message if duplicated.
How can i fixed or what if the best way to do?
Thanks.
The error you are having is because facebook wont let you send the same message to the same user multiple times hence the error duplicate message. Change the text of the message and the message will work.