REST API: Fix typos, remove extra code.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2020-12-03 07:14:06 +02:00
parent 0801e33f97
commit 387f0600ce

16
api.py
View file

@ -133,7 +133,7 @@ at = 'attachment'
ats = 'attachments'
users = wekanurl + apiusers
# ------- API URL GERENARTION END -----------
# ------- API URL GENERATION END -----------
# ------- LOGIN TOKEN START -----------
@ -177,20 +177,6 @@ if arguments == 3:
print(body.text)
# ------- CREATE LIST END -----------
if sys.argv[1] == 'attachmentjson':
# ------- ATTACHMENT AS JSON BASE64 START -----------
boardid = sys.argv[2]
attachmentid = sys.argv[3]
attachmentjson = wekanurl + apiboards + boardid + s + ats + s + attachmentid
print(attachmentjson)
headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)}
print("=== ATTACHMENT AS JSON BASE64 ===\n")
body = requests.get(attachmentjson, headers=headers)
data2 = body.text.replace('}',"}\n")
print(data2)
# ------- ATTACHMENT AS JSON BASE64 END -----------
if arguments == 2:
# ------- BOARDS LIST START -----------