|
1 | 1 | {
|
2 | 2 | "info": {
|
3 |
| - "_postman_id": "a0a9f1a7-84b1-45ad-a4c0-baa3552118cb", |
| 3 | + "_postman_id": "c69ab4dd-8c6a-48c9-ba48-c6663b1a0c81", |
4 | 4 | "name": "Project API",
|
5 | 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
6 | 6 | },
|
|
248 | 248 | "_postman_isSubFolder": true
|
249 | 249 | },
|
250 | 250 | {
|
251 |
| - "name": "Upload attachment", |
| 251 | + "name": "Upload file attachment", |
252 | 252 | "event": [
|
253 | 253 | {
|
254 | 254 | "listen": "test",
|
|
257 | 257 | "exec": [
|
258 | 258 | "pm.test(\"Status code is 201\", function () {",
|
259 | 259 | " pm.response.to.have.status(201);",
|
260 |
| - " pm.environment.set(\"attachmentId\", pm.response.json().id);", |
| 260 | + " pm.environment.set(\"fileAttachmentId\", pm.response.json().id);", |
261 | 261 | "});"
|
262 | 262 | ],
|
263 | 263 | "type": "text/javascript"
|
|
278 | 278 | ],
|
279 | 279 | "body": {
|
280 | 280 | "mode": "raw",
|
281 |
| - "raw": "{\n\t\t\"title\": \"first attachment submission\",\n\t\t\"filePath\": \"/home/phoenix/a.png\",\n\t\t\"s3Bucket\": \"topcoder-project-service\",\n\t\t\"contentType\": \"application/png\"\n\t}" |
| 281 | + "raw": "{\n\t\"title\": \"first file attachment\",\n\t\"path\": \"/home/files/phoenix/a.png\",\n\t\"type\": \"file\",\n\t\"s3Bucket\": \"topcoder-project-service\",\n\t\"contentType\": \"application/png\",\n\t\"tags\": [\"design preview\"]\n}" |
282 | 282 | },
|
283 | 283 | "url": {
|
284 | 284 | "raw": "{{api-url}}/projects/{{projectId}}/attachments",
|
|
296 | 296 | "response": []
|
297 | 297 | },
|
298 | 298 | {
|
299 |
| - "name": "Update attachment", |
| 299 | + "name": "Create link as attachment", |
| 300 | + "event": [ |
| 301 | + { |
| 302 | + "listen": "test", |
| 303 | + "script": { |
| 304 | + "id": "6547ada6-53f5-4e2d-bda0-f0ec5bfbe38f", |
| 305 | + "exec": [ |
| 306 | + "pm.test(\"Status code is 201\", function () {", |
| 307 | + " pm.response.to.have.status(201);", |
| 308 | + " pm.environment.set(\"linkAttachmentId\", pm.response.json().id);", |
| 309 | + "});" |
| 310 | + ], |
| 311 | + "type": "text/javascript" |
| 312 | + } |
| 313 | + } |
| 314 | + ], |
| 315 | + "request": { |
| 316 | + "method": "POST", |
| 317 | + "header": [ |
| 318 | + { |
| 319 | + "key": "Authorization", |
| 320 | + "value": "Bearer {{jwt-token}}" |
| 321 | + }, |
| 322 | + { |
| 323 | + "key": "Content-Type", |
| 324 | + "value": "application/json" |
| 325 | + } |
| 326 | + ], |
| 327 | + "body": { |
| 328 | + "mode": "raw", |
| 329 | + "raw": "{\n\t\"title\": \"link attachment\",\n\t\"path\": \"https://connect.topcoder-dev.com/projects/8600/assets.zip\",\n\t\"type\": \"link\",\n\t\"tags\": [\"specification\", \"design preview\", \"billing information\"]\n}" |
| 330 | + }, |
| 331 | + "url": { |
| 332 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments", |
| 333 | + "host": [ |
| 334 | + "{{api-url}}" |
| 335 | + ], |
| 336 | + "path": [ |
| 337 | + "projects", |
| 338 | + "{{projectId}}", |
| 339 | + "attachments" |
| 340 | + ] |
| 341 | + }, |
| 342 | + "description": "Create an project attachment" |
| 343 | + }, |
| 344 | + "response": [] |
| 345 | + }, |
| 346 | + { |
| 347 | + "name": "Update file attachment", |
300 | 348 | "request": {
|
301 | 349 | "method": "PATCH",
|
302 | 350 | "header": [
|
|
311 | 359 | ],
|
312 | 360 | "body": {
|
313 | 361 | "mode": "raw",
|
314 |
| - "raw": "{\n\t\t\"title\": \"first attachment submission updated\",\n\t\t\"description\": \"updated project attachment\"\n\t}" |
| 362 | + "raw": "{\n\t\t\"title\": \"first attachment submission updated\",\n\t\t\"description\": \"updated project attachment\",\n\t\t\"tags\": [\"anotherTag\"]\n\t}" |
315 | 363 | },
|
316 | 364 | "url": {
|
317 |
| - "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{attachmentId}}", |
| 365 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{fileAttachmentId}}", |
318 | 366 | "host": [
|
319 | 367 | "{{api-url}}"
|
320 | 368 | ],
|
321 | 369 | "path": [
|
322 | 370 | "projects",
|
323 | 371 | "{{projectId}}",
|
324 | 372 | "attachments",
|
325 |
| - "{{attachmentId}}" |
| 373 | + "{{fileAttachmentId}}" |
326 | 374 | ]
|
327 | 375 | },
|
328 | 376 | "description": "Update project attachment"
|
329 | 377 | },
|
330 | 378 | "response": []
|
331 | 379 | },
|
332 | 380 | {
|
333 |
| - "name": "Delete attachment", |
| 381 | + "name": "Update link attachment", |
334 | 382 | "request": {
|
335 |
| - "method": "DELETE", |
| 383 | + "method": "PATCH", |
| 384 | + "header": [ |
| 385 | + { |
| 386 | + "key": "Authorization", |
| 387 | + "value": "Bearer {{jwt-token}}" |
| 388 | + }, |
| 389 | + { |
| 390 | + "key": "Content-Type", |
| 391 | + "value": "application/json" |
| 392 | + } |
| 393 | + ], |
| 394 | + "body": { |
| 395 | + "mode": "raw", |
| 396 | + "raw": "{\n\t\t\"title\": \"updated link title\",\n\t\t\"description\": \"updated link description\",\n\t\t\"tags\": [\"linkTag1\"]\n\t}" |
| 397 | + }, |
| 398 | + "url": { |
| 399 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{linkAttachmentId}}", |
| 400 | + "host": [ |
| 401 | + "{{api-url}}" |
| 402 | + ], |
| 403 | + "path": [ |
| 404 | + "projects", |
| 405 | + "{{projectId}}", |
| 406 | + "attachments", |
| 407 | + "{{linkAttachmentId}}" |
| 408 | + ] |
| 409 | + }, |
| 410 | + "description": "Update project attachment" |
| 411 | + }, |
| 412 | + "response": [] |
| 413 | + }, |
| 414 | + { |
| 415 | + "name": "Get file attachment", |
| 416 | + "protocolProfileBehavior": { |
| 417 | + "disableBodyPruning": true |
| 418 | + }, |
| 419 | + "request": { |
| 420 | + "method": "GET", |
336 | 421 | "header": [
|
337 | 422 | {
|
338 | 423 | "key": "Authorization",
|
|
348 | 433 | "raw": ""
|
349 | 434 | },
|
350 | 435 | "url": {
|
351 |
| - "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{attachmentId}}", |
| 436 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{fileAttachmentId}}", |
352 | 437 | "host": [
|
353 | 438 | "{{api-url}}"
|
354 | 439 | ],
|
355 | 440 | "path": [
|
356 | 441 | "projects",
|
357 | 442 | "{{projectId}}",
|
358 | 443 | "attachments",
|
359 |
| - "{{attachmentId}}" |
| 444 | + "{{fileAttachmentId}}" |
360 | 445 | ]
|
361 | 446 | },
|
362 | 447 | "description": "Delete a project attachment"
|
363 | 448 | },
|
364 | 449 | "response": []
|
365 | 450 | },
|
366 | 451 | {
|
367 |
| - "name": "Download attachment", |
| 452 | + "name": "Get link attachment", |
368 | 453 | "protocolProfileBehavior": {
|
369 | 454 | "disableBodyPruning": true
|
370 | 455 | },
|
|
385 | 470 | "raw": ""
|
386 | 471 | },
|
387 | 472 | "url": {
|
388 |
| - "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{attachmentId}}", |
| 473 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{linkAttachmentId}}", |
389 | 474 | "host": [
|
390 | 475 | "{{api-url}}"
|
391 | 476 | ],
|
392 | 477 | "path": [
|
393 | 478 | "projects",
|
394 | 479 | "{{projectId}}",
|
395 | 480 | "attachments",
|
396 |
| - "{{attachmentId}}" |
| 481 | + "{{linkAttachmentId}}" |
397 | 482 | ]
|
398 | 483 | },
|
399 | 484 | "description": "Delete a project attachment"
|
|
435 | 520 | "description": "Delete a project attachment"
|
436 | 521 | },
|
437 | 522 | "response": []
|
| 523 | + }, |
| 524 | + { |
| 525 | + "name": "Delete link attachment", |
| 526 | + "request": { |
| 527 | + "method": "DELETE", |
| 528 | + "header": [ |
| 529 | + { |
| 530 | + "key": "Authorization", |
| 531 | + "value": "Bearer {{jwt-token}}" |
| 532 | + }, |
| 533 | + { |
| 534 | + "key": "Content-Type", |
| 535 | + "value": "application/json" |
| 536 | + } |
| 537 | + ], |
| 538 | + "body": { |
| 539 | + "mode": "raw", |
| 540 | + "raw": "" |
| 541 | + }, |
| 542 | + "url": { |
| 543 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{linkAttachmentId}}", |
| 544 | + "host": [ |
| 545 | + "{{api-url}}" |
| 546 | + ], |
| 547 | + "path": [ |
| 548 | + "projects", |
| 549 | + "{{projectId}}", |
| 550 | + "attachments", |
| 551 | + "{{linkAttachmentId}}" |
| 552 | + ] |
| 553 | + }, |
| 554 | + "description": "Delete a project attachment" |
| 555 | + }, |
| 556 | + "response": [] |
| 557 | + }, |
| 558 | + { |
| 559 | + "name": "Delete file attachment", |
| 560 | + "request": { |
| 561 | + "method": "DELETE", |
| 562 | + "header": [ |
| 563 | + { |
| 564 | + "key": "Authorization", |
| 565 | + "value": "Bearer {{jwt-token}}" |
| 566 | + }, |
| 567 | + { |
| 568 | + "key": "Content-Type", |
| 569 | + "value": "application/json" |
| 570 | + } |
| 571 | + ], |
| 572 | + "body": { |
| 573 | + "mode": "raw", |
| 574 | + "raw": "" |
| 575 | + }, |
| 576 | + "url": { |
| 577 | + "raw": "{{api-url}}/projects/{{projectId}}/attachments/{{fileAttachmentId}}", |
| 578 | + "host": [ |
| 579 | + "{{api-url}}" |
| 580 | + ], |
| 581 | + "path": [ |
| 582 | + "projects", |
| 583 | + "{{projectId}}", |
| 584 | + "attachments", |
| 585 | + "{{fileAttachmentId}}" |
| 586 | + ] |
| 587 | + }, |
| 588 | + "description": "Delete a project attachment" |
| 589 | + }, |
| 590 | + "response": [] |
438 | 591 | }
|
439 | 592 | ],
|
440 | 593 | "protocolProfileBehavior": {}
|
|
0 commit comments