GET
/
messages
import { ProficientClient } from "@proficient/client";

const proficient = new ProficientClient({
  apiKey: process.env.PROFICIENT_AI_PUBLISHABLE_KEY,
  userExternalId: "...", // The user's unique ID in your system
});

const interactionId = "int_53mfKtX0Da6zaJCp5bNnzxDaEg1xptWvQDr2";

const { data: messages } = await proficient.messages.list({ interactionId });
{
  "data": [
    {
      "id": "<string>",
      "object": "message",
      "content": "<string>",
      "created_at": 123,
      "depth": 123,
      "interaction_id": "<string>",
      "parent_id": "<string>",
      "sent_by": "user"
    }
  ],
  "has_more": true
}
import { ProficientClient } from "@proficient/client";

const proficient = new ProficientClient({
  apiKey: process.env.PROFICIENT_AI_PUBLISHABLE_KEY,
  userExternalId: "...", // The user's unique ID in your system
});

const interactionId = "int_53mfKtX0Da6zaJCp5bNnzxDaEg1xptWvQDr2";

const { data: messages } = await proficient.messages.list({ interactionId });

Query Parameters

interaction_id
string
required

The unique identifier of the interaction

limit
string | null

Used to specify the maximum number of objects that can be returned. Must be an integer ranging from 1 to 100. Defaults to 20.

starting_after
string | null

A pagination cursor parameter that takes an object ID as a value. This indicates the position of the list where you want to start fetching the data. For example, if your first request returns 100 objects ending with obj_100, you can use starting_after=obj_100 in your subsequent API call to retrieve the next page of the list.

Response

200
application/json
data
object[]
required
<p>Each interaction holds a number of <i>messages</i> and every message belongs to an interaction. The `sent_by` property of a message indicates whether a message was created by an agent or a user.</p>
has_more
boolean
required

Whether the database has more items after this list. If true, then you can send more paginated requests to exhaust the remaining items.