profile.go
func (m *Messenger) GetPSID(token string) (*string, error) {
	resp, err := m.doRequest("GET", fmt.Sprintf(GraphAPI+"/v2.6/me?fields=recipient&account_linking_token=%s", token), nil)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	read, err := ioutil.ReadAll(resp.Body)
	if resp.StatusCode != http.StatusOK {
		er := new(rawError)
		json.Unmarshal(read, er)
		return nil, errors.New("Error occured: " + er.Error.Message)
	}
	acc := new(accountLinking)
	return &acc.Recipient, json.Unmarshal(read, acc)
}
func (m *Messenger) GetPSID(token string) (*string, error) {
	resp, err := m.doRequest("GET", fmt.Sprintf(GraphAPI+"/v2.6/me?fields=recipient&account_linking_token=%s", token), nil)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	read, err := ioutil.ReadAll(resp.Body)
	if resp.StatusCode != http.StatusOK {
		er := new(rawError)
		json.Unmarshal(read, er)
		return nil, errors.New("Error occured: " + er.Error.Message)
	}
	acc := new(accountLinking)
	return &acc.Recipient, json.Unmarshal(read, acc)
}
func ( m * Messenger ) GetPSID ( token string ) ( * string , error ) { resp , err := m . doRequest ( " " , fmt . Sprintf ( GraphAPI + " " , token ) , nil ) if err != nil { return nil , err } defer resp . Body . Close ( ) read , err := ioutil . ReadAll ( resp . Body ) if resp . StatusCode != http . StatusOK { er := new ( rawError ) json . Unmarshal ( read , er ) return nil , errors . New ( " " + er . Error . Message ) } acc := new ( accountLinking ) return & acc . Recipient , json . Unmarshal ( read , acc ) }
// GetPSID fetches user's page scoped id during authentication flow
// one must supply a valid and not expired authentication token provided by facebook
// https://developers.facebook.com/docs/messenger-platform/account-linking/authentication
GetPSID fetches user s page scoped id during authentication flow one must supply a valid and not expired authentication token provided by facebook https : // developers . facebook . com / docs / messenger - platform / account - linking / authentication