ChatCX Docs
  • 📌 Introduction
  • 📍 API Documentation / Endpoints Overview
    • 🔑 Authentication
    • 📝 Submit a Query
    • ⏳ Check Job Status
    • 🛠 Integration Guide
    • 🏗 Error Handling
    • 🔑 Manage API Keys (Admin Only)
    • 🛠 Admin API Endpoints
  • 💡 How ChatCX Works
  • 🚀 ChatCX Chat
  • 🦜 Crypto Parrot - AI-Powered Web3 News Feed
  • 📖 What Can ChatCX Answer?
  • 🚀 What Are the Possibilities with ChatCX?
  • 🤖 What Else Can You Do with ChatCX?
Powered by GitBook
On this page
  • Step 1: Submit a Query
  • Step 2: Poll for Status
  1. 📍 API Documentation / Endpoints Overview

🛠 Integration Guide

Step 1: Submit a Query

const response = await axios.post(API_URL, { query: "DeFi trends" }, {
  headers: { "x-api-key": API_KEY }
});
const jobId = response.data.jobId;

Step 2: Poll for Status

const statusResponse = await axios.get(`${API_URL}/status/${jobId}`, {
  headers: { "x-api-key": API_KEY }
});
if (statusResponse.data.status === "completed") {
  console.log(statusResponse.data.result.answer);
}
Previous⏳ Check Job StatusNext🏗 Error Handling

Last updated 4 months ago