LogoLogo
LogoLogo
  • Adding Quack AI to your website
  • Adding Quack AI to you Help center
    • Document 360
  • Ticketing system
    • Overview - Ticketing systems
    • Zendesk
      • Setup ongoing sync
    • Front - setup ongoing sync
    • Freshdesk
    • Hubspot
  • API
    • Generating response using Quack AI
  • Chat
    • Connecting Quack AI to Zendesk Conversations API
    • Connecting Quack AI to Salesforce
  • Mobile
    • Adding Quack AI to your Swift app
    • Adding Quack AI to your Android App
    • Adding Quack AI to your React Native app
Powered by GitBook
On this page
  • Authentication
  • POST /conversation

Was this helpful?

  1. API

Generating response using Quack AI

Authentication

Authenticating to the API is done using an API key that is passed in an Authentication header. All requests to an API endpoint, must contain the following header:

Authorization: Bearer <API_KEY>

To get your API_KEY reach out to your account manager @Quack AI.

POST /conversation

Start a conversation. Optionally, send context data to initialize the session. A conversation_id will be returned in the response header.

Request:

// Headers
"X-Quack-Conversation-ID": "abc123" // if you don't have send without -> it will create a new one
// Payload example
{
  "context": {
    "user_id": "1234",
    "product_line": "Product 1"
  },
  "messages":[
  // you can put here previous messages
    {
      "content":"what integrations you support? ",
      "role":"user" // roles will always be user or assistant
    },
  ]
}
// ץא
// conversation.types.ts

type Message {
    content:string;
    role: "user" | "assistant"
}

interface ConversationRequestParams {
    context?:any,
    messages:Message[]
}

For not streamed response - add query param⇒ `stream=false`

Response ( will be streamed ):

200 Created
X-Quack-Conversation-ID: "abc123"
Content-Type: "text/plain; charset=utf-8" // It will be streamed back

In case of answer:

```
0:"Hi"
0:","
0:" This"
0:" Will"
0:" be"
0:" the response"
0:".\n\n"
0:"Quack"
0:" will"
0:" stream"
0:" it"
```

In case of escalating to agent

// the response will include toolCallId with result of "talk_to_an_agent"
```
a:{"toolCallId":"call_P9Xonb8qLaqwAursPMOHzibE","result":"talk_to_an_agent"}
```

In case of skipping ( out of scope for Quack / Quack can't answer it ):

// the response will include toolCallId with result of "skip_it"
```
a:{"toolCallId":"call_orLGhq3LG9tKkCOErl3DJJoW","result":"skip_it"}
```

PreviousHubspotNextConnecting Quack AI to Zendesk Conversations API

Last updated 6 months ago

Was this helpful?