From 11a135c7b70f61ff25c2a407e3198dc64d2ad859 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Mon, 17 Jun 2024 18:44:21 -0400 Subject: [PATCH] doc: add request example for /share --- doc/api/share.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/api/share.md b/doc/api/share.md index 9b278da91..16f3da7cb 100644 --- a/doc/api/share.md +++ b/doc/api/share.md @@ -44,6 +44,27 @@ different from calling `/grant-user-user` with a permission. `heyputer:api/APIError` - **dry_run:** `true` if present +### Request Example + +```javascript +await fetch("http://puter.localhost:4100/share", { + headers: { + "Content-Type": "application/json", + "Authorization": `Bearer ${puter.authToken}`, + }, + body: JSON.stringify({ + // dry_run: true, + recipients: [ + 'user_that_gets_shared_to', + ], + paths: [ + '/user_that_shares/file_that_gets_shared.txt', + ], + }), + method: "POST", +}); +``` + ### Success Response ```json