Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add webhook docs #818

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 102 additions & 3 deletions docs/api-reference/webhooks/types.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Event Types"
description: "List of the supported webhook types"
icon: "globe"
title: 'Event Types'
description: 'List of the supported webhook types'
icon: 'globe'
---

`conversation.started`
Expand Down Expand Up @@ -143,4 +143,103 @@ When a third-party software agent responds to a previously handed-off conversati
}
```
</Accordion>
-----

`phone.incoming_call_started`

This event is triggered when an incoming call is initiated, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```typescript
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format all events and make sure there are no syntax errors

event: "phone.incoming_call_started";
organization_id: string;
data: {
type: 'AI' | 'human_agent';
id: string;
direction: 'Incoming';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>

---

`phone.outgoing_call_started`

This event is triggered when an outgoing call is initiated, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```typescript
{
event: "phone.outgoing_call_started";
organization_id: string;
data: {
type: 'human_agent';
id: string;
direction: 'Outgoing';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>

---


`phone.incoming_call_ended`

This event is triggered when an incoming call ends, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```typescript
{
event: "phone.incoming_call_ended";
organization_id: string;
data: {
type: 'AI' | 'human_agent';
id: string;
direction: 'Incoming';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>

---

`phone.outgoing_call_ended`

This event is triggered when an outgoing call ends, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```typescript
{
event: "phone.outgoing_call_ended";
organization_id: string;
data: {
type: 'human_agent';
id: string;
direction: 'Outgoing';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>
158 changes: 158 additions & 0 deletions docs/dashboard/zapier-integration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
title: "Zapier"
icon: "asterisk"
description: "Open is integrated with Zapier! You can automate multiple Open actions and triggers using zapier.com and using OpenCX app."
---

This guide shows you how to create your own zaps using Open's Action and Triggers.

A Zapier zap consists of a Trigger and an Action.

Zapier Triggers allows you to do an action when something happens.

Zapier Action is an action that happens when a trigger is activated.

## Open Actions
<CardGroup cols={2}>
<Card
title="Create a contact"
icon="user-plus"
color="#f7b245"
iconType="solid"
>
Create a new contact to be stored in your Open Dashboard.
</Card>
<Card
title="Delete a contact"
icon="user-minus"
color="#f7b245"
iconType="solid"
>
Deletes a contact from your contact list.
</Card>
<Card
title="List contacts"
icon="user-group"
color="#f7b245"
iconType="solid"
>
Lists all your contacts.
</Card>
<Card
title="Create Chat Session"
icon="message-plus"
color="#f7b245"
iconType="solid"
>
Creates a chat session with a contact in any type of channel
</Card>
<Card
title="List Chat Sessions"
icon="messages"
color="#f7b245"
iconType="solid"
>
Lists all chat sessions of organization.
</Card>
<Card
title="List Chat Session History"
icon="messages"
color="#f7b245"
iconType="solid"
>
Lists the history of a particular chat session
</Card>
<Card
title="Make AI Phone Call"
icon="phone"
color="#f7b245"
iconType="solid"
>
Make an AI phone call using your phone number created in Open
</Card>
<Card
title="Send Emails"
icon="envelope"
color="#f7b245"
iconType="solid"
>
Send emails to multiple contacts, possibly with a time delay. To send emails using the API, you must first verify the domain you want to send emails from. You can add and verify custom domains in the settings.
</Card>
</CardGroup>


## Open Triggers
<CardGroup cols={2}>
<Card
title="Conversation Started"
icon="messages"
color="#f7b245"
iconType="solid"
>
Is triggered when a new conversation of any channel type starts
</Card>
<Card
title="Conversation Ended"
icon="messages"
color="#f7b245"
iconType="solid"
>
Is triggered when a new conversation of any channel type ends
</Card>
<Card
title="Handoff to Human Agent"
icon="user-headset"
color="#f7b245"
iconType="solid"
>
Triggers when a conversation is handed off to a human agent. Note that a handoff event can happen for multiple reasons; for example, a human agent might decide to take over the conversation, or the AI might decide to hand off the conversation to a human agent.
</Card>
</CardGroup>



## Steps for creating you first Zap using Open's Actions and Triggers

### Creating a Zap using one of Open's Triggers
<Steps>
<Step title="Go to you Zapier Zaps Dashborad">
<img src="/images/zapier-zaps.png" style={{ borderRadius: '8px' }} />
Firstly go to your Zapier Zaps Dashboard using [this](https://zapier.com/app/zaps) link, and signup if you do not have an account.
</Step>
<Step title="Create a new Zap">
Click on the "+ Create" button on the top right to create a new Zap. The following screen should now be visible.
<img src="/images/zap-preview.png" style={{ borderRadius: '8px' }} />
Press on the box with the title "Trigger"
</Step>
<Step title="Choosing Open's Triggers">
This screen should now be visible.
<img src="/images/zapier-app-search.png" style={{ borderRadius: '8px' }} />
In the search bar type "OpenCX" and our app should be visible to choose.
<img src="/images/zapier-choose-trigger.png" style={{ borderRadius: '8px' }} />
Choose this app.
</Step>
<Step title="Choosing Open's Triggers">
This screen should now be visible.
<img src="/images/choose-open-option.png" style={{ borderRadius: '8px' }} />
After choosing one of our triggers for this example we chose "Conversation Started", you will then press on the sign in button below to sign in using you Open Account so we can verify your identity.
You will then be redirected to this page
<img src="/images/zapier-login.png" style={{ borderRadius: '8px' }} />
Here we request an API key that is connected to you open account. To get this API key simply go to your [Open account](https://cloud.opencopilot.so/) and then go to the settings
<img src="/images/open-settings.png" style={{ borderRadius: '8px' }} />
Then choose "API Token" from the left menu
<img src="/images/open-settings-api-tokens.png" style={{ borderRadius: '8px' }} />
Press "Add" to add a new token, choose a name for this token. Copy the generated token and store it in a safe place, then paste it in the Zapier Login Screen like so.
<img src="/images/zapier-login-added-api-key.png" style={{ borderRadius: '8px' }} />
Then press continue and you will be immediatly redirected to your Zap.

Your trigger part of the Zap is now setup and ready!
</Step>
</Steps>

### Creating a Zap using one of Open's Actions

For actions you will do the exact same steps as Triggers with the exception that you will be choosing Action instead.




Binary file added docs/images/choose-open-option.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/open-settings-api-tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/open-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/zap-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/zapier-app-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/zapier-choose-trigger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/zapier-login-added-api-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/zapier-login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/zapier-zaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 2 additions & 11 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"group": "Native Integrations",
"pages": [
"dashboard/zendesk_integration",
"dashboard/shopify_integration"
"dashboard/shopify_integration",
"dashboard/zapier_integration"
]
},
{
Expand All @@ -91,16 +92,6 @@
"api-reference/contacts/update"
]
},
{
"group": "Phone",
"icon": "phone",
"pages": [
"api-reference/phone/buy",
"api-reference/phone/get-all-phones",
"api-reference/phone/delete",
"api-reference/phone/update"
]
},
{
"group": "Email",
"icon": "envelope",
Expand Down