From 660038b897942febb53ab9b585f5df4e3f553dce Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 17 May 2023 19:09:36 +1200 Subject: [PATCH] doc/README: update list of endpoints, SDK usage --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 28b8b9e..ff9819f 100644 --- a/README.md +++ b/README.md @@ -57,19 +57,26 @@ The server responds on the following URLs: URL |Method |Description ---------------------|-------|--- `/get/{ID}` |`GET` |Download item content +`/p/{ID}` |`GET` |Preview item content (HTML) +`/p/{ID}-{ID}-...` |`GET` |Preview multiple item content (HTML) `/info/{ID}` |`GET` |Get item content metadata (JSON) -`/thumb/{Type}/{ID}` |`GET` |Get item thumbnail image +`/thumb/{Type}/{ID}` |`GET` |Get item thumbnail image (JPEG). "Type" should match `[sbtmlh]`. `/about` |`GET` |Get server metadata (JSON) ## Usage (Embedding for web) -Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element. Your callback will be passed an array of file IDs of any uploaded items. +Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element: ```html -contented.init("#target", function(/* String[] */ items) {}); +contented.init("#target"); ``` +You can optionally supply additional ordered parameters to `contented.init`: + +1. A callback, that will be passed an array of file IDs of any uploaded items +2. A callback, that will be called if the SDK widget is closed + ## Changelog 2020-07-25: 1.3.1