Replace app content on a draft
curl --request PUT \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app', 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://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "<string>",
"status": 403
}{
"detail": "<string>",
"status": 404
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}App APIs
Replace app content on a draft
This API is currently in development and may change.
Replace the app HTML on an existing draft. If the specified document does not yet have an app, one will be created.
PUT
/
v2
/
documents
/
{documentId}
/
draft
/
{draftId}
/
app
Replace app content on a draft
curl --request PUT \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app', 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://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "<string>",
"status": 403
}{
"detail": "<string>",
"status": 404
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}Authorizations
bearerAuthorgApiKey
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Path Parameters
Draft workbook identifier. Use List document drafts to retrieve draft IDs.
Example:
"def456"
Published document identifier.
Example:
"abc123"
Response
App written on the draft.
Was this page helpful?

