TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.knowledgeBase.createDocument({
document: {
url: 'https://example.com/files/product-faq.pdf',
},
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/knowledge-base/document/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"document": {
"url": "https://example.com/files/product-faq.pdf"
}
}'[
{
"file_name": "product-faq.pdf",
"document_id": "00000000-0000-0000-0000-000000000000",
"file_path": "org-assets/00000000-0000-0000-0000-000000000000/ai_assets/documents/00000000-0000-0000-0000-000000000000/product-faq.pdf",
"chunks_count": 12
}
]Knowledge Base APIs
Create Document
Ingests a PDF into the AI knowledge base. Provide the document as exactly one of document.url, document.base64 or document.file.
TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.knowledgeBase.createDocument({
document: {
url: 'https://example.com/files/product-faq.pdf',
},
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/knowledge-base/document/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"document": {
"url": "https://example.com/files/product-faq.pdf"
}
}'[
{
"file_name": "product-faq.pdf",
"document_id": "00000000-0000-0000-0000-000000000000",
"file_path": "org-assets/00000000-0000-0000-0000-000000000000/ai_assets/documents/00000000-0000-0000-0000-000000000000/product-faq.pdf",
"chunks_count": 12
}
]Authorizations
Body
application/json
Response
The processing result for the uploaded document
Was this page helpful?