feat: add sdk examples for team, inboxes and agents
This commit is contained in:
@@ -8,6 +8,24 @@ post:
|
||||
- userApiKey: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Create an API inbox"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
inbox = client.inboxes.create(
|
||||
account_id=1,
|
||||
name="Support Inbox",
|
||||
channel_type="api"
|
||||
)
|
||||
|
||||
print(inbox.id, inbox.name)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
|
||||
@@ -8,6 +8,21 @@ get:
|
||||
- userApiKey: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "List all inboxes"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
inboxes = client.inboxes.list(account_id=1)
|
||||
|
||||
for inbox in inboxes:
|
||||
print(inbox.id, inbox.name)
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
|
||||
@@ -14,6 +14,20 @@ get:
|
||||
type: number
|
||||
description: ID of the inbox
|
||||
required: true
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Get an inbox"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
inbox = client.inboxes.get(account_id=1, inbox_id=5)
|
||||
|
||||
print(inbox.name, inbox.channel_type)
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
|
||||
@@ -14,6 +14,25 @@ patch:
|
||||
type: number
|
||||
description: ID of the inbox
|
||||
required: true
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Update an inbox"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
inbox = client.inboxes.update(
|
||||
account_id=1,
|
||||
inbox_id=5,
|
||||
name="Updated Inbox Name",
|
||||
enable_auto_assignment=True
|
||||
)
|
||||
|
||||
print(inbox.id, inbox.name)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
|
||||
Reference in New Issue
Block a user