feat: more sdk methods
This commit is contained in:
@@ -6,6 +6,21 @@ get:
|
||||
description: See if an agent bot is associated to the Inbox
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Get inbox agent bot"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
bot = client.inboxes.get_agent_bot(account_id=1, inbox_id=5)
|
||||
|
||||
if bot:
|
||||
print(bot["id"], bot["name"])
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- name: id
|
||||
|
||||
@@ -5,6 +5,22 @@ summary: Remove an Agent from Inbox
|
||||
description: Remove an Agent from Inbox
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Remove agents from inbox"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
client.inboxes.agents.remove(
|
||||
account_id=1,
|
||||
inbox_id=5,
|
||||
agent_ids=[10]
|
||||
)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
|
||||
@@ -5,6 +5,25 @@ summary: Update Agents in Inbox
|
||||
description: All agents except the one passed in params will be removed
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Replace all agents in inbox"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
# Replaces ALL current agents — agents not in this list are removed
|
||||
agents = client.inboxes.agents.update(
|
||||
account_id=1,
|
||||
inbox_id=5,
|
||||
agent_ids=[10, 11]
|
||||
)
|
||||
|
||||
print(f"Inbox now has {len(agents)} agents")
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
|
||||
@@ -6,6 +6,29 @@ post:
|
||||
security:
|
||||
- userApiKey: []
|
||||
description: To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Assign an agent bot"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
client.inboxes.set_agent_bot(account_id=1, inbox_id=5, agent_bot_id=2)
|
||||
- lang: python
|
||||
label: "Remove agent bot"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
client.inboxes.set_agent_bot(account_id=1, inbox_id=5, agent_bot_id=None)
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- name: id
|
||||
|
||||
Reference in New Issue
Block a user