Skip to content

Commit 0f6e48b

Browse files
committed
docs(README): Adding webhook description
Signed-off-by: Vincent Boutour <[email protected]>
1 parent 62d37a4 commit 0f6e48b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,36 @@ It can be read-only or with edit right. With edit-right, user can do anything as
5656
5757
This is the main reason I've started to develop this app.
5858

59+
### Webhook
60+
61+
You can register webhook listeners on folders and receive an HTTP notification when one of these event occurs:
62+
63+
- `create` occurs when a directory is created
64+
- `upload` occurs when an item is uploaded
65+
- `rename` occurs when an item is renamed
66+
- `delete` occurs when an item is deleted
67+
- `start` occurs when fibr start and do something on an item
68+
- `access` occurs when content is accessed (directory browsing or just one file)
69+
70+
The request sends is a POST with 15s timeout with the given payload structure:
71+
72+
```json
73+
{
74+
"item": {
75+
"date": "2021-08-10T19:31:28.952325533Z",
76+
"name": "payload.json",
77+
"pathname": "/path/to/payload.json",
78+
"isDir": false,
79+
"size": 177
80+
},
81+
"type": "upload"
82+
}
83+
```
84+
85+
It will contains an extra key `new` with the same structure of `item` in case of a `rename` event.
86+
87+
The webhook can be recursive (all children folders will be notified too) and for now, no event type selection is possible: the webhook will receive all kinds of events.
88+
5989
### SEO
6090

6191
Fibr provides [OpenGraph metadatas](https://ogp.me) to have nice preview of link when shared. These metadatas don't leak any password-protected datas.

0 commit comments

Comments
 (0)