RocketChat API with Python
Project description
#### RocketChat API
Python API wrapper for the [Rocket chat API](https://rocket.chat/docs/developer-guides/rest-api)
[Documentation](http://rocket-python.readthedocs.io/en/latest/)
#### Install
pip install rocket-python
#### Usage
Initialize the client with a username and password. This user must have Admin privs:
from rocketchat.api import RocketChatAPI api = RocketChatAPI(settings={'username': 'someuser', 'password': 'somepassword', 'domain': 'https://myrockethchatdomain.com'})
- ##### Available Calls
api.send_message(‘message’, ‘room_id’) api.get_private_rooms() api.get_private_room_history(‘room_id’, oldest=date) api.get_public_rooms() api.get_room_info(‘room_id’) api.get_private_room_info(‘room_id’) api.get_room_history(‘room_id’) api.get_my_info()
check /rocketchat/calls/api.py for more.
#### Running Tests
py.test tests rocketchat
##### Sending a message
You’ll first need to get the _id of the room you want to send a message to. Currently, Rocket can only send messages to public rooms.
api.send_message(‘Your message’, room_id)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rocket_python-1.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125566c0d11ee091fd0132643ef4e7da0b9cd7a66e47ed4d9f038db9db428ced |
|
MD5 | 2b133ec03245c5dae1b6d4fbe4f5aba4 |
|
BLAKE2b-256 | 57b97ee308b2f2208884768a6ec59e9322ecc5f3f456a08bbb197711355a226c |