Create a temporary WOPI session for 3rd party file apps or WOPI clients to download or edit files.
Request
Add the parameter Authorization
to Headers,whose value is to concatenate the Token after the Bearer. Example:Authorization: Bearer ********************
Body Params application/json
{
"uri": "cloudreve://JbVTn@share/1.docx",
"viewer_id": "af01b85b-f57d-46d2-8ad6-1d9b96548e78",
"preferred_action": "edit",
"parent_uri": "cloudreve://my/Inspirations"
}
Request Code Samples
curl --location --request PUT '/file/viewerSession' \
--header 'Content-Type: application/json' \
--data-raw '{
"uri": "cloudreve://JbVTn@share/1.docx",
"viewer_id": "af01b85b-f57d-46d2-8ad6-1d9b96548e78",
"preferred_action": "edit",
"parent_uri": "cloudreve://my/Inspirations"
}'
Responses
application/json {
"code": 0,
"data": {
"session": {
"id": "7f50a377-e55b-41f3-a64e-3624e9cd120d",
"access_token": "7f50a377-e55b-41f3-a64e-3624e9cd120d.y0SWlTrJFWd2dcPg7fcyx2tSovFpsq45U2iHGfjeyYq23Zkq5KOnyLgcwPkwZEy27gKLQW4b9Lv713Objot2dvsiuJq4vbDKvx637mnolww35tDbIMOdJKDUb5J8qDzD",
"expires": 1749576616773
},
"wopi_src": "http://localhost:9980/browser/594b605/cool.html?WOPISrc=http%3A%2F%2Fhost.docker.internal%3A5212%2Fapi%2Fv4%2Ffile%2Fwopi%2F6Zebb3Ug\u0026lang=lng"
},
"msg": ""
}
Modified at 2025-08-12 07:13:02