SP.UserCollection.getByLoginName Method (sp.js)

Gets the user with the specified login name.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

SP.UserCollection.getByLoginName()

Parameters

  • loginName
    Type: String

    The login name of the user.

Return value

Type: SP.User

The user with the specified login name.

Remarks

The value of the loginName parameter cannot be null, empty, or greater than 251 characters in length.

REST resource endpoint

See UserCollection resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/sitegroups(groupid)/users/getByLoginName(loginName)

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/sitegroups(groupid)/users/getByLoginName(loginName)

Resource parameters

  • loginName