Filtering options in the User Management APIs in Cloudsoc
search cancel

Filtering options in the User Management APIs in Cloudsoc

book

Article ID: 269335

calendar_today

Updated On:

Products

CASB Advanced Threat Protection CASB Audit CASB Gateway CASB Gateway Advanced CASB Security Advanced CASB Security Advanced IAAS CASB Security Premium CASB Security Premium IAAS CASB Security Standard CASB Securlet IAAS CASB Securlet SAAS CASB Securlet SAAS With DLP-CDS

Issue/Introduction

Cloudsoc Management API's provide many options to Filter to a specific records or subset of records, though the exposed filters are case sensitive.

for example searching for first_name=EXample   would not return the results of "example" nor "Example"

Resolution

There are different postfix switches that can change the way the filter is executed:

<FilterName>=<keyword> : this is case sensitive search (the default behavior)

<FilterName> + "__istartswith" = <keyword> : case insensitive search , matching the provided keyword to the beginning of the existing values.

<FilterName> + "__iendswith" = <keyword> : case insensitive search , matching the provided keyword to the end of the existing values.

<FilterName> + "__icontains" = <keyword> : case insensitive search , matching the provided keyword to values at any location.

 

This can be applied to all the exposed Filters (email / is_active / last_name / first_name / secondary_user_id)

Additional Information

Examples:

/examplecom/api/admin/v1/user_management/?first_name=Example

Matches only "Example" 

Does not match "example" and "ExampLe" and "EXAMPLE" 

 

/examplecom/api/admin/v1/user_management/?first_name__istartswith=exa

Matches "example" "ExampLe" and "EXAMPLE" 

Does not match "anexample" and "theExampLe" and "1EXAMPLE" 

 

/examplecom/api/admin/v1/user_management/?first_name__iendswith=ple

Matches "example" ,"ExampLe" and "EXAMPLE" 

Does not match "examples" and "ExampLe11" and "EXAMPLEONE" 

 

/examplecom/api/admin/v1/user_management/?first_name__icontains=amp

Matches "example" ,"Example" and "EXAMPLE" 

Does not match "exammple"