Are Facebook Messenger page-scoped IDs globally unique? - facebook

I understand that the same user will have different page-scoped IDs (PSIDs) across different pages. But is it guaranteed that no two users will have the same PSID across different pages?
For example, is it possible that user A has PSID 1234 while messaging page X, and user B has the same PSID 1234 when messaging page Y?
Technically user A and user B would be differentiable even if they have the same PSID because they are messaging different pages. But can I assume that there will be no overlap on PSIDs across all pages, so that I may use the PSID as a globally unique ID regardless of the particular page?

Facebook don't guarantee the page-scoped IDs (PSIDs) to be unique across different pages - a PSID may represent user A on page X, but user B on page Y.
When representing a user, these IDs are page-scoped IDs (PSID). This means that the IDs of users are unique for a given page.
https://developers.facebook.com/docs/messenger-platform/webhook-reference#format

Yes, Facebook PSID are globally unique as #Savegeman already mentioned.
Are Page Scoped IDs globally unique?
Yes, a PSID for a user on page will never be the same for a different user on a different page.
[Previous link was not valid anymore, adding new link here:]
https://developers.facebook.com/docs/pages/support#faq_267296560579051

Related

Get facebook share/engagement count

As a feature of our site, we are allowing users to share page(s) of our site on facebook by providing share button on our site.
We are adding users encrypted login id as part of the shared url in query param. say
www.somedomain.com/somepage.html?lid=user1
making the share url unique to each user who shares it.
where lid is the parameter namd and user1 is the encrypted loginid. we are also keeping the shared url/link in our system. So that later we can query to facebook using the url and get count of shares, likes and comments using facebook api.
https://graph.facebook.com/?id=www.somedomain.com/somepage.html?lid=user1&fields=og_object{engagement}
We are getting count of shares, comments and likes. But when a different user shares the same url, even though the url is different say
www.somedomain.com/somepage.html?lid=user2
And if I query to facebook api
https://graph.facebook.com/?id=www.somedomain.com/somepage.html?lid=user2&fields=og_object{engagement}
The count of shares, likes and comments of those two different urls (user1 and user2) are same.
If I comments on any one users share, and query on facebook api, the count increases on both apis ( for user1 and user2).
If I like on any one users share, and query on facebook api, the count increases on both apis ( for user1 and user2).
I think facebook ignores the query param lid=user1 & lid=user2 as part of id for any share link
and considers only the path as id i.e. www.somedomain.com/somepage.html? and counts are maintain against this id or path
My question is that:
Is it correct what I have explained above?
Is there any way to make same share link unique for different users? So I can get all types count of the share link of each users without conflicting each other users

two different app scoped user ids for one facebook user?

In my database I have two different app_scoped_user_id for one facebook user.
How to compare two app_scoped_user_id and find dependency between them?
Is there some unique information for one user?

Facebook v2 api: Are page id and personal profile id unique?

In the Facebook v2 graph api, I can get my user id using /me and the ids of the pages I manage using /me/accounts/.
Are these 2 types of ids guaranteed to be different? I would assume so but cannot find any documentation to support.
EDIT
To be clear, I'm asking if there can be a User ID that is the same as a Page ID.
Of course they are different and unique, it´s an ID. The whole point of IDs is that they are unique. Just be aware that you will get an "App Scoped ID" for user profiles, and the "real ID" for pages.

Multiple Facebook IDs for the same user

i'm crawling user comments and its user ids in public links to build a graph, and i noticed some users have more than one ID. For example, this user have two different IDs: 100000571429851 and 993673107328394.
I'm not using different aps to get the user ids (someone told me user IDs changes between different apps).
Any ideas about how i can get a really unique ID for each user?
The reason for the different IDs is because this user is using a mixture of v1 and v2 facebook apps. The first ID is the user's personal ID and is returned when someone authorizes the v1 of an app. The second ID is an app scoped-ID and is returned using v2 of the facebook API. See the section in the facebook docs on App-scoped User IDs
https://developers.facebook.com/docs/apps/upgrading
Facebook will begin to issue app-scoped user IDs when people first log into an instance of your app coded against v2.0 of the API. With app-scoped IDs, the ID for the same user will be different between apps.

Is Facebook app-scoped id global unique?

Since Facebook make different ids for same user in different apps in API V2.0, we should change our attaching systems to fit this.
For the reason that I wanna make less change on our system, I need to know whether the Facebook app-scoped id global unique, in another word, there were have two apps, will the ids conflict when I save only the user app-scoped id in a same hash?
More details following.
I have two apps in a business, so each app could get the app-scoped id for another. I already have a system storing user's information unique index by the user app-scoped id of First app. Now I need to save these two apps user data in the same MySQL table, and we use the ids_for_business API to confirm whether the same user has registered in another app, to decide make a new register or login as a new user of our system. If the app-scoped id is globally unique, we could just act as what I am saying. But if the app-scoped id will be same for different user, that our user system will identify different user as a same user in our system, so we have to make a big change to follow Facebook.
Help me please...
Example like this, id of UserA on AppC is 33, would the id of UserB on AppD be 33?
Yes, The IDs are globally unique:
The ID you get for a specific user who has logged into your app / granted you permission will not change,
Two apps never get the same ID to reference different users - an app scoped ID is globally unique and references a specific {app, user} pair