If you want to use the REST API to work with user profiles, please see one of my other posts: http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
(jQuery is not required but I have added it because we will need it for the $.ajax function when doing REST queries)
Second thing, you will need the domain\username of the user you want to get the user profile data for. This can be easy to get if you are in an On-Prem environment. But if you are working with SharePoint Online, this can be quite tricky. Your username might not always be in the domain\username format. It is stored in the LoginName property if you are querying the Site User Information List:
and it is stored in the AccountName property if your querying the User Profile Service:
In SharePoint Online, it will most probably be in the following format:
Quick Note: If you are using the REST API, you will need to encode the username before you use it in your call. The encodeURIComponent( ) function can be helpful here.
Enough talking. Lets jump into some code right away:
1) Get Multiple User Profile Properties:
2) Get Single User Profile Property:
3) Get User Profile Properties of the Current User:
4) Get Properties of Multiple Users in Single Request:
For this last example, Let's observe the XML which is sent to the server:
With this, we can confirm that only one call was made to the server to retrieve the properties of multiple users. This way, you can even retrieve multiple properties of multiple users in one call.