wrapper for micorsoft teams graph api's
Project description
TeamsGraphApi
TeamsGraphApi is a wrapper for microsoft graph's RESTful web API that enables you to access microsoft teams for general uses
Installation
TeamsGraphApi requires python 3.6+ to run.
You can install TeamsGraphApi with all the optional dependencies using pip:
pip install TeamsGraphApi
With TeamsgraphApi you can only access below Api's
Features
-
get_teams
-
get_channels
-
list_all_members_of_channel
-
get_messages_of_channels
-
get_messages_details_of_channels
-
get_replies_of_a_messages
Usage
from graphapi.graph import GraphAPI
graph_obj = GraphAPI(Auth_Token)
graph_obj.get_teams()
from the above code we first we import GraphAPI class from graph module
after we need to initialize the instance of this class by passing Authentication token in it
then we can use it's method you can also verify all existing methods using inbuild dir method
As we listed all the available api's above :
so now we will cover basics of each api's that how we can use them
- get_teams
To use this we don't need to pass any extra arguments if you are authenticated user you can simply get all the joined teams using below method.
graph_obj.get_teams()
- get_channels
Channels are related to a team so if you want to access a channel then you have to pass team_id as a arguments eg.
graph_obj.get_channels(team_id)
- list_all_members_of_channel
listing all members of channel required team_id and channel_id as a arguments eg.
graph_obj.list_all_members_of_channel(team_id, channel_id)
- get_messages_of_channels
listing all messages of channel required team_id and channel_id as a arguments eg.
graph_obj.get_messages_of_channels(team_id, channel_id)
** TeamsGraphapi supports query params for message Api, in get_messages_of_channels query param will be the last argument in this method which will be passed in the form of dictionary
eg. graph_obj.get_messages_of_channels(team_id, channel_id, {"$top": 10 })
- get_messages_details_of_channels
To get message details use this method with these team_id , channel_id , message_id arguments
graph_obj.get_messages_details_of_channels(team_id, channel_id, message_id)
- get_replies_of_a_messages
to get replies of message we need a team and a channel where the message reside and when we want replies of a message so we also need a message to get its reply so arguments we now need are team_id, channel_id, message_id get_replies_of_a_message also works with query params similar to - get_messages_of_channels passed dictionary must be the last argument in the method eg.
graph_obj.get_replies_of_a_messages(team_id, channel_id, message_id)
License
MIT
✨Keep Learning✨
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
Built Distribution
Hashes for teamsgraphapi-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 656e0222128f37a5cbbe813da669b257cbb7b2dcf01e29e0be4f5fc376a1fbff |
|
MD5 | 6ab0a7faf114c0895a4111290bf91055 |
|
BLAKE2b-256 | f9aea889c0465dd6c506c9253d81f397bf29c9e6cb03ba069de4bd51b3590a56 |