diff --git a/Readme.md b/Readme.md index e205d6f4..fe9428e1 100644 --- a/Readme.md +++ b/Readme.md @@ -15,6 +15,34 @@ You should change `http://documentserver` to your server address in these files: More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview") +## API methods for test examples + +The methods described below are available for all of the test examples. + +### POST `/upload` + +| | | +| ---------------------- | ------------------------------------------------------------ | +| **Summary** | Upload file to test example via request | +| **URL** | /upload | +| **Method** | POST | +| **Request
Headers** | `Content-Type: multipart/form-data` | +| **Request
Body** | `uploadedFile=@`
`filepath` - file for uploading
Multipart body with the file binary contents | +| **Response** | **Code:** 200 OK
**Content on success:**
`{ "filename": }`
**Content on error:**
`{ "error": "Uploaded file not found"}`
Or
`{ "error": "File size is incorrect"}` | +| **Sample** | `curl -X POST -F uploadedFile=@filename.docx http://localhost/upload` | + + +### DELETE `/file` + +| | | +| ------------------ | ------------------------------------------------------------ | +| **Summary** | Delete one file or all files +| **URL** | /file | +| **Method** | DELETE | +| ****URL Params**** | **Optional:**
`filename=[string]` - file for deleting.
*WARNING! Without this parameter, all files will be deleted* | +| **Response** | **Code:** 200 OK
**Success:**
`{"success":true}` | +| **Sample** | **Delete one file:**
`curl -X DELETE http://localhost/file?filename=filename.docx`
**Delete all files:**
`curl -X DELETE http://localhost/file`
| + ## Project Information Official website: [https://www.onlyoffice.com](https://www.onlyoffice.com/?utm_source=github&utm_medium=cpc&utm_campaign=GitHubIntegrationEx)