Failed to get message attachments and shares from facebook - facebook-graph-api

I am using facebook graph api to get user message
I try to get shares object from messages sent between two users.
According to Facebook documentation I should use the method /{message-id}/shares https://developers.facebook.com/docs/graph-api/reference/v2.2/message/shares
But when I tried this with a user with read_mailbox permission I get the following error:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
so what I have to do to get shares and attachments
thanx in advanced

Related

Get a Facebook Event through Graph API

I am trying to get the details of a facebook event:
https://www.facebook.com/events/2007260672817604/
Following the documentation, I tried to GET the info for the event mentioned above
curl -i -X GET \
"https://graph.facebook.com/v15.0/2007260672817604?access_token=..."
But I'm getting the following error:
{
"error": {
"message": "Unsupported get request. Object with ID '2007260672817604' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "AeB6EiSUlbDN7AAzDSoAKxY"
}
Do I need any special permission to be able to do this request? Is it even possible to get the information of public events?

Facebook Ads Attribution Data - Error #100

Pretty straightforward: I'm trying to get Facebook ads attribution data for my Android app using Open Graph API (so I can detect which users came from Facebook ads, which ad, etc). When I use the below url, I get the following error:
{ "error": {
"message": "(#100) Tried accessing nonexisting field (activities) on node type (Application)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "H4b8LYlSGeN" } }
https://graph.facebook.com/{app_id}/activities?access_token={token}&event=MOBILE_APP_INSTALL&attribution={attribution_id}
I got the method via this page in their documentation, which does appear to indicate it works the way I expect.
Am I missing something here? Am I using a totally wrong method to get attribution data?
I was making a GET request rather than a POST because I'm a dumdum

Getting "unsupported GET request" from public_profile info

I'd like to know my Facebook ID but the "official" way of doing that
http://graph.facebook.com/{user} (obviously with my userid) gives an unsupported GET error:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Why is not working? The documentation says the the userid is always part of the public_profile. Are there any other ways of doing that?
"ugol70" is not your id, it´s your username. You can´t use the username anymore. Only use the "App Scoped ID" you get after authorizing (either directly in the authorization process or with the /me endpoint).
..and ALWAYS use an Access Token for API calls. See the following links about Access Tokens, for example:
https://developers.facebook.com/docs/facebook-login/access-tokens/
http://www.devils-heaven.com/facebook-access-tokens/

Facebook Graph API subscribing to user threads

I'm trying to receive realtime updates of user threads via graph api(2.x), and I work around with Graph API Explore posting a request like below to make a subscription;
https://graph.facebook.com/v2.1/MY_FB_ID/subscriptions
# with these params
access_token: MY_VALID_ACCESS_TOKEN
object: user
fields: threads
verify_token: foo-bar
callback_url: http://example.com/callbacks
then I get this error:
{
"error": {
"message": "(#100) Application cannot subscribe to notifications",
"type": "OAuthException",
"code": 100
}
}
And when I change threads with name, for example, it returns this response.
{
"error": {
"message": "(#2201) response does not match challenge, expected value = '1872122487', received='<!doctype html>\n<htm...'",
"type": "OAuthException",
"code": 2201
}
}
I think this error is good because Facebook API accepts a request and try to verify the server to send notifications exists and setup correctly, but the first one is not good apparently.
So what's odd is both threads and name are listed as valid fields for user object on the document, but only threads is not accepted.
https://developers.facebook.com/docs/graph-api/real-time-updates/v2.0#subscribefields
Any idea about what is wrong with this. I should not do this on explore? Or it's not even possible to subscribe user threads via graph api?
Thanks in advance.
I found we cannot receive realtime updates of user/threads unless being whitelisted by facebook, at least for now.

Graph APi: "(#3) Unknown method" error while trying to reply a private message

I'm using the Facebook Graph API to reply a direct message.
I have published my message issuing an HTTP POST request to /CONVERSATION_ID/messages with a valid access token.
But I receive the following error:
{
"error": {
"message": "(#3) Unknown method",
"type": "OAuthException",
"code": 3
}
}
The same test on the Graph API Explorer returned the same error.
Can anyone please help me out?
My Workplace (Facebook for business) GRAPH API application received a "(#3) Unknown method" error when it didn't have POST or DELETE permissions for the action it was attempting. Changing the integration/application permissions resolved the problem for me.
You don't need to add /messages to the API. Just call the API as https://graph.facebook.com/{message_id} to get the thread.