Friend JS

Skip to end of metadata
Go to start of metadata

 

Description

This object represents a person who is a friend of the current user. The Friend object may be retrieved with basic or extended information. The getFriendsInfo method retrieves by default only basic information; extended information can be requested by setting the detailLevel parameter. 

Notes: 

  1. Different providers provide different data. Thus, the availability of the data members of the Friend object depends on the specific provider.
  2. Retrieving friends' data should be requested explicitly by checking the appropriate checkbox in the console's permissions section. 

 

Data Members

Basic Fields:

Field NameTypeDescription
UIDstring

A unique ID for the person represented by this object. The UID is guaranteed to be consistent over time for users who were authenticated on the site by using either login or notifyLogin. Note that if notifyLogin was used then UID will return the same ID provided by the site.

Notes:

  • This field may be rather long in some cases, if you plan to store it in a DB the recommended field size is 300 characters.
  • The UID string must be encoded using the encodeURIComponent() function, before sending it to your server.
isSiteUIDBooleanThis field indicates if the UID is a site UID (provided by your site) or an ID generated by Gigya.
friendshipSignaturestringIf the Global Configuration's signIDs' field is set to 'true', Gigya "signs" the Friend Object (when returned by an API method) with a cryptographic signature, to prevent fraud. This field will hold the signature, which should be used for verification*.
signatureTimestampnumberIf Global Configuration's 'signIDs' field is set to 'true', Gigya "signs" the Friend Object (when returned by an API method) with a cryptographic signature, to prevent fraud. This field will hold the timestamp, which should be used for verification*. The timestamp is the GMT time of the response in UNIX time format (i.e. the number of seconds since Jan. 1st 1970).
oldestDataUpdatedTimestampintegerThe time when the oldest data of the object was refreshed in Java time format, i.e. milliseconds since Jan. 1st 1970.
oldestDataAge integerThe difference in seconds between the  oldestDataUpdatedTimestamp  and the current time.
isSiteUserBooleanIndicates whether the current user is a user of the site. This is useful for checking which friends of the current user are also users of the same site.
identitiesdictionary objectA dictionary object where the keys are the names of the providers to which the user is connected (i.e. 'facebook', 'yahoo', etc.) and the values are Identity objects received from that provider.
For example: If the user is connected to Facebook then user.identities['facebook'] is the identity object representing his Facebook identity and user.identities['facebook'].providerUID is the ID of the user in Facebook.
Note: For User objects returned by getFriendsInfo only identities that are actually friends of the current user will be included here. Suppose User A has a Facebook identity that is a friend of the Facebook identity of User B, and User B also has a Google identity. When asking for the friends of User A you will get User B but only with his Facebook identity.
nicknamestringThe person's nickname, this may be either the nickname provided by the connected provider or a concatenation of the first and last names.
photoURLstringThe URL of person's full size photo.
thumbnailURLstringThe URL of person's thumbnail photo, when available.
friendshipSigstring Deprecated . Please use the friendshipSignature parameter instead. 
timestampstring Deprecated . Please use the signatureTimestamp parameter instead.
This field will hold the timestamp in "yyyy-mm-dd HH:mm:ss" format where HH is in 24 hour time format.

* To verify the authenticity of the Friend Object, follow the instructions in the section Validate Friendship Signatures, using the UID, friendshipSignature and signatureTimestamp fields.

 

Extended Fields

Field NameTypeDescription
firstName stringThe person's first name.
lastNamestringThe person's last name.
genderstringThe person's gender. The value may be either 'm' or 'f'.
agenumberThe person's age.
birthDaynumberThe day in the month in which the person was born.
birthMonthnumberThe month in which the person was born.
birthYearnumberThe year in which the person was born.
emailstringThe person's email.
countrystringThe person's country.
statestringThe person's state.
citystringThe person's city.
zipstringThe person's zip code.
profileURLstringThe URL of the person's profile on his primary provider.

 

Top Providers Friend Data

 
provider
providerURL
providerUIDSig
nickname * * *
photoURL  
thumbnailURL   
firstName
lastName
gender   
age    
birthDay     
birthMonth     
birthYear     *
country   
state     
city     
profileURL  
*Extracted from other fields