curl --request POST \
--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.post(url)
print(response.text)const options = {method: 'POST'};
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 => "POST",
]);
$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("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("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::Post.new(url)
response = http.request(request)
puts response.read_body{
"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": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 413,
"type": "SUBSCRIPTION:INSUFFICIENT_CAPACITY",
"message": "Insufficient capacity",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 501,
"type": "SYSTEM:FEATURE_NOT_IMPLEMENTED",
"message": "Feature not implemented",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Carry out a lock or file operation for the online editor
POST /wopi/files/{file_id}
One endpoint for everything the online editor does to a file other than reading or writing its content. Which operation is meant is not in the path but in the X-WOPI-Override header, and the operations the platform serves are these:
LOCKtakes the editing lock, or refreshes it when the same lock is presented again.REFRESH_LOCKputs the expiry of the current lock off again; a session that stops refreshing loses its lock after half an hour.UNLOCKreleases it. This is where the editing session is wound up: what the editor wrote is taken over into the document as a new revision, provided the caller’s subscription is active and both it and the subscription limits lock have storage left for it.GET_LOCKanswers with the lock currently held, in theX-WOPI-Lockresponse header.RENAME_FILErenames the file and carries the new name over to the document as its title.PUT_RELATIVEis served for a format conversion only, and only of the working copy of an editing session, whose content the converted one replaces. Anything else it is meant for - saving a copy under a new name, or converting a stored file in place - is refused.
Every operation that takes, refreshes, releases or relies on the lock first settles who holds it: a lock that does not match the one the file carries is answered with a conflict and the current lock in the X-WOPI-Lock response header, which is what lets the editor recover. Write access to the file, and to the document behind it, is checked before that, so it covers LOCK, REFRESH_LOCK, UNLOCK and RENAME_FILE, and PUT_RELATIVE as well, which takes no part in the locking but overwrites the file it is called for. GET_LOCK changes nothing, so read access to the file and to the document behind it is what it is checked for.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
Required user rights: edit_oos
curl --request POST \
--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.post(url)
print(response.text)const options = {method: 'POST'};
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 => "POST",
]);
$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("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("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::Post.new(url)
response = http.request(request)
puts response.read_body{
"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": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 413,
"type": "SUBSCRIPTION:INSUFFICIENT_CAPACITY",
"message": "Insufficient capacity",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 501,
"type": "SYSTEM:FEATURE_NOT_IMPLEMENTED",
"message": "Feature not implemented",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Headers
Response
The operation was carried out.