Get User with Email Address
/documents/api/1.1/users/search/items
The service uses an email address as search text provided with the call to match a specific user. The search returns the matching user, if any.
Request
- application/json
- application/xml
-
Type:
stringRequired:trueSpecify an email address as a search string used to return a specific matching user. Wildcard characters are not supported.
Response
- application/json
- application/xml
The request was fulfilled.
If no user is matched, count and errorCode will be "0" and items will not be returned.
- count
-
Type:
stringThe number of users found. - errorCode
-
Type:
stringAn error code of zero (0) indicates no errors. - items
-
Type:
arrayitemsAdditional Properties Allowed:Minimum Number of Items:0
- displayName
-
Type:
stringThe display name for the user. - id
-
Type:
stringGlobally unique identifier (GUID) for the user. - type
-
Type:
stringItem typeuser.
Example application/json
{
"count":"1",
"errorCode":"0",
"items":[
{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"loginName":"userAALoginName",
"type":"user"
}
]
}
Required field "email" is not provided.
Examples
The following example returns the user with the specified email address.
GET .../users/search/items?email=UserB@Tenant1.invalid
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"count": "1",
"errorCode": "0",
"items": [
{
"type": "user",
"id": "Tenant1.UserB",
"displayName": "Tenant1 UserB",
"loginName": "userBBLoginName"
}
]
}
Example 2
The following example shows the results of a search for a user by email when no match is found.
GET .../users/search/items?email=UserZ@Tenant1.invalid
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"count": "0",
"errorCode": "0"
}
Example 3
The following example shows the results of searching for a user without passing in the email parameter.
GET .../users/search/items?emailtypo=UserB@Tenant1.invalid
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 400
JSON Response
{
"count": "0",
"errorCode": "-97",
"errorKey": "!csUnableToRetrieveUserList!csRequiredFieldMissing2,dEmail",
"errorMessage": "Unable to retrieve user list. The required field 'dEmail' is missing.",
"title": "Unable to retrieve user list. The required field 'dEmail' is missing.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}