How To Get Facebook user's "tid" parameter - facebook

I sniffed a bit when sent a message to a friend and found that there is a simple post message sent that contains a "tid" parameter .By this parameter Facebook knows whom to send the message.
So far I didn't find any relevance of this parameter to user id or other aliases.
Does anyone knows how can I get this "tid" parameter from user who is not my friend ?
(because if he is a friend I can just fetch it from a source code when opening a message dialog page).

Yes, the tid is what is the to field of this: https://developers.facebook.com/docs/reference/api/post/

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

Related

How to get sender ID in page conversations/messages{message}? Facebook Graph API 8.0

I'm accessing page conversations and their messages using this reference: https://developers.facebook.com/docs/graph-api/reference/v8.0/conversation
My steps are:
v8.0/{page_id}?fields=conversations
This returns a list of conversation IDs i.e t_1000000000, t_200000000...
v8.0/t_1000000000?fields=messages{message}
This returns all messages in the conversation, however sender ID is not available - I can't tell if the page sent it or the user sent it.
What's the best way to get the sender ID for each message?
I can get sender ID from:
v8.0/t_1000000000?fields=senders, but how do I use this to filter messages?
Thank you
t_10217618258955338?fields=messages{message,from,id}

How to get the The Username of the person that made comment on a Page Post using Facebook Graph API V.6.0?

I have tried the following url
https://graph.facebook.com/v6.0/{commentid}/comments?access_token={pagetoken}
The result i got was 3 fields: created_time, message, id.
I need value of "from" field. please help me.
By default, you only get a minimum set of fields. You need specify additional fields in the API call:
/{commentid}/comments?fields=field1,field2&access_token={pagetoken}

Get user that made the comment in facebooks instagram graph api

Im building an application that manages comments for instagram business profiles, and i'm a little surprised that there doesn't seem to be a way to get info of the user who made the comment.
The docs seem to point this way too:
Reading a Comment
To read an individual comment's metadata, send a GET request to the /{instagram_comment_id} node and include any of the following fields:
...
user (only returned if the user making the query also made the comment)
So, am i to understand that there is no way to get the info of a user which made a comment on a media of the profile i manage or is there something i am missing? any help would be appreciated.
Thanks in advance
This url worked for me:
v3.0/{comment_id}?fields=id,timestamp,username,text
somehow I was able to get the username from graph API, but I'm not getting the fields name, profile_picture_url, etc. this is my URL for getting the username.
GET https://graph.facebook.com/v2.11
/123?fields=mentioned_comment.comment_id(456){user{id, username}, text}
123 - instagram_business_account id
456 - comment id
You can get full user details from username by Calling Instagram API(Maybe it's against there privacy policy). suppose stackoverflow is the username, by calling this API you will get full data.
https://www.instagram.com/stackoverflow/?__a=1

Getting Facebook's New Payer Promotions to Work

Has anyone been able to get the New Payer Promotions described in Facebook's recent developer blog post to work? According to the documentation you should be able to query a new field, is_eligible_promo via the Graph API.
Formatting a call like this only results in the "id" field being returned for me though.
https://graph.facebook.com/USER_ID?fields=is_eligible_promo?access_token=USER_ACCESS_TOKEN
Am I missing something? Do I have to sign up for or enable this somewhere? Or does it just not work correctly?
After testing with a friend's account it appears that the documentation is incorrect.
If the user is eligible it will do what it describes and return the is_eligible_promo field with a "1" as the value.
If the user is not eligible the is_eligible_promo field will not be returned at all.
The documentation says "This query returns the following data in its response: The value 1 indicating the user is eligible or 0 indicating the user is not eligible." Apparently this is not correct.
My account was not eligible therefore it did not return a value for this field.

Tagging a user in a wall post/update using Facebook API

I'm using stream.publish to write to the user's wall and attempted to get "# tagging" to work but with no avail.
If the user's name is Fred and his uid is 1234, I tried sending over "#Fred", "#1234", "#[1234]", "#[Fred]", etc. and couldn't get it to work. The raw string would display every time.
Can someone confirm if this is possible with the API or not? Thanks!
the correct syntax is
#[user_id:1:name]
it shows as a tag, but it doesn't trigger a notification. Anyone knows why?
Maybe you need follow this: NOTE: You cannot specify this field without also specifying a place.
You need to specify a place with the fan page ID of the location associated with the post.
moreā€¦ https://developers.facebook.com/docs/reference/api/user/#posts
reese:
#[user_id:1:name] - It will replace it with the 'name' which you have given
#[user_id:0] - This will notify the user BUT it will happen when you MANUALLY typing it in wall or comment section NOT through graph api, say for eg., if you want to notify this user #[user_id:0] so you are appending this text in message parameter of https://graph.facebook.com/feed api it won't work, I hope you understand :)