With the Learn365 API it's possible to get the login name of a user as well as a group. This article provides description of the steps to get the relevant login name.
To get the login name of a user or a group follow the steps below:
1. Go to https://api.365.systems/ and make sure you are authorized with the relevant API key.
2. Find the Users section, expand it, find the GET method /odata/v2/Users with the Returns the list of Users description and then click Try it out in the top right corner.
3. Select Execute to run the request.
TIP
You can use query options parameters to control the data in the response by setting filters. When query options parameters are set, the response will contain additional data and details which you can use for search.
Note that, if using the UserFieldValues value in the $expand parameter, the performance of the request may reduce, depending on the amount of data it has to process. To reduce the risk of experiencing performance issues when using this endpoint, you might consider using the following parameters:
- &select - to retrieve only the specified columns.
- &skip - to skip (exclude) the first n records.
- &top - to retrieve only the specified number of items.
4. Go to the Responses block to check the results:
- Number 2xx (for example, 200) under Code shows that the request worked correctly.
- In the Response body field, you will see all users of the tenant and their data including login names specified in the LoginName line.
- Search via Ctrl+F for a specific user or group. You can use the Download option to save the results of the API request in the JSON format to your computer.
Here are some examples of how the login names for a user or a group will be displayed in the response:
- Login name of a user
- Login name of a Microsoft 365 group
- Login name of a Security group
IMPORTANT
In some cases, we recommend using DirectoryObjectId instead of LoginName.
DirectoryObjectId is a unique identifier in Microsoft Entra (Azure Active Directory). It remains unchanged, even when the login name of the object is modified, to allow the system to identify the user.
DirectoryObjectId can be found in the same response as for the user login name.
Comments
Article is closed for comments.