1. Home
  2. Docs
  3. Javascript
  4. Retrieve information

Retrieve information

When the ROBIN script is loaded, or when the callback method is invoked, it is possible to access methods available on the ROBIN javascript API. Methods that retrieve information, are the following:


PropertyDescriptionPossible valuesValue description
getOnlineStatus()Returns a boolean indicating whether a user is online on the current page (so a chat is possible)
getAllUsers()Returns an array of all users that are available on one of the webstores that are available in this subscriptions. This list does include users that are not assigned to the webstore that is assigned to the URL this request originates from, but does not include users that are not assigned to any webstore at all. Every user object has the following properties:avatarThe avatar that is uploaded in the ROBIN app
emailThe email address of this user
firstNameThe first name of this user
lastNameThe last name of this user
nameThe first name and last name of this user combined
functionThe function of this user
presenceThe presence of this user (can be 'online', 'offline' or 'servicehours')
actualPresenceThe actual presence of this user, can be 'online' or 'offline' taking into account whether the current webstore is currently open.
getWebStoreUsers()Returns an array containing all users that are assigned to the webstore the page the request originates from belongs to. The properties of every user object are the same as described above
getUserByEmail(email)Returns a user that has the email address specified, or null when it does not exist.
getWebStore()Returns a webstore object containing properties of the web store the page the request originates from. Such a webStore object has all properties that are assigned in the ROBIN app:name


Behavior can be changed to modify properties. There are a lot of properties to be changed, it is recommended to set a breakpoint and examine the webstore object that is retrieved and look for the property that needs to be changed. An example, using the following code it is possible to specify the shopper name and email address in case he is logged in, and making the conversation ‘anonymous’ (so the shopper does not have to enter his name).

var robin_settings = {
	callback: function(event, data) {
		if (event == 'init'){
			var name = 'naam';		// determine real name
			var email = 'naam@domein.nl';	// determine real email
			if (email != null && email != '') {
				var ws = __robin.getWebStore();
				ws.conversationTemplate.useAnonymousChat = true;
				__robin.setShopper(email, name);