TypeScript
import { PeriskopeApi } from '@periskope/periskope-client'; const client = new PeriskopeApi({ authToken: 'YOUR_API_KEY', phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210' }); async function getFaqById() { const response = await client.knowledgeBase.getFaqById({ context_id: 'ai-context-aaauajhjdgjnomr' }); console.log(response); } getFaqById();
{ "context_id": "ai-context-aaauajhjdgjnomr", "type": "faq", "question": "How do I connect WhatsApp?", "answer": "You can connect WhatsApp by scanning the QR code in Settings.", "attachments": [ "https://example.com/image.png" ], "embedding": [ -0.020637017, -0.0148050785, 0.02985098, 0.023778915, "..." ], "created_at": "2025-01-20T10:00:00Z", "updated_at": "2025-01-20T10:00:00Z" }
Get a single FAQ entry by context_id
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The context ID of the FAQ to retrieve
"ai-context-aaauajhjdgjnomr"
200 OK
The unique identifier for this FAQ
Type of entry (faq)
The FAQ question
The FAQ answer
The vector embedding of the FAQ (Dimension: 768)
Array of attachment URLs
Creation timestamp
Was this page helpful?