Merge pull request #5301 from xator91/patch-4

Update api.py EDIT BOARD TITLE
This commit is contained in:
Lauri Ojansivu 2024-02-16 16:22:45 +02:00 committed by GitHub
commit 8ca0b2d9c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

25
api.py
View file

@ -43,6 +43,7 @@ If *nix: chmod +x api.py => ./api.py users
python3 api.py getcard BOARDID LISTID CARDID
python3 api.py addlabel BOARDID LISTID CARDID LABELID
python3 api.py addcardwithlabel AUTHORID BOARDID SWIMLANEID LISTID CARDTITLE CARDDESCRIPTION LABELIDS
python3 api.py editboardtitle BOARDID NEWBOARDTITLE
Admin API:
python3 api.py users # All users
@ -349,6 +350,30 @@ if arguments == 4:
if arguments == 3:
if sys.argv[1] == 'editboardtitle':
# ------- EDIT BOARD TITLE START -----------
boardid = sys.argv[2]
boardtitle = sys.argv[3]
edboardtitle = wekanurl + apiboards + boardid + s + 'title'
print(edboardtitle)
headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)}
post_data = {'title': boardtitle}
body = requests.put(edboardtitle, json=post_data, headers=headers)
print("=== EDIT BOARD TITLE ===\n")
#body = requests.get(edboardtitle, headers=headers)
data2 = body.text.replace('}',"}\n")
print(data2)
if body.status_code == 200:
print("Succesfull!")
else:
print(f"Error: {body.status_code}")
print(body.text)
# ------- EDIT BOARD TITLE END -----------
if sys.argv[1] == 'createlist':
# ------- CREATE LIST START -----------