Skip to main content

Swit.io API client

Project description

Pyswit: Python + Swit.io

Python interface for Swit.io RESTful API

PyPI PyPI download month PyPI format PyPI pyversions PyPI license


Requirements

This library requires Python 3.6 or later.

Installation

$ pip install pyswit

Authentication

Examples

from pyswit import Pyswit

access_token = "<your access token>"
swit = Pyswit(access_token)

# User
print(swit.user.info())

# Create a message
channel_id = "<your_channel_id>"  # not channel name
response = swit.message.create(channel_id=channel_id, content="Hello, World!")

# Get message_id
message_id = response["data"]["message"]["message_id"]

# React to a message
swit.message.reaction.create(message_id=message_id, reaction_name=":smile:")

# Comment on a message
swit.message.comment.create(message_id=message_id, content="Comment string here")

Webhook

Pyswit supports webhook.

Webhook API does not require access token

curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' <your_webhook_url>

The above curl request can be implemented with pyswit as follows.

from pyswit.webhook import webhook

webhook_url="<your_webhook_url>"
webhook(url=webhook_url, text="Hello, World!")

Documentation

Swit.io Developer documentation

  • Currently, Pyswit supports the following API.
HTTP endpoint pyswit
Users GET user.info :white_check_mark:
Workspaces GET workspace.info :white_check_mark:
GET workspace.list :white_check_mark:
POST workspace.update :white_check_mark:
GET workspace.user.info :white_check_mark:
GET workspace.user.list :white_check_mark:
POST workspace.user.update :white_check_mark:
Channels POST channel.archive :white_check_mark:
POST channel.create :white_check_mark:
POST channel.createDirect :white_check_mark:
GET channel.info :white_check_mark:
GET channel.list :white_check_mark:
POST channel.update :white_check_mark:
Messages POST message.comment.create :white_check_mark:
GET message.comment.list :white_check_mark:
POST message.comment.remove :white_check_mark:
POST message.create :white_check_mark:
GET message.info :white_check_mark:
GET message.list :white_check_mark:
POST message.reaction.create :white_check_mark:
POST message.reaction.remove :white_check_mark:
POST message.remove :white_check_mark:
Ideas POST idea.comment.create :white_check_mark:
GET idea.comment.list :white_check_mark:
POST idea.comment.remove :white_check_mark:
POST idea.create :white_check_mark:
GET idea.info :white_check_mark:
GET idea.list :white_check_mark:
POST idea.remove :white_check_mark:
POST idea.reaction.create :white_check_mark:
POST idea.reaction.remove :white_check_mark:
Projects POST project.archive :white_check_mark:
POST project.create :white_check_mark:
GET project.info :white_check_mark:
GET project.list :white_check_mark:
GET project.tagList :white_check_mark:
POST project.update :white_check_mark:
GET project.user.list :white_check_mark:
Project buckets POST project.bucket.create :white_check_mark:
GET project.bucket.info :white_check_mark:
GET project.bucket.list :white_check_mark:
POST project.bucket.update :white_check_mark:
Tasks POST task.assignee.add :white_check_mark:
POST task.asignee.remove :white_check_mark:
POST task.checklist.create :white_check_mark:
GET task.checklist.info :white_check_mark:
GET task.checklist.list :white_check_mark:
POST task.checklist.remove :white_check_mark:
POST task.checklist.update :white_check_mark:
POST task.comment.create :white_check_mark:
GET task.comment.list :white_check_mark:
POST task.comment.remove :white_check_mark:
POST task.comment.update :white_check_mark:
POST task.create :white_check_mark:
POST task.follow.add :white_check_mark:
POST task.follow.remove :white_check_mark:
GET task.info :white_check_mark:
GET task.list :white_check_mark:
GET task.listByColumn :white_check_mark:
POST task.move :white_check_mark:
GET task.myTaskList :white_check_mark:
POST task.remove :white_check_mark:
POST task.update :white_check_mark:
Posts :x:
Boards :x:
Custom fileds :x:
Approvals :x:
  • Advanced Only API: Posts, Boards, Custom fileds, Approvals
  • Pyswit has no plan to support Advanced Only API

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyswit-1.0.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file pyswit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyswit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pyswit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 307e31c28fae9e194e9d5882a784c818b4ab215e524434c90cc0b0d9f97cbe4b
MD5 bf8e4c541f6874f1e82f294232aa23b5
BLAKE2b-256 0f75f577347534ac0376d5273aa7ebc5f7a93f3b4ed12d94e95eb1d4a462131b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page