curl --request GET \
--url https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/', 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://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"attachment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"next_offset": 123,
"offset": 123,
"page_count": 123,
"pages": [
"<string>"
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Read pages of a PDF attached to an AI Assistant message
Read some of a PDF’s pages as text, each laid out as the page prints it: a table’s columns stay side by side and each of its rows stays one line, with the gaps between columns cut to three spaces. offset is the first page wanted, counted from zero, and limit the most to read; a read also stops at a size, so read on from next_offset. A spreadsheet has rows instead of pages. Only your own files.
curl --request GET \
--url https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/', 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://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"attachment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"next_offset": 123,
"offset": 123,
"page_count": 123,
"pages": [
"<string>"
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Path Parameters
Query Parameters
The first page wanted, counted from zero.
x >= 0How many pages to read, at most 50.
1 <= x <= 50Response
Successful Response
Some of a PDF's pages, as text.
Each page is laid out as the page prints it, so a table's rows stay one
line each, with every gap between columns cut to three spaces. offset
is where the read starts, counted from zero, next_offset where the
next one does, and page_count is the whole PDF's.
Where the next read starts, or null when this read reaches the last page. A read stops at a size as well as at limit, so this can come before offset plus limit.
The first page here, counted from zero.
Pages in the whole PDF, not in this read.
Each page's text, in page order. A page with no text is empty, and a page whose text could not be read says so.
Was this page helpful?