Skip to main content

Microsoft Communication Rooms Client Library for Python

Project description

Azure Communication Rooms client library for Python

This package contains a Python SDK for Azure Communication Services for Rooms. Read more about Azure Communication Services here

Disclaimer

Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691

Key concepts

The Azure Communication Rooms package is used to do following:

  • Create scheduled meetings
  • Create meetings with managed permissions for its participants

Getting started

Installating the package

python -m pip install azure-communication-rooms

Prequisites

Client Initialization

To initialize the Rooms Client, the connection string can be used to instantiate.

from azure.communication.rooms import RoomsClient

client = RoomsClient.from_connection_string(conn_str='<connection_str>' )

Examples

Key parameters

  • valid_from: A datetime object from which room will start existing
  • valid_until: A datetime object after which room meeting would end
  • room_join_policy: The join policy of the room. Allows only participants or any communication service users to join
  • participants: A list of RoomParticipant containing MRI's of invitees to the room All the above attributes are optional. The service provides default values of valid_until and valid_from if they are missing.

Create Room

from azure.communication.rooms import RoomsClient
from azure.core.exceptions import HttpResponseError
from datetime import datetime, timedelta

client = RoomsClient.from_connection_string(conn_str='<connection_str>')
try:
    response = client.create_room(
        valid_from=datetime.now(),
        valid_until=valid_from + timedelta(weeks=4)
        participants=["first-participant", "second-participant"]
    )
except HttpResponseError as e:
    print('service responds error: {}'.format(e))

Update Room

from azure.communication.rooms import RoomsClient
from azure.core.exceptions import HttpResponseError
from datetime import datetime, timedelta

client = RoomsClient.from_connection_string(conn_str='<connection_str>')
try:
    response = client.update_room(
        room_id="id of the room to be updated",
        valid_from=datetime.now(),
        valid_until=valid_from + timedelta(weeks=4)
    )
except HttpResponseError as e:
    print('service responds error: {}'.format(e))

Delete a Room

from azure.communication.rooms import RoomsClient
from azure.core.exceptions import HttpResponseError

client = RoomsClient.from_connection_string(conn_str='<connection_str>' )
try:
    client.delete_room(
        room_id="id of the room to be deleted")
except HttpResponseError as e:
    print('service responds error: {}'.format(e))

Add participants to Room

from azure.communication.rooms import RoomsClient
from azure.core.exceptions import HttpResponseError

client = RoomsClient.from_connection_string(conn_str='<connection_str>' )
try:
    response = client.add_participants(
        room_id="id of the room to be updated",
        participants=["new-participant-one", "new-participant-two"]
    )
except HttpResponseError as e:
    print('service responds error: {}'.format(e))

Please take a look at the samples directory for detailed examples of how to use this library to create and manage rooms.

Troubleshooting

Rooms operations will throw an exception if the request to the server fails. The Rooms client will raise exceptions defined in Azure Core.

Next steps

More sample code

More examples are coming soon...

Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Project details


Download files

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

Source Distribution

azure-communication-rooms-1.0.0b2.zip (96.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file azure-communication-rooms-1.0.0b2.zip.

File metadata

  • Download URL: azure-communication-rooms-1.0.0b2.zip
  • Upload date:
  • Size: 96.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.28.1 setuptools/58.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.13

File hashes

Hashes for azure-communication-rooms-1.0.0b2.zip
Algorithm Hash digest
SHA256 38cd2422c2b9321f1f969a6f4346365db15c7b11f6c4d9deeca469fe7e142651
MD5 4c43750f3653fa7c03b0bead2a753142
BLAKE2b-256 963acfdd5e62dc37f436f6f01dcf3e37c5d919cf94cbea88b63f317313094e0d

See more details on using hashes here.

File details

Details for the file azure_communication_rooms-1.0.0b2-py3-none-any.whl.

File metadata

  • Download URL: azure_communication_rooms-1.0.0b2-py3-none-any.whl
  • Upload date:
  • Size: 65.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.28.1 setuptools/58.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.13

File hashes

Hashes for azure_communication_rooms-1.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 d23c42242ef3ba8bcd7b9aa46c9e3bb754f0dc238f6ef88be70821092dd46219
MD5 3a8c04740dd83433ff6772dc1f09da10
BLAKE2b-256 05e7ccf32829fbd01a01cc76b4ffb563ac12cdd39fe9f815d90b8b867ab2ca59

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