Hit a wall trying to script a bulk user import via the Genesys Cloud Platform SDK for Python. We’re migrating a batch of agents from a CSV file, and the script bombs out on the first record with a 400 Bad Request. The error payload isn’t super helpful, just says Invalid timezone.
Here’s the chunk of code handling the user creation:
from platform_sdk_python import ApiClient, Configuration, UsersApi
from platform_sdk_python.rest import ApiException
# ... config setup ...
users_api = UsersApi(ApiClient(configuration))
with open('agents.csv') as f:
reader = csv.DictReader(f)
for row in reader:
user_body = {
"name": row['name'],
"email": row['email'],
"address": {
"timezone": row['timezone'] # Value is 'Asia/Manila' in CSV
},
"division_id": default_division_id
}
try:
resp = users_api.post_users(body=user_body)
print(f"Created {row['name']}: {resp.id}")
except ApiException as e:
print(f"Failed {row['name']}: {e.body}")
break
The CSV has Asia/Manila in the timezone column, which matches the exact string returned by GET /api/v2/settings/timezones. I’ve verified the API key has the user:write scope. I’m running this from my local dev box in Manila, so DST isn’t a factor right now.
If I swap the timezone to America/New_York it works fine. Feels like a quirk with the Asia timezones in the SDK model validation or the API itself. Anyone else see this when using post_users with Asian timezones?