by Mike Eaton.
Hi Rezka,
I've started working with these API calls myself and came across the same issue as you. in your userToGet variable, the 'values' value needs to be an array. So for your example, the line
var userToGet = { field: 'username', values: 'mobile' };
should be
var userToGet = { field: 'username', values: ['mobile'] };
With the idea being that if you wanted to look up more than one username, you'd have them as elements of the values array.
Hope that helps!
Mike