curl --request GET \
--url 'https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token='import requests
url = "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"AllowAdditionalMicrosoftServices": true,
"appName": "<string>",
"BaseFileName": "<string>",
"BreadcrumbBrandName": "<string>",
"BreadcrumbBrandUrl": "<string>",
"BreadcrumbDocName": "<string>",
"BreadcrumbFolderName": "<string>",
"BreadcrumbFolderUrl": "<string>",
"ClosePostMessage": true,
"CloseUrl": "<string>",
"DisableCopy": true,
"DisableExport": true,
"DisablePrint": true,
"DisableTranslation": true,
"documentId": "<string>",
"documentname": "<string>",
"DownloadUrl": "<string>",
"editActionUrl": "<string>",
"EditModePostMessage": true,
"EnableOwnerTermination": true,
"favIconUrl": "<string>",
"FileEmbedCommandUrl": "<string>",
"FileNameMaxLength": "<string>",
"FileSharingUrl": "<string>",
"FileUrl": "<string>",
"FileVersionUrl": "<string>",
"hash": "<string>",
"HideExportOption": true,
"HidePrintOption": true,
"HideSaveOption": true,
"HostEditUrl": "<string>",
"HostEmbeddedViewUrl": "<string>",
"HostViewUrl": "<string>",
"IsAnonymousUser": true,
"IsEduUser": true,
"LastModifiedTime": "<string>",
"LicenseCheckForEditIsEnabled": true,
"OwnerId": "<string>",
"PostMessageOrigin": "<string>",
"ReadOnly": true,
"RestrictedWebViewOnly": true,
"SignoutUrl": "<string>",
"Size": 123,
"SupportsCobalt": true,
"SupportsContainers": true,
"SupportsDeleteFile": true,
"SupportsEcosystem": true,
"SupportsExtendedLockLength": true,
"SupportsFolders": true,
"SupportsGetLock": true,
"SupportsLocks": true,
"SupportsRename": true,
"SupportsUpdate": true,
"SupportsUserInfo": true,
"UserCanAttend": true,
"UserCanNotWriteRelative": true,
"UserCanPresent": true,
"UserCanRename": true,
"UserCanWrite": true,
"UserExtraInfo": {
"avatar": "<string>",
"mail": "<string>"
},
"UserFriendlyName": "<string>",
"UserId": "<string>",
"UserInfo": "<string>",
"Version": "<string>",
"viewActionUrl": "<string>"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 498,
"type": "SHARE_AUTH:TOKEN_INVALID",
"message": "Invalid share token",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Describe a file to the online editor
GET /wopi/files/{file_id}
Answers the WOPI CheckFileInfo call: everything the online editor needs before it opens a file - its name, size and version, who is looking at it, what that person may do with it, and the addresses the editor should navigate to. A Circularo client asks the same endpoint and is additionally given the platform’s own properties, such as the file hash and the editor’s action URLs to load into an iframe.
What the session is for is not sent in the path but in the session context. Opening a file for editing makes a working copy the editor then writes into, so that the stored file stays untouched until the session ends; opening for viewing leaves everything alone. The context can also ask for a brand-new document, in which case the path carries the extension to create instead of a file hash and an empty document is set up on the spot.
Access is checked on every call, against the caller’s rights to the file and to the document it belongs to, whether the caller is an account of the platform or somebody working through a share - opening a file for editing needs the right to edit that document, and a working copy is reopened only for the document it belongs to. Finding an editing lock that has expired is taken as a session that ended badly: the file is unlocked and, when the caller may edit the document, its state is preserved as a new revision of the document before the answer is composed.
WOPI authorization: Authorize using a token or an access token, or a share token and a one-time password (if required), to call this endpoint.
Required rights for the internal user: view_oos
Allowed share object types for the external recipient: document
Allowed share purposes for the external recipient: sign or execute or approve or review or accept or view
curl --request GET \
--url 'https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token='import requests
url = "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/wopi/files/{file_id}?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"AllowAdditionalMicrosoftServices": true,
"appName": "<string>",
"BaseFileName": "<string>",
"BreadcrumbBrandName": "<string>",
"BreadcrumbBrandUrl": "<string>",
"BreadcrumbDocName": "<string>",
"BreadcrumbFolderName": "<string>",
"BreadcrumbFolderUrl": "<string>",
"ClosePostMessage": true,
"CloseUrl": "<string>",
"DisableCopy": true,
"DisableExport": true,
"DisablePrint": true,
"DisableTranslation": true,
"documentId": "<string>",
"documentname": "<string>",
"DownloadUrl": "<string>",
"editActionUrl": "<string>",
"EditModePostMessage": true,
"EnableOwnerTermination": true,
"favIconUrl": "<string>",
"FileEmbedCommandUrl": "<string>",
"FileNameMaxLength": "<string>",
"FileSharingUrl": "<string>",
"FileUrl": "<string>",
"FileVersionUrl": "<string>",
"hash": "<string>",
"HideExportOption": true,
"HidePrintOption": true,
"HideSaveOption": true,
"HostEditUrl": "<string>",
"HostEmbeddedViewUrl": "<string>",
"HostViewUrl": "<string>",
"IsAnonymousUser": true,
"IsEduUser": true,
"LastModifiedTime": "<string>",
"LicenseCheckForEditIsEnabled": true,
"OwnerId": "<string>",
"PostMessageOrigin": "<string>",
"ReadOnly": true,
"RestrictedWebViewOnly": true,
"SignoutUrl": "<string>",
"Size": 123,
"SupportsCobalt": true,
"SupportsContainers": true,
"SupportsDeleteFile": true,
"SupportsEcosystem": true,
"SupportsExtendedLockLength": true,
"SupportsFolders": true,
"SupportsGetLock": true,
"SupportsLocks": true,
"SupportsRename": true,
"SupportsUpdate": true,
"SupportsUserInfo": true,
"UserCanAttend": true,
"UserCanNotWriteRelative": true,
"UserCanPresent": true,
"UserCanRename": true,
"UserCanWrite": true,
"UserExtraInfo": {
"avatar": "<string>",
"mail": "<string>"
},
"UserFriendlyName": "<string>",
"UserId": "<string>",
"UserInfo": "<string>",
"Version": "<string>",
"viewActionUrl": "<string>"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 498,
"type": "SHARE_AUTH:TOKEN_INVALID",
"message": "Invalid share token",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Headers
The session context passed on the initial WOPI action URL in its sc parameter, and handed back on every call of the session. The platform carries its own state in it, base64-encoded JSON: which mode the file was opened in, the document and its metadata definition, the revision, the address the client came from and the share password where the session belongs to a share.
Path Parameters
Query Parameters
Response
Returns what the editor needs to know about the file.