curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token=' \
--header 'Content-Type: application/octet-stream' \
--data '<string>'import requests
url = "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token="
payload = "<string>"
headers = {"Content-Type": "application/octet-stream"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/octet-stream'},
body: '<string>'
};
fetch('https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?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}/contents?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token="
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/octet-stream")
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}/contents?token=")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/octet-stream'
request.body = "<string>"
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"
}Take the content the online editor has written
POST /wopi/files/{file_id}/contents
Answers the WOPI PutFile call: the request body is the file’s new content, and the editor sends it every so often while somebody is typing, not only when they finish. What it writes into is the working copy of the editing session - the document’s own file and its revisions are left alone until the session is unlocked, and content sent for a stored file rather than a working copy is refused.
The write goes through only if the session still holds the lock; an unlocked file that already has content is answered with a conflict, and the current lock comes back in the X-WOPI-Lock response header. An untouched, empty file is the one case that may be written without a lock, which is what lets a newly created document receive its first content. The new version of the content is reported in the X-WOPI-ItemVersion response header.
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}/contents?token=' \
--header 'Content-Type: application/octet-stream' \
--data '<string>'import requests
url = "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token="
payload = "<string>"
headers = {"Content-Type": "application/octet-stream"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/octet-stream'},
body: '<string>'
};
fetch('https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?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}/contents?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token="
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/octet-stream")
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}/contents?token=")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/wopi/files/{file_id}/contents?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/octet-stream'
request.body = "<string>"
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
Body
The new content of the file, sent as the raw request body.
Response
The content was stored.