Code Monkey home page Code Monkey logo

woot's Introduction

woot

Woot is a simple Chatwoot API wrapper for Python. It provides an easy-to-use interface for interacting with the Chatwoot API, allowing you to perform various actions such as creating, retrieving, updating, and deleting conversations, messages, and more.

Also, if you wonder how to use it for Chatwoot webhook have a look at woothook

Installation

To install Woot, simply run:

pip install git+https://github.com/dearkafka/woot

Usage

To use Woot, you'll first need to import the Chatwoot or AsyncChatwoot class from the woot:

from woot import Chatwoot, AsyncChatwoot

Next, create an instance of Chatwoot or AsyncChatwoot by passing your Chatwoot URL and access key:

chatwoot = Chatwoot(chatwoot_url="https://your-chatwoot-instance.com", access_key="your-access-key")

Or, for the async version:

async_chatwoot = AsyncChatwoot(chatwoot_url="https://your-chatwoot-instance.com", access_key="your-access-key")

You can then access the various resources and perform actions on them as attributes of the Chatwoot or AsyncChatwoot instance.

Example1

You can also see details about specific methods, but remember woot takes keyword arguments only, no positional allowed

Example2

Resources

Woot provides access to various Chatwoot resources, such as:

  • Conversations
  • Messages
  • Contacts
  • Labels
  • Teams
  • Agents
  • And more

To access a resource, use the appropriate attribute of the Chatwoot or AsyncChatwoot instance:

conversations = chatwoot.conversations

Each resource has a set of actions that can be performed, such as list, create, update, and delete. To perform an action, simply call the corresponding method on the resource:

all_conversations = conversations.list(account_id=1)

API Documentation

To view the available actions and their corresponding API endpoints for each resource, simply print the Chatwoot or AsyncChatwoot instance:

print(chatwoot)

This will display a list of available actions, their HTTP methods, and API endpoints.

Example

Here's an example demonstrating how to use Woot to list all conversations:

from woot import Chatwoot

chatwoot_url = "https://your-chatwoot-instance.com"
access_key = "your-access-key"

chatwoot = Chatwoot(chatwoot_url=chatwoot_url, access_key=access_key)

conversations = chatwoot.conversations
all_conversations = conversations.list(account_id=1)

print(all_conversations)

Project is influenced by and borrowed from simple_rest_client and in fact started by using it as it is, but then I decided to make it more Chatwoot specific and add some features that I needed.

License

The project is licensed under the Cooperative Non-Violent Public License v7 or later (CNPLv7+) - see the LICENSE for details. Built for people, not corporations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.