Can I access 'unseen' message status via Graph/FQL API - facebook-graph-api

I'm developing a Chrome extension for message notifications from FB inbox.
The Facebook itself has a Chrome extension, which works well and notifies only of unseen messages. However, I can't reproduce it's behaviour without using /me/inbox connection which has the unseen attribute on message thread. The drawback is a rather heavy response (all messages in the inbox + metadata).
Also, it's an undocumented property. I can see total number of unseen messages by using FQL table unified_thread_count. And I wish I could also see the message unseen status somewhere.
If this can't be done, what way can I mimic the FB's chrome notification extension behaviour?

You can use the fields= querystring parameter to limit the fields returned from the query
https://graph.facebook.com/me/inbox/?fields=id,unseen&access_token=

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.

messages API twitter Challenge-Response Checks

I've seen that twitter changed their endpoints to get and send direct messages, I noticed from a reply from here that it is a workaround to be able to send messages with well-known libraries such as tweepy, but all I need in this case is to list the messages in my inbox.
I've noticed that there is an account activity api which I can use to achieve this goal.
But, I do not understand how to implement Challenge-Response Checks, can you provide an example? how twitter checks this? it is through a post request to my site? to what specific URI they do this? I tried sending a pipedream url as webhook (to see what kind of request they were doing, but absolutely no request was shown)
The account activity endpoint is part of Twitter's Premium product - so you may need to pay to use it. They have comprehensive documentation on the CRC - that includes a sample Python implementation.
I think you will find it easier to use to use the GET direct_messages/events/list API call.
That will list all of the messages in your inbox for the last 30 days.

Reading facebook direct messages

Is it possible to read direct messages using the facebook graph api? I can see a reference to a message object in the docs (http://developers.facebook.com/docs/reference/api/message/) but can’t see a call to get a collection of messages for a facebook page.
I eventually found this in the notifications call in the graph api ...
https://graph.facebook.com/id/notifications
I needed manage_notifications and read_mailbox extended permissions for this to work as well
using graph api and fql you can read messages
see https://developers.facebook.com/docs/reference/fql/ thread and message
be aware there is any difference for FB backend if a message has been sent from during online chat or while offline from chat

getting all notifications

I can easily get the unread notifications with this query:
https://graph.facebook.com/USER_ID/notifications?access_token=ACCESS_TOKEN
Is it possible to all the notifications (marked as read) too?
Yes, you can specify the parameter include_read as 1 to indicate you wish to receive read notifications.
https://graph.facebook.com/USER_ID/notifications?include_read=1&access_token=ACCESS_TOKEN
this link may be help you
http://developers.facebook.com/docs/howtos/notifications-api/
Using The API
Applications can generate notifications by issuing a HTTP POST request to the /user_id/notifications Graph API, with a app access_token.
POST /{recipient_userid}/notifications?access_token= … &template= … &href= …

How to track messages from Facebook API

I´m trying to track messages sent to my Facebook friends.
For example: I sent a message to James Bond, how do I know if he read it or not?
The Facebook Graph API does not support this yet - http://developers.facebook.com/docs/reference/api/message/. I suspect this is because there is no guaranteed way to see if a message has been read or not based on how the user accesses their messages.
It would also require permission tokens to be passed in a three-legged (recipient to application, recipient to sender) verification.