facebookapimessenger

Is Facebook Messenger PSID PageScope constant for User


I am developing a chatbot. I want to ping the FB user from my server that requires PSID.

  1. I obtain the PSID using the Account Linking API. Is there any way to link User email and PSID. As we have used email as the unique parameter to recognize user.

  2. Incase the user logs out, does the PSID change on the next Login. Can I take the PSID to be constant for multiple logins.


Solution

  • After some amount of research I discovered PSID ( PageScope User ID ) is constant for a user and corresponding Page.

    For the first question, the following link can be used. It involves

    1. obtaining app scope id from login access token,
    2. combining app secret with Page Access Token to obtain AppSecretProof,
    3. using AppsecretProof along with Page AccessToken and PSID to obtain appscopeId which matches with the appscopeId obtained during login.