Retrieve Conversation
Retrieve a single conversation.
GET /conversations/:id
Response Type
Section titled “Response Type”type InconvoConversation = { id: string; context: Record<string, number | string>; messages: { message: string; type: "text" | "chart" | "table"; id?: string; // id exists only for an Inconvo response chart?: { type: "line" | "bar"; data: { label: string; value: number; }[]; title: string; xLabel: string; yLabel: string; }; table?: { head: string[]; body: string[][]; }; }[];};
Request
import Inconvo from "@inconvoai/node";
const inconvo = new Inconvo({ apiKey: process.env.INCONVO_API_KEY});
const conversation = await inconvo.conversations.retrieve("convo_51524c88");
console.log(conversation);
{ "id": "convo_51524c88", "context": { "organisationId": 1 }, "messages": [ { "type": "text", "message": "What is our most popular product this quarter?" }, { "id": "64683e57-6601-4241-8afd-376418c84068", "type": "text", "message": "The most popular product this quarter is the iPhone 15, with 8 units ordered (from the start of this quarter to date)." } ]}