File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Share Endpoints
2
+
3
+ Share endpoints allow sharing files with other users.
4
+
5
+
6
+ ## POST ` /share/item-by-username ` (auth required)
7
+
8
+ ### Description
9
+
10
+ The ` /share/item-by-username ` endpoint grants access permission
11
+ for an item to the specified user. This user will also receive an
12
+ email about the shared item.
13
+
14
+ ### Parameters
15
+
16
+ | Name | Description | Default Value |
17
+ | ---- | ----------- | -------- |
18
+ | path | Location of the item | ** required** |
19
+ | username | Username of the user to share to | ** required** |
20
+ | access_level | Either ` 'read' ` or ` 'write' ` | ` 'write' ` |
21
+
22
+ ### Response
23
+
24
+ This endpoint responds with an empty object (` {} ` ).
25
+
26
+ ### Request Example
27
+
28
+ ``` javascript
29
+ await fetch (" https://api.puter.local/share/item-by-username" , {
30
+ headers: {
31
+ " Content-Type" : " application/json" ,
32
+ " Authorization" : ` Bearer ${ puter .authToken } ` ,
33
+ },
34
+ body: JSON .stringify ({
35
+ path: " /my-username/Desktop/some-file.txt" ,
36
+ username: " other-username" ,
37
+ }),
38
+ method: " POST" ,
39
+ });
40
+ ```
You can’t perform that action at this time.
0 commit comments