Not receiving user email addresses from search endpoint
I have a script that queries the search endpoint for information about Khoros users. The API call looks roughly like
/api/2.0/search?q=SELECT id, email FROM users LIMIT 10
When developing this script against one Khoros installation, I found that the Khoros user associated with the API request needed to have several "User Management" permissions granted to it in order to receive email addresses via this API call. (In particular, granting "View user reports in Admin Metrics", "Manage roles, user bans, and abuse notifications in admin and user profiles", and "Manage roles in user profiles" seemed to be sufficient.)
However, when running this script against a second Khoros installation, I am not receiving back any email addresses. Every single user returned has the empty string as their email address, and I've tried querying several hundred (all of whom should have emails). For instance, a response may look similar to the below (redacted) sample:
{
"status": "success",
"message": "",
"http_code": 200,
"data": {
"type": "users",
"list_item_type": "user",
"size": 10,
"items": [
{
"type": "user",
"id": "1000000",
"email": ""
},
...additional users removed for brevity...
],
"next_cursor": "AbCdEf"
},
"metadata": {}
}
I have double-checked the roles and permissions for the Khoros user I'm using for this API request. What's the best way to debug? What are some other reasons that I may not be receiving any email addresses?