Facebook's Message TID how to get it - facebook-graph-api

I'm trying to open an webview on facebook's message(mobile device) page
But I can't find the tid that are required to open the chat between two peoples
I want to be able to open a new message chat with someone that the user don't know
here's the URL to access this mobile's devices messange chat: https://m.facebook.com/messages/read/?tid=id.147453968688586&__user=100000762748887
this url will open the chat between me and my brother... his facebook's id isn't 147453968688586 so I'm trying to know where I should look to find this tid to be able to open the url on the chat between two peoples
I already look into facebook's api but didn't find.
Thanks

This is the solution you can use the public id and it will redirect you to the tid :)
https://m.facebook.com/messages/thread/*your fbid here*/

Related

Can I send message to a page using Facebook Graph API?

I saw that is possible to use Graph API to send message to a user, but I didn't find nothing about send message to a page. Is it possible?
It is not possible with the API, you can only reply to a User message as Page. Sending messages from Users to Pages is not really neccessary, Users can just use the Messenger for that. Prefilling would not be allowed anyway.

Can I send facebook message to a non friend?

I'm looking at the "Messeger Platform API" documentation, and was not clear to me if I can use any Facebook API to:
Send a message from a page to a public profile.
Send a message from a facebook profile to another who is not my friend.
The Messenger Platform is not for user to user communcation. Read the docs to find out what it is about, and how to use it: https://developers.facebook.com/docs/messenger-platform

How to programmatically post like and comment an URL on facebook?

This is confusing. So just to clarify:
REQ #1: To fetch basic stats for a URL, you send GET request to:
http://graph.facebook.com/?ids=http://some.com
(alternatively, FQL can be used to fetch stats for a URL, but that doesn't return the OpenGraph Object)
REQ #2: To fetch comments for a URL, you do a GET:
http://graph.facebook.com/comments/?ids=http://some.com
REQ #3: To fetch likes for a URL, you GET:
http://graph.facebook.com/likes/?ids=http://some.com
But how do you comment on / like a URL programmatically?
I guess, likes can be created using Open Graph API, right?
https://graph.facebook.com/me/og.likes?object=1234
where 1234 is the OpenGraph Object ID of an article (as returned by REQ #1).
But this requires an approval process, the like action has to be approved by Facebook.
Is there a better way to do this? Can I use for example the Graph API for all these things?
My goal:
Currently I'm using the Facebook like button and comments plugin to create likes and comments. But these use the JS SDK, which is huge, and they generate a lot of external requests. I wanna get rid of them and just send an AJAX request to my server, which would then asynchronously talk to Facebook, and it would post the Like / Comment.
Is this possible?
Thanks in advance!
I read through the Facebook docs briefly and I don't believe you can do this other than the way you indicated with authenticating.
You should also take a look at this thread: 'Like' a page using Facebook Graph API
You would need to authorize every single user before he would be able to like something, and you would need to go through a review process on Facebook. And i am pretty sure you would not get the required permissions approved just because you want to get rid of the JavaScript SDK overhead, to be honest.
The Social Plugins are asynchronously, so the overhead for downloading the SDK is irrelevant as it happens in the background and it is non-blocking.
I have an idea, to do this. You can use long term access token, Once you login you receive short term token. After receiving short term token you need to request your long term access token. Save that token in DB or file.
Then you can use Graph Api, to make requests. This will eliminate the need for access requirement every time you request api.
Just use access token you saved before.
Refer this documentation from Facebook for further clarity.
https://developers.facebook.com/docs/facebook-login/access-tokens
Happy Coding!
Atul Jindal

C++ Win32 send message by email or by web browser

I dont know which way is easier so i ask for simplier one.
How to send email in win32 or open link like: www.wp.com/?text=message but dont show browser to user? Im new to win32, please help.
You can simply use the WinHttp api to open the http url www.wp.com/?text=message. This will not open the browser and will send the email also. I assume that you have full control over administration of www.wp.com so that it can send email from the server.
See this for WinHttp help: http://msdn.microsoft.com/en-us/library/aa383138%28VS.85%29.aspx

How to read inbox of Facebook pages using Graph API

Hi I'm developing management system for Facebook pages.
All Facebook pages are changed to sytle of timeline by the end of March, they will come to receive message from users.
So I want to add to read inbox of Facebook page, but I can't find how to read it by Graph API. ("/inbox" method is not worked with page access token.)
Please let me know how to do if you know.
Thanks,
Ogawa
I have suffered alot to find the correct url. It is totally different url compare to Profile messaging.
You can read the messages for a page by issuing an HTTP GET request to http://graph.facebook.com/PAGE_ID/conversations with a Page Access Token and read_mailbox permission.
Surprisingly you can reply for page messages also.
You can reply to a user's message by issuing an HTTP POST to http://graph.facebook.com/CONVERSATION_ID/messages
Note that a page can only reply to a user's message. It cannot initiate a private message with a user. Also, a page can respond not more than twice to a user's message before the user has replied back.
Hope that helps.
Graph api explore use this script after authenticating user, permission required
permission script:
$loginUrl = $facebook->getLoginUrl(array(
'scope'=>'email,read_mailbox,read_requests',
));
READ INBOX:
<?php
$user_mail=$facebook->api('/me?fields=id,name,inbox.limit(10)');
echo'<pre>',print_r($user_mail),'</pre>';
?>