Pagepeek API Document
  • Introduction
    • Conventions
    • Versioning
    • Authentication
    • Rate Limits
  • Quick Start
  • Objects
  • PagePeek Document Viewer
  • API Endpoints
    • Documents
    • Knowledge Base
    • Questions
    • Users
Powered by GitBook
On this page
  1. API Endpoints

Questions

Ask Question

  • Endpoint: POST /questions/ask

  • Description: Ask a question about a specific document or knowledge base.

  • Request Body:

    • query: The question text.

    • documentId or kb_id: The ID of the document or knowledge base to query.

  • Response: Answer object containing the answer to the question.

curl -X POST \
     -H "Authorization: Bearer your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{"query": "What is the main conclusion?", "documentId": "abc123"}' \
     https://api.pagepeek.com/v1/questions/ask
{
    "question": "What is the main conclusion?",
    "answer": "The main conclusion is that...",
    "documentId": "abc123"
}

Get Question History

  • Endpoint: GET /questions/history

  • Description: Retrieve the history of questions asked by the user.

  • Response: Array of question objects containing question and answer history.

curl -X GET \
     -H "Authorization: Bearer your_api_key_here" \
     https://api.pagepeek.com/v1/questions/history
[
    {
        "question": "What is the main conclusion?",
        "answer": "The main conclusion is that...",
        "documentId": "abc123",
        "timestamp": "2023-10-01T12:00:00Z"
    },
    // ...other questions
]
PreviousKnowledge BaseNextUsers

Last updated 1 year ago