Boolean URL params encoding bug

Hello

I think I've found a bug with the Python SDK. Currently, you are using urllib3 for making the requests, which uses the urllib.parse.urlencode method to encode query params for the URLs. The problem is that the boolean values are encoded as "True" and "False" (capitalized)...

>>> import urllib
>>> params = {'joined': True}
>>> print(urllib.parse.urlencode(params))
joined=True

...and it seems that your API only accepts lowercase booleans.

For example, if I wanted to extract the joined queues for an user, I would make this request:
UsersApi().get_user_queues(user_id=user_id, joined=True)
Which behind the scenes makes a request to
https://api.mypurecloud.ie/api/v2/users/{{user_id}}/queues?joined=True
it returns no entities.

However, if I make this request directly:
https://api.mypurecloud.ie/api/v2/users/{{user_id}}/queues?joined=true
it works properly.

Please, could you check it? Thank you

Hi Adrian,

Yes this appears to be a bug in the SDK. We'll get working on this and hopefully have a patch out shortly for it.

Hello Ronan

Is there any ETA for this?

Thanks

Hi Adrian,

Sorry for the delay. Version 131.1.1 has been released with the fix.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.