|
333 | 333 | <li><a href="#api-papers">API Papers</a></li> |
334 | 334 | <li><a href="#create-a-paper">Create a Paper</a></li> |
335 | 335 | <li><a href="#access-a-paper">Access a Paper</a></li> |
| 336 | + <li><a href="#get-a-paper">Get a Paper</a></li> |
| 337 | + <li><a href="#duplicate-a-paper">Duplicate a Paper</a></li> |
336 | 338 | <li><a href="#delete-a-paper">Delete a Paper</a></li> |
337 | 339 | </ul> |
338 | 340 | </li> |
@@ -605,6 +607,183 @@ <h3 id="give-names-to-your-users">Give names to your users</h3> |
605 | 607 |
|
606 | 608 | <p><code>https://bitpaper.io/go/Hello%20World/xdXfoI?access-token=foo&user_name=John%20Doe</code></p> |
607 | 609 |
|
| 610 | + <h2 id="get-a-paper"><svg aria-hidden="true" focusable="false" width="16" height="10" viewBox="0 0 16 10" fill="currentColor"><path d="M8 0C4.4 0 1.3 2.2 0 5c1.3 2.8 4.4 5 8 5s6.7-2.2 8-5C14.7 2.2 11.6 0 8 0zm0 8.3c-1.8 0-3.3-1.5-3.3-3.3S6.2 1.7 8 1.7s3.3 1.5 3.3 3.3S9.8 8.3 8 8.3zm0-5.3C6.9 3 6 3.9 6 5s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg> Get a Paper</h2> |
| 611 | + |
| 612 | + <code-block lang="shell">curl "https://api.bitpaper.io/public/api/v1/paper/ddc95912-2a81-a25e-b589-8de1d472f6e8" \ |
| 613 | + -H "Authorization: Bearer <my-secret-api-token>"</code-block> |
| 614 | + |
| 615 | + <blockquote> |
| 616 | + <p>Returns JSON structured like this:</p> |
| 617 | + </blockquote> |
| 618 | + |
| 619 | + <code-block lang="json">{ |
| 620 | + "id_saved_paper": "ddc95912-2a81-a25e-b589-8de1d472f6e8", |
| 621 | + "name": "Maths", |
| 622 | + "status": "active", |
| 623 | + "created_at": "2021-01-01T01:00:00.000Z", |
| 624 | + "is_test_paper": false |
| 625 | +}</code-block> |
| 626 | + |
| 627 | + <p>Retrieves information about a specific paper, including its |
| 628 | + current status.</p> |
| 629 | + |
| 630 | + <h3 id="get-http-request">HTTP Request</h3> |
| 631 | + |
| 632 | + <p><code>GET https://api.bitpaper.io/public/api/v1/paper/<id_saved_paper></code></p> |
| 633 | + |
| 634 | + <h3 id="get-url-parameters">URL Parameters</h3> |
| 635 | + |
| 636 | + <table> |
| 637 | + <thead> |
| 638 | + <tr><th>Parameter</th><th>Description</th></tr> |
| 639 | + </thead> |
| 640 | + <tbody> |
| 641 | + <tr> |
| 642 | + <td><code>id_saved_paper</code></td> |
| 643 | + <td><code>String</code> (UUID) — The paper identifier</td> |
| 644 | + </tr> |
| 645 | + </tbody> |
| 646 | + </table> |
| 647 | + |
| 648 | + <h3 id="get-response">Response</h3> |
| 649 | + |
| 650 | + <p>Responds with <code>HTTP 200</code> if successful.</p> |
| 651 | + |
| 652 | + <table> |
| 653 | + <thead> |
| 654 | + <tr><th>Parameter</th><th>Description</th></tr> |
| 655 | + </thead> |
| 656 | + <tbody> |
| 657 | + <tr> |
| 658 | + <td><code>id_saved_paper</code></td> |
| 659 | + <td><code>String</code> (36 chars) — Unique paper |
| 660 | + identifier</td> |
| 661 | + </tr> |
| 662 | + <tr> |
| 663 | + <td><code>name</code></td> |
| 664 | + <td><code>String</code> — Paper name</td> |
| 665 | + </tr> |
| 666 | + <tr> |
| 667 | + <td><code>status</code></td> |
| 668 | + <td><code>String</code> — <code>active</code>, |
| 669 | + <code>INFLIGHT</code>, or <code>FAILED</code></td> |
| 670 | + </tr> |
| 671 | + <tr> |
| 672 | + <td><code>is_test_paper</code></td> |
| 673 | + <td><code>Boolean</code> — <code>true</code> if created |
| 674 | + with test token</td> |
| 675 | + </tr> |
| 676 | + <tr> |
| 677 | + <td><code>created_at</code></td> |
| 678 | + <td><code>String</code> — ISO 8601 timestamp</td> |
| 679 | + </tr> |
| 680 | + </tbody> |
| 681 | + </table> |
| 682 | + |
| 683 | + <h2 id="duplicate-a-paper"><svg aria-hidden="true" focusable="false" width="14" height="16" viewBox="0 0 12 14" fill="currentColor"><path d="M3.5 0C2.4 0 1.5.9 1.5 2v7.5c0 1.1.9 2 2 2h5c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2h-5zm0 1h5c.55 0 1 .45 1 1v7.5c0 .55-.45 1-1 1h-5c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1zM0 3.5V12c0 1.1.9 2 2 2h5.5v-1H2c-.55 0-1-.45-1-1V3.5H0z"/></svg> Duplicate a Paper</h2> |
| 684 | + |
| 685 | + <code-block lang="shell">curl "https://api.bitpaper.io/public/api/v1/paper/ddc95912-2a81-a25e-b589-8de1d472f6e8/copy" \ |
| 686 | + -X POST \ |
| 687 | + -H "Content-Type: application/json" \ |
| 688 | + -H "Authorization: Bearer <my-secret-api-token>" \ |
| 689 | + --data '{"name":"Maths (copy)"}'</code-block> |
| 690 | + |
| 691 | + <blockquote> |
| 692 | + <p>Returns JSON structured like this:</p> |
| 693 | + </blockquote> |
| 694 | + |
| 695 | + <code-block lang="json">{ |
| 696 | + "id_saved_paper": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", |
| 697 | + "name": "Maths (copy)", |
| 698 | + "status": "INFLIGHT", |
| 699 | + "created_at": "2021-06-15T09:30:00.000Z", |
| 700 | + "is_test_paper": false |
| 701 | +}</code-block> |
| 702 | + |
| 703 | + <p>Duplicates an existing paper, including all content. |
| 704 | + This is a fire-and-forget operation — the response |
| 705 | + returns immediately while the copy runs in the background.</p> |
| 706 | + |
| 707 | + <p>The new paper is returned with <code>status</code> set to |
| 708 | + <code>INFLIGHT</code>. Poll <a href="#get-a-paper">Get a |
| 709 | + Paper</a> with the new <code>id_saved_paper</code> until |
| 710 | + <code>status</code> resolves to <code>active</code> or |
| 711 | + <code>FAILED</code>.</p> |
| 712 | + |
| 713 | + <h3 id="duplicate-http-request">HTTP Request</h3> |
| 714 | + |
| 715 | + <p><code>POST https://api.bitpaper.io/public/api/v1/paper/<id_saved_paper>/copy</code></p> |
| 716 | + |
| 717 | + <h3 id="duplicate-url-parameters">URL Parameters</h3> |
| 718 | + |
| 719 | + <table> |
| 720 | + <thead> |
| 721 | + <tr><th>Parameter</th><th>Description</th></tr> |
| 722 | + </thead> |
| 723 | + <tbody> |
| 724 | + <tr> |
| 725 | + <td><code>id_saved_paper</code></td> |
| 726 | + <td><code>String</code> (UUID) — The paper to |
| 727 | + duplicate</td> |
| 728 | + </tr> |
| 729 | + </tbody> |
| 730 | + </table> |
| 731 | + |
| 732 | + <h3 id="duplicate-body-parameters">Body Parameters</h3> |
| 733 | + |
| 734 | + <table> |
| 735 | + <thead> |
| 736 | + <tr><th>Parameter</th><th>Type</th><th>Description</th></tr> |
| 737 | + </thead> |
| 738 | + <tbody> |
| 739 | + <tr> |
| 740 | + <td><code>name</code></td> |
| 741 | + <td><code>String</code> (4–64 chars)</td> |
| 742 | + <td>A name for the duplicate paper.</td> |
| 743 | + </tr> |
| 744 | + </tbody> |
| 745 | + </table> |
| 746 | + |
| 747 | + <h3 id="duplicate-response">Response</h3> |
| 748 | + |
| 749 | + <p>Responds with <code>HTTP 201</code> if successful.</p> |
| 750 | + |
| 751 | + <table> |
| 752 | + <thead> |
| 753 | + <tr><th>Parameter</th><th>Description</th></tr> |
| 754 | + </thead> |
| 755 | + <tbody> |
| 756 | + <tr> |
| 757 | + <td><code>id_saved_paper</code></td> |
| 758 | + <td><code>String</code> (36 chars) — Unique identifier |
| 759 | + of the new paper</td> |
| 760 | + </tr> |
| 761 | + <tr> |
| 762 | + <td><code>name</code></td> |
| 763 | + <td><code>String</code> — Name of the duplicate</td> |
| 764 | + </tr> |
| 765 | + <tr> |
| 766 | + <td><code>status</code></td> |
| 767 | + <td><code>String</code> — Initially |
| 768 | + <code>INFLIGHT</code></td> |
| 769 | + </tr> |
| 770 | + <tr> |
| 771 | + <td><code>is_test_paper</code></td> |
| 772 | + <td><code>Boolean</code> — <code>true</code> if created |
| 773 | + with test token</td> |
| 774 | + </tr> |
| 775 | + <tr> |
| 776 | + <td><code>created_at</code></td> |
| 777 | + <td><code>String</code> — ISO 8601 timestamp</td> |
| 778 | + </tr> |
| 779 | + </tbody> |
| 780 | + </table> |
| 781 | + |
| 782 | + <aside> |
| 783 | + Recommended polling interval is 2–5 seconds. The copy |
| 784 | + duration depends on paper size. |
| 785 | + </aside> |
| 786 | + |
608 | 787 | <h2 id="delete-a-paper"><svg aria-hidden="true" focusable="false" width="14" height="14" viewBox="0 0 9.37049 10.957" fill="currentColor"><path d="M3.05039 8.72063C3.20965 8.72063 3.30949 8.62119 3.30545 8.4777L3.15797 3.48047C3.15393 3.33293 3.04863 3.24117 2.90291 3.24117C2.74951 3.24117 2.64381 3.33697 2.64785 3.4841L2.79533 8.47951C2.79938 8.62705 2.90104 8.72063 3.05039 8.72063ZM4.41662 8.72063C4.57406 8.72063 4.67977 8.62301 4.67977 8.4777L4.67977 3.4841C4.67977 3.33879 4.57406 3.24117 4.41662 3.24117C4.261 3.24117 4.15348 3.33879 4.15348 3.4841L4.15348 8.4777C4.15348 8.62301 4.261 8.72063 4.41662 8.72063ZM5.78508 8.72426C5.93221 8.72426 6.03791 8.62887 6.04195 8.48133L6.18539 3.48592C6.18943 3.33879 6.08596 3.24299 5.93033 3.24299C5.78279 3.24299 5.6775 3.33879 5.67346 3.48229L5.53002 8.47951C5.52598 8.62301 5.62764 8.72426 5.78508 8.72426ZM2.42982 2.04586L3.07295 2.04586L3.07295 1.07057C3.07295 0.784923 3.26649 0.60674 3.56707 0.60674L5.26031 0.60674C5.55867 0.60674 5.75221 0.784923 5.75221 1.07057L5.75221 2.04586L6.39938 2.04586L6.39938 1.03014C6.39938 0.391407 5.98272 0 5.29711 0L3.52623 0C2.84648 0 2.42982 0.391407 2.42982 1.03014ZM0.303165 2.36742L8.53008 2.36742C8.69965 2.36742 8.83143 2.22979 8.83143 2.06203C8.83143 1.89065 8.69379 1.75664 8.53008 1.75664L0.303165 1.75664C0.143496 1.75664 0 1.89246 0 2.06203C0 2.2316 0.143496 2.36742 0.303165 2.36742ZM2.32682 10.1706L6.51047 10.1706C7.13326 10.1706 7.56809 9.75516 7.59961 9.13195L7.92973 2.2868L7.27711 2.2868L6.95689 9.06586C6.94336 9.35133 6.73307 9.5598 6.44801 9.5598L2.37756 9.5598C2.1024 9.5598 1.88807 9.34728 1.87453 9.06586L1.54037 2.28861L0.903515 2.28861L1.23949 9.136C1.27102 9.7592 1.69594 10.1706 2.32682 10.1706Z"/></svg> Delete a Paper</h2> |
609 | 788 |
|
610 | 789 | <code-block lang="shell">curl "https://api.bitpaper.io/public/api/v1/paper/ddc95912-2a81-a25e-b589-8de1d472f6e8" \ |
|
0 commit comments