Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.
Python - Get a list of users but filter by specific username
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ02-21-2024 01:49 PM
Hi,
I'm trying to get the ID of a specific user by filtering via username, but for some reason, the filter specifically doesn't work in Python; I can get it to filter in Postman using the yaml, but I can't get it to work in Python. I followed this based on the Jumpcloud API v1.0 but it returns all IDs (though it only prints 10 due to the limit) Any advise would be appreciated.
querystring = {
"limit":"10",
"fields": "id", # Assuming you want to include the user ID in the response
"filter": {"username":{"$eq":username}}
}
Thanks,
A Struggling User
Labels:
- Labels:
-
Python
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ02-28-2024 08:11 AM
Hi @scheng which endpoint are you working with? I can do some testing on my end and get back to you. You can also skip/change the limit field so it will give you more responses.
![](/skins/images/C210B62239BAF37B0AB0FAEB086BB5F1/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/C210B62239BAF37B0AB0FAEB086BB5F1/responsive_peak/images/icon_anonymous_message.png)