Skip to content

Commit

Permalink
Merge pull request #2 from crayolakat/Fix-GetUserIDs-400-Err
Browse files Browse the repository at this point in the history
Fix GetUserIDs 400 Bad Request err
  • Loading branch information
KaushalKhamar authored Jun 25, 2020
2 parents 17bcbcb + 095d063 commit 03bd0a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion UserPeoplePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@
function GetPeoplePickerUserID(userNameString) {
var itemID = "";
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/ensureUser('" + encodeURIComponent(userNameString) + "')",
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/ensureuser",
method: "POST",
async: false,
contentType: "application/json;odata=verbose",
data: JSON.stringify({
logonName: userNameString
}),
headers: {
"Accept": "application/json; odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
Expand Down
2 changes: 1 addition & 1 deletion UserPeoplePicker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 03bd0a6

Please sign in to comment.