Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

How to append boolean in api without converting to string?

fyi: my code is in python

my_runs = client.send_get(‘get_runs/139’+ ‘&offset=300’+ '&is_completed= ’ + False)

it complains that
“TypeError: can only concatenate str (not “bool”) to str”

If i do:

my_runs = client.send_get(‘get_runs/139’+ ‘&offset=300’+ '&is_completed= ’ + str(False))

Then I get:
testrail.APIError: TestRail API returned HTTP 400 (“Field :is_completed is not a valid boolean.”)

How do I fix this? please help!


Try putting is_completed=0. According to the documentation it expects 0 or 1.

1 Like