How Do I get the information of logged user on portal?


#1

Hey,

I pretend to make a widget report that gets de information of logged user on portal, like the example above but with the user name and adress. I search on user and portal object, to get those informations, but I wasn’t succeed.

deviceName = client.info.description.name;

Regards,

Arthur.


#2

I think you’re looking for the ‘Get User’ endpoint: http://docs.exosite.com/portals/#get-user

It looks like the docs for that are slightly out of date, but username is one of fields returned by that call. And by address, I assume you mean email address, that’s in there too.

Edit: Oh, you were asking about getting it for the logged-in user. For that you make the same call, but for the user id you can use the string _this which the API will interpret as if it was the current user’s id.


#3

Hey Patrick, How you doing?

Your tip didn’t work , I was trying to get the client(devices) information and it was successful, however when do I get information abou logged user in portal, give an error.

Above I did a code getting information about client and user. User didn’t work well:

var client, user;
if (portal.clients.length === 0 && options.deviceTime === true) {
showMsg(“Showing browser time. Select data source to show device time.”);
options.deviceTime = false;
}

client = portal.clients[0];

user = portal.users[0];

deviceName = client.info.description.name; // It works
responsable= user.fullName; // =/

I wanna get these informations from user:

Have a Nice day!