Skip to content

Commit

Permalink
Fix GetUserIDs 400 Bad Request err
Browse files Browse the repository at this point in the history
  • Loading branch information
crayolakat committed Jun 24, 2020
1 parent 17bcbcb commit 095d063
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 095d063

Please sign in to comment.