# Initialize the message client
message_client = client.get_message_client()
# Or use the alias method
message_client = client.message_client()
# Send a Slack message using the unified interface
result = message_client.send_message(
channel="slack",
integration_id="your_slack_integration_id",
to="C0920MVPWFN", # Slack channel ID
content="Hello from Definite SDK! 👋"
)
# Send a Slack message with blocks and threading
result = message_client.send_message(
channel="slack",
integration_id="your_slack_integration_id",
to="C0920MVPWFN",
content="Fallback text",
blocks=[{
"type": "section",
"text": {"type": "mrkdwn", "text": "*Important Update*"}
}],
thread_ts="1234567890.123456" # Reply in thread
)
# Or use the convenience method for Slack
result = message_client.send_slack_message(
integration_id="your_slack_integration_id",
channel_id="C0920MVPWFN",
text="Quick message using the convenience method!",
blocks=[{
"type": "section",
"text": {"type": "mrkdwn", "text": "Message with *rich* _formatting_"}
}]
)