Get a document PDF embed
curl --request GET \
--url https://sacra.com/api/v1/embed/document-pdfs/ \
--header 'Authorization: <api-key>'import requests
url = "https://sacra.com/api/v1/embed/document-pdfs/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://sacra.com/api/v1/embed/document-pdfs/', 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://sacra.com/api/v1/embed/document-pdfs/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://sacra.com/api/v1/embed/document-pdfs/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sacra.com/api/v1/embed/document-pdfs/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sacra.com/api/v1/embed/document-pdfs/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"embed_html": "<iframe frameborder=\"0\" height=\"500\" src=\"https://sacra.com/embed/3056d651-fabe-43ef-81a9-d9c454975581/document/openai?height=500&width=500\" title=\"Sacra Document PDF Embed\" width=\"500\">\n</iframe>\n"
}
}{
"status": "failed",
"message": "Could not parse the request body."
}{
"status": "failed",
"message": "Document not found"
}Embeds
Get a document PDF embed
Returns embeddable HTML for a document’s PDF viewer. Requires a document_slug to identify the document.
GET
/
api
/
v1
/
embed
/
document-pdfs
/
Get a document PDF embed
curl --request GET \
--url https://sacra.com/api/v1/embed/document-pdfs/ \
--header 'Authorization: <api-key>'import requests
url = "https://sacra.com/api/v1/embed/document-pdfs/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://sacra.com/api/v1/embed/document-pdfs/', 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://sacra.com/api/v1/embed/document-pdfs/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://sacra.com/api/v1/embed/document-pdfs/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sacra.com/api/v1/embed/document-pdfs/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sacra.com/api/v1/embed/document-pdfs/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"embed_html": "<iframe frameborder=\"0\" height=\"500\" src=\"https://sacra.com/embed/3056d651-fabe-43ef-81a9-d9c454975581/document/openai?height=500&width=500\" title=\"Sacra Document PDF Embed\" width=\"500\">\n</iframe>\n"
}
}{
"status": "failed",
"message": "Could not parse the request body."
}{
"status": "failed",
"message": "Document not found"
}Authorizations
Token-based authentication with required prefix "Token"
Query Parameters
Slug of the document to embed.
Height of the embed iframe in pixels. Default: 500.
Width of the embed iframe in pixels. Default: 560.
⌘I