I'm trying to write a simple python program that uses admin-sdk (Google Directory API) to search for all users within a certain OU. The problem I encounter is that there is a space character in one of the containers and my code breaks down at this point. I am certain that that space is the problem. How to escape the space character or is there another solution?
Here is the code that causes the problem:
results = service.users().list(query='orgUnitPath=/local/example/IAM Users',customer='my_customer', maxResults=500,orderBy='email').execute()
If I change this to the following, then it works fine. It only breaks at the space in the "IAM Users" container:
results = service.users().list(query='orgUnitPath=/local/example',customer='my_customer', maxResults=500,orderBy='email').execute()
Thanks!