From 27f54efabe66a631057497c4bf57ceaf0f73a851 Mon Sep 17 00:00:00 2001 From: Interitio Date: Sat, 7 Jun 2025 05:29:51 +1000 Subject: [PATCH] (document): Update created_at and data. --- api-reference.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api-reference.md b/api-reference.md index a36ed46..05298ae 100644 --- a/api-reference.md +++ b/api-reference.md @@ -41,15 +41,16 @@ However, `Document` also supports CRUD operations separately for storing arbitra | field | type | required | description | | --------------- | --------- | -------- | -------------------------------------------------------------- | | `document_id` | integer | - | UID for this document | -| `document_data` | file | yes | Image data (not sure about the encoding yet) | +| `document_data` | string | yes | Image data encoded in Base64 | | `seal` | integer | yes | Seal integer | -| `created_at` | timestamp | no | When this document was created. Automatically set on creation. | +| `created_at` | timestamp | - | When this document was created. Automatically set on creation. | | `metadata` | string? | no | Optional arbitrary associated metadata. | | `stamps` | [`Stamp`] | no | List of stamps attached to this document. | - `POST` `/documents` - Create and return a `Document`. - Stamps may be added to the document by passing a list of `Stamp`s in the `stamps` field. + - These stamps should not include `document_id`, as this will be automatically added. - `GET` `/documents` - Get all `Document`s matching the given parameters. If no parameters are given, returns all documents. - Supported filter parameters: @@ -63,8 +64,9 @@ However, `Document` also supports CRUD operations separately for storing arbitra - Returns a `Document` with the given `document_id`. - `PATCH` `/documents/{document_id}` - Updates the given `Document`. - - Supports updating `document_data`, `seal`, `metadata`. - - To update the stamps, use `/documents/{document_id}/stamps` + - Supports updating `document_data`, `seal`, `metadata`, and `stamps`. + - If `stamps` is provided, it must be a list of creation arguments for `Stamp`s. These will *replace* the existing document stamps. + - To update individual stamps, use `/documents/{document_id}/stamps` - Returns the updated `Document`. - `DELETE` `/documents/{document_id}` - Delete the given document, and all associated `Stamp`s.