|
44 | 44 | python3 api.py addlabel BOARDID LISTID CARDID LABELID # Add label to a card |
45 | 45 | python3 api.py addcardwithlabel AUTHORID BOARDID SWIMLANEID LISTID CARDTITLE CARDDESCRIPTION LABELIDS # Add a card and a label |
46 | 46 | python3 api.py editboardtitle BOARDID NEWBOARDTITLE # Edit board title |
| 47 | + python3 api.py copyboard BOARDID NEWBOARDTITLE # Copy a board |
47 | 48 | python3 api.py createlabel BOARDID LABELCOLOR LABELNAME (Color available: `white`, `green`, `yellow`, `orange`, `red`, `purple`, `blue`, `sky`, `lime`, `pink`, `black`, `silver`, `peachpuff`, `crimson`, `plum`, `darkgreen`, `slateblue`, `magenta`, `gold`, `navy`, `gray`, `saddlebrown`, `paleturquoise`, `mistyrose`, `indigo`) # Create a new label |
48 | 49 | python3 api.py editcardcolor BOARDID LISTID CARDID COLOR (Color available: `white`, `green`, `yellow`, `orange`, `red`, `purple`, `blue`, `sky`, `lime`, `pink`, `black`, `silver`, `peachpuff`, `crimson`, `plum`, `darkgreen`, `slateblue`, `magenta`, `gold`, `navy`, `gray`, `saddlebrown`, `paleturquoise`, `mistyrose`, `indigo`) # Edit card color |
49 | 50 | python3 api.py addchecklist BOARDID CARDID TITLE ITEM1 ITEM2 ITEM3 ITEM4 (You can add multiple items or just one, or also without any item, just TITLE works as well. * If items or Title contains spaces, you should add ' between them.) # Add checklist + item on a card |
|
481 | 482 | print(body.text) |
482 | 483 |
|
483 | 484 | # ------- EDIT BOARD TITLE END ----------- |
484 | | - |
| 485 | + |
| 486 | + if sys.argv[1] == 'copyboard': |
| 487 | + |
| 488 | + # ------- COPY BOARD START ----------- |
| 489 | + boardid = sys.argv[2] |
| 490 | + boardtitle = sys.argv[3] |
| 491 | + edboardcopy = wekanurl + apiboards + boardid + s + 'copy' |
| 492 | + print(edboardcopy) |
| 493 | + headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)} |
| 494 | + |
| 495 | + post_data = {'title': boardtitle} |
| 496 | + |
| 497 | + body = requests.post(edboardcopy, json=post_data, headers=headers) |
| 498 | + print("=== COPY BOARD ===\n") |
| 499 | + #body = requests.get(edboardcopy, headers=headers) |
| 500 | + data2 = body.text.replace('}',"}\n") |
| 501 | + print(data2) |
| 502 | + if body.status_code == 200: |
| 503 | + print("Succesfull!") |
| 504 | + else: |
| 505 | + print(f"Error: {body.status_code}") |
| 506 | + print(body.text) |
| 507 | + |
| 508 | + # ------- COPY BOARD END ----------- |
| 509 | + |
485 | 510 | if sys.argv[1] == 'createlist': |
486 | 511 |
|
487 | 512 | # ------- CREATE LIST START ----------- |
|
0 commit comments