-
Notifications
You must be signed in to change notification settings - Fork 8
Get User through directory field filter
MarceauGuy edited this page Sep 23, 2019
·
2 revisions
You can only use as a filter the field with the option "Use field in search filter" checked.
The field Id of a directory field can be found in the directory field template -> Edit content -> Directory pattern.
It should look like : YYY[YY=YY]/YYY
The field Id of a custom field can be found by using the search function in a user directory, and inspecting the request in the Console / Network.
Select the last request list, scroll to the bottom, and find the custom field Id.
It should look like : ZZZ-ZZZ-ZZZ-ZZZ-ZZZ : "searchValue"
contentId = 'XXX'
directoryFieldId = 'YYY[YY=YY]/YYY'
customFieldId = 'ZZZ-ZZZ-ZZZ-ZZZ-ZZZ'
body = {
"contentId":contentId,
"profileCriteria":{directoryFieldId:"value",
customFieldId :"value"
}
}
result = api.get_call("user", "directory", "list", body = body)