Was this article helpful?

User

Last modified 16:38, 10 Nov 2014
Table of Contents

Description

This object represents the current user in the system. The User object may be retrieved with updated information using the getUserInfo method.

Note: if the UID field of the User object is empty, then the entire object is not valid and the rest of the data fields are meaningless. This situation may happen when calling the getUserInfo method while the current user is not connected to any social network.

Data Availability

Different providers provide different data. Thus, the availability of the data members of the User object depends on the specific provider to which the user is connected. Note that the availability of data does not guarantee that the user has entered any information. Program logic should be able to handle missing data. The following table presents the availability of profile data by the main providers. Please note that the availability is also dependent on user permissions.

Note: Facebook provides the 'Current city' data via the Facebook user object 'location' field, from which the state or country can be inferred.  
Note: Slight differences exist between the User object returned by the client and the User object returned by the server. When retrieved from the client, missing properties will appear as empty strings and the identities and capabilities fields are returned as JSON objects. When retrieved from the server, only fields with data are returned, the identities field returns as an array and the capabilities field as a comma separated string. 

Data Members

Field Name Type Description
UID string 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 is 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.
isSiteUID Boolean This field indicates if the UID is a site UID (provided by your site) or an ID generated by Gigya.
Your site may provide the site UID using the socialize.setUID, socialize.notifyRegistration or socialize.notifyLogin methods.
UIDSignature string If the global configuration object's "signIDs" field is set to 'true', Gigya "signs" the User object (when returned by an API method) with a cryptographic signature, to prevent fraud. This field will hold the signature, that should be used for verification*.
signatureTimestamp number If the global configuration object's "signIDs" field is set to 'true', Gigya "signs" the User object (when returned by an API method) with a cryptographic signature, to prevent fraud. This field will hold the timestamp that 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).
loginProvider string The name of the provider that the user used in order to login. If the user logged in using your site login mechanism, then the value of this parameter would be 'site'. If the user is not logged in, then the value of this parameter would be an empty string.
If the value of this parameter is not an empty string then user.identities[user.loginProvider] is the identity used for login.
loginProviderUID string If the user is logged-in then this field will hold the user's ID from the login provider. For example, if the user logged-in using Facebook then this field will hold the user's Facebook ID.
isSiteUser Boolean Indicates 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.
isTempUser Boolean Indicates whether the current user is a temporary user. A temporary user in the Gigya platform is a user with a temporary identity, a guest user, a user that is not registered in Gigya's platform. Technically, a temporary user is characterized by a temporary UID. A Gigya temporary UID is a string with a "_tmp_" prefix. A temp user is created, by default, when Adding Connection without Logging-in.
isConnected Boolean Indicates whether the user is connected to any available provider. This is true only if the user isSiteUser=true and it has at least one identity.
providers array of strings Contains the names of the providers to which the user is connected/logged in.
identities dictionary object A 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.
Notes:
  • When retrieved from the server this field will be an array and not a dictionary object.
  • When used in getFriendsInfo this field contains only identities from the social network in which the user's are friends: if User A and User B are friends on Facebook but not on Twitter, then only User B's Facebook identity is returned.
nickname string The person's nickname, this may be either the nickname provided by the connected provider or a concatenation of the first and last names.
photoURL string The URL of person's full size photo.
thumbnailURL string The URL of person's thumbnail photo when available.
firstName string The person's first name.
lastName string The person's last name.
gender string The person's gender. Can be 'm', 'f', or 'u', for male, female, or unspecified.
age number The person's age.
birthDay number The day in the month in which the person was born.
birthMonth number The month in which the person was born.
birthYear number The year in which the person was born.
email string The person's email.
country string The person's country.
state string The person's state.
city string The person's city.  Facebook data will also show the state in which the city is located ("New York, New York" or "Athens, Greece").
zip string The person's zip code.
profileURL string The URL of the person's profile on his primary Provider.
likes array of objects The person's Facebook likes. The likes array may include the following fields:
  • id - the like ID (from Facebook).
  • time - the time of the like (from Facebook) in standard ISO format
  • timestamp - the time of the like (from Facebook) in Java time (milliseconds since the epoch)
iRank number Influencer rank. The iRank is a number between 1-99, which denotes the percentile location of the user in comparison to all other site users as a site influencer. For example, if a user's iRank equals 60, this means that 60% of the site users influence less than this user, or in other words, this user is in the top 40% of site influencers.
The iRank is calculated based on the amount of exposure this user provides the site. The calculation is done for the past several months, where recent activities receive higher ranks. The iRank is per site (per API key), the same user may have different ranks for different domains.The iRank calculation uses the following parameters:
  • The number of friends this user has in all the networks to which he is connected through this site.
  • The number of times this user shared something in this site (per month).
  • The number of click backs that were made as a result of this user's shares.
Notes:
  • The iRank is not available in the User object by default. To retrieve the iRank of a user, call the getUserInfo method with the extraFields parameter. Include the irank in the list of extra fields to retrieve.
  • Influencer ranks may also be retrieved through our Influencers Report. Read more here.
oldestDataUpdatedTimestamp integer The time when the oldest data of the object was refreshed in Java time format, i.e. milliseconds since Jan. 1st 1970.
oldestDataAge integer The difference in seconds between the oldestDataUpdatedTimestamp and the current time.
proxiedEmail string A proxied email address is a storable channel through which your application can contact your users. Proxied email is currently supported by Facebook only. For more information, please refer to Facebook's documentation.
You will receive the user's proxied email only if both of the following two conditions are fulfilled:
  1. In your Gigya Site Setup process, you have checked the Enable retrieving emails in Facebook checkbox.
  2. The user gave your application the permission to send him emails and chose to provide his proxied email instead of his regular email address (If condition 1 is fulfilled, while connecting to Facebook, the user will be prompted with a dialog to allow your application to send him emails).
capabilities object The capabilities of the user. The capabilities of the user is the unification of the capabilities of all the providers to which the user is currently connected. The significance of the capabilities is indicating which operations are now available for the current user. The capabilities object has seven Boolean fields representing seven possible capabilities: login, notifications, actions, friends, status, contacts and photos.  
Usage example:
if (user.capabilities.friends)
     gigya.socialize.showFriendSelectorUI( { APIKey:'Put your API Key here'},{}); 
Note: When retrieved from the server, capabilities are sent as a comma-separated string containing the names of the active capabilities: "capabilities: Login, Friends, Notifications, Actions".
languages string A comma-separated list of languages that the person speaks.
address string The person's address.
phones array of objects The person's phone numbers.
education array of objects The person's education details. The object includes the following fields:
  • school
  • degree
  • startYear
  • endYear
  • isCurrent
  • schoolType
honors string A comma-separated list of the person's honors.
publications array of objects The person's publications' details.
patents array of objects The person's patents' details.
certifications array of objects The person's certifications' details.
professionalHeadline string The person's professional headline, often the job title at the company.
bio string A description of the person's professional profile.
industry string The industry in which the person's company operates .
specialties string The person's specialties.
work array of objects A collection of the person's work experience. The object includes the following fields:
  • company
  • description
  • isCurrent
  • location
  • title
  • startDate
  • endDate
skills array of objects A collection of the person's skills.
religion string The person's religion.
politicalView string The person's political views.
interestedIn string The gender in which the person is interested.
relationshipStatus string The relationship status of the person.
hometown string The person's hometown.
favorites array of objects The person's favorite things, including favorite books, movies, etc.
username string The person's Facebook user name.
locale string The person's locale.
verified Boolean Indicates whether the person verified his email with Facebook.
timezone string The person's timezone.
UIDSig string Deprecated. Please use the UIDSignature parameter instead.
timestamp string Deprecated. Please use the signatureTimestamp parameter instead.
This parameter holds the GMT time of the response in "yyyy-mm-dd HH:mm:ss" format where HH is in 24 hour time format.
isLoggedIn Boolean Deprecated. This field doesn't indicate whether the current user is logged.

 

* To verify the authenticity of the User Object, follow the instructions in the section Signature Validation Process, using the UID, UIDSignature and signatureTimestamp fields.

Tags

This page has no custom tags.
This page has no classifications.

Comments

You must to post a comment.

Attachments