feat: add sdk examples for team, inboxes and agents
This commit is contained in:
@@ -5,6 +5,25 @@ summary: Add a New Agent
|
||||
description: Add a new Agent to Account
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Add a new agent"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
agent = client.agents.add(
|
||||
account_id=1,
|
||||
name="John Doe",
|
||||
email="john@example.com",
|
||||
role="agent"
|
||||
)
|
||||
|
||||
print(agent.id, agent.name)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
|
||||
@@ -5,6 +5,18 @@ summary: Remove an Agent from Account
|
||||
description: Remove an Agent from Account
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Remove an agent"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
client.agents.remove(account_id=1, agent_id=10)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
|
||||
@@ -5,6 +5,21 @@ summary: List Agents in Account
|
||||
description: Get Details of Agents in an Account
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "List all agents"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
agents = client.agents.list(account_id=1)
|
||||
|
||||
for agent in agents:
|
||||
print(agent.name, agent.role)
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
|
||||
@@ -5,6 +5,25 @@ summary: Update Agent in Account
|
||||
description: Update an Agent in Account
|
||||
security:
|
||||
- userApiKey: []
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: "Update an agent"
|
||||
source: |
|
||||
from chatwoot import ChatwootClient
|
||||
|
||||
client = ChatwootClient(
|
||||
base_url="https://app.chatwoot.com",
|
||||
api_token="your-api-token"
|
||||
)
|
||||
|
||||
agent = client.agents.update(
|
||||
account_id=1,
|
||||
agent_id=10,
|
||||
name="Jane Doe",
|
||||
role="administrator"
|
||||
)
|
||||
|
||||
print(agent.id, agent.role)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
|
||||
Reference in New Issue
Block a user