Legacy Dev Forum Posts

 View Only

Sign Up

Boolean URL params encoding bug

  • 1.  Boolean URL params encoding bug

    Posted 06-05-2025 18:08

    Adrian_Santamaria | 2021-11-11 10:42:26 UTC | #1

    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().getuserqueues(userid=userid, 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


    anon11147534 | 2021-11-11 13:23:36 UTC | #2

    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.


    Adrian_Santamaria | 2021-12-01 16:05:59 UTC | #3

    Hello Ronan

    Is there any ETA for this?

    Thanks


    anon11147534 | 2021-12-14 09:10:19 UTC | #4

    Hi Adrian,

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


    system | 2022-01-03 14:03:32 UTC | #5

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


    This post was migrated from the old Developer Forum.

    ref: 12619