|
39 | 39 | python3 api.py addcustomfieldtoboard AUTHORID BOARDID NAME TYPE SETTINGS SHOWONCARD AUTOMATICALLYONCARD SHOWLABELONMINICARD SHOWSUMATTOPOFLIST # Add Custom Field to Board |
40 | 40 | python3 api.py editcustomfield BOARDID LISTID CARDID CUSTOMFIELDID NEWCUSTOMFIELDVALUE |
41 | 41 | python3 api.py listattachments BOARDID # List attachments |
| 42 | + python3 api.py cardsbyswimlane BOARDID LISTID |
| 43 | + python3 api.py getcard BOARDID LISTID CARDID |
42 | 44 |
|
43 | 45 | Admin API: |
44 | 46 | python3 api.py users # All users |
|
251 | 253 | print("=== CREATE NEW USER ===\n") |
252 | 254 | print(body.text) |
253 | 255 | # ------- CREATE NEW USER END ----------- |
| 256 | + |
| 257 | + if sys.argv[1] == 'getcard': |
| 258 | + |
| 259 | + # ------- LIST OF CARD START ----------- |
| 260 | + boardid = sys.argv[2] |
| 261 | + listid = sys.argv[3] |
| 262 | + cardid = sys.argv[4] |
| 263 | + listone = wekanurl + apiboards + boardid + s + l + s + listid + s + cs + s + cardid |
| 264 | + headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)} |
| 265 | + print("=== INFO OF ONE LIST ===\n") |
| 266 | + print("URL:", listone) # Stampa l'URL per debug |
| 267 | + try: |
| 268 | + response = requests.get(listone, headers=headers) |
| 269 | + print("=== RESPONSE ===\n") |
| 270 | + print("Status Code:", response.status_code) # Stampa il codice di stato per debug |
| 271 | + |
| 272 | + if response.status_code == 200: |
| 273 | + data2 = response.text.replace('}', "}\n") |
| 274 | + print(data2) |
| 275 | + else: |
| 276 | + print(f"Error: {response.status_code}") |
| 277 | + print(f"Response: {response.text}") |
| 278 | + except Exception as e: |
| 279 | + print(f"Error in the GET request: {e}") |
| 280 | + # ------- LISTS OF CARD END ----------- |
254 | 281 |
|
255 | 282 | if arguments == 3: |
256 | 283 |
|
|
293 | 320 | print(data2) |
294 | 321 | # ------- INFO OF CUSTOM FIELD END ----------- |
295 | 322 |
|
| 323 | + if sys.argv[1] == 'cardsbyswimlane': |
| 324 | + # ------- RETRIEVE CARDS BY SWIMLANE ID START ----------- |
| 325 | + boardid = sys.argv[2] |
| 326 | + swimlaneid = sys.argv[3] |
| 327 | + cardsbyswimlane = wekanurl + apiboards + boardid + s + sws + s + swimlaneid + s + cs |
| 328 | + headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)} |
| 329 | + print("=== CARDS BY SWIMLANE ID ===\n") |
| 330 | + print("URL:", cardsbyswimlane) # Debug |
| 331 | + try: |
| 332 | + body = requests.get(cardsbyswimlane, headers=headers) |
| 333 | + print("Status Code:", body.status_code) # Debug |
| 334 | + data = body.text.replace('}', "}\n") |
| 335 | + print("Data:", data) |
| 336 | + except Exception as e: |
| 337 | + print("Error GET:", e) |
| 338 | + # ------- RETRIEVE CARDS BY SWIMLANE ID END ----------- |
| 339 | + |
296 | 340 | if arguments == 2: |
297 | 341 |
|
298 | 342 | # ------- BOARDS LIST START ----------- |
|
0 commit comments