SDKs overview
TamTam provides developers with SDKs and libraries to facilitate interaction with its platform, primarily through the TamTam Bot API. These SDKs abstract the complexities of HTTP requests, JSON parsing, and authentication, allowing developers to focus on application logic. The available SDKs support various programming languages, enabling a broad range of custom integrations and bot development.
The Bot API itself supports functionalities such as sending and receiving messages, managing chats, handling media, and processing user interactions within the TamTam ecosystem. Developers can leverage these tools to build automated assistants, integrate with external services, or extend TamTam's capabilities for secure team communication and private enterprise messaging.
While official SDKs are provided and maintained by TamTam, a community ecosystem also contributes additional libraries and tools. These community-driven projects can offer alternative implementations, specialized features, or support for languages not officially covered. Information on the official SDKs is consistently updated within the TamTam developer documentation, providing a definitive resource for implementation details.
Official SDKs by language
TamTam offers official SDKs for several programming languages, designed to streamline development against the TamTam Bot API. These SDKs are maintained to reflect the latest API changes and best practices. The following table provides an overview of the officially supported SDKs, including their respective package names and typical installation commands.
| Language | Package Name | Installation Command | Maturity |
|---|---|---|---|
| Python | tamtam.chat.sdk |
pip install tamtam.chat.sdk |
Stable |
| Java | chat.tamtam.botapi |
Add to pom.xml or build.gradle |
Stable |
| PHP | tamtam/api-php-sdk |
composer require tamtam/api-php-sdk |
Stable |
| Go | github.com/tamtam-chat/go-tamtam-botapi |
go get github.com/tamtam-chat/go-tamtam-botapi |
Stable |
| Ruby | tamtam-bot-api |
gem install tamtam-bot-api |
Stable |
Each SDK provides language-specific client libraries, helper functions for API calls, and object models for handling TamTam entities like messages, chats, and users. Developers are advised to consult the official TamTam API reference for detailed usage instructions and specific method signatures for each SDK.
Installation
Installing TamTam SDKs typically follows the standard package management practices for each respective language. Below are generalized instructions for the official SDKs. For the most up-to-date and specific instructions, always refer to the TamTam official documentation for each SDK.
Python
The Python SDK can be installed using pip, the Python package installer. Ensure you have Python and pip installed on your system.
pip install tamtam.chat.sdk
Java
For Java projects, the SDK is typically managed via Maven or Gradle. You need to add the dependency to your project's pom.xml (Maven) or build.gradle (Gradle) file.
Maven (pom.xml):
<dependency>
<groupId>chat.tamtam.botapi</groupId>
<artifactId>tamtam-botapi</artifactId>
<version>0.3.0</version> <!-- Check for the latest version -->
</dependency>
Gradle (build.gradle):
implementation 'chat.tamtam.botapi:tamtam-botapi:0.3.0' // Check for the latest version
PHP
The PHP SDK is installed using Composer, the dependency manager for PHP.
composer require tamtam/api-php-sdk
Go
For Go projects, you can use the go get command to fetch and install the SDK.
go get github.com/tamtam-chat/go-tamtam-botapi
Ruby
The Ruby SDK is installed as a gem using the gem install command.
gem install tamtam-bot-api
Quickstart example
This Python example demonstrates how to initialize the TamTam Bot API client and send a simple text message to a specific chat. Before running, ensure you have a TamTam bot token, which can be obtained by creating a bot through the TamTam Bot API registration process.
from tamtam.chat.sdk.api import TamTamBot
from tamtam.chat.sdk.models import NewMessageBody, ChatId
import os
# Replace with your actual bot token and chat ID
BOT_TOKEN = os.environ.get("TAMTAM_BOT_TOKEN")
TARGET_CHAT_ID = os.environ.get("TAMTAM_TARGET_CHAT_ID") # Example: 123456789
if not BOT_TOKEN or not TARGET_CHAT_ID:
print("Please set TAMTAM_BOT_TOKEN and TAMTAM_TARGET_CHAT_ID environment variables.")
exit()
# Initialize the TamTam Bot API client
bot = TamTamBot(token=BOT_TOKEN)
try:
# Create a new message body with text content
message_body = NewMessageBody(text="Hello from TamTam Python SDK!")
# Specify the target chat ID
chat_id_obj = ChatId(TARGET_CHAT_ID)
# Send the message
response = bot.send_message(message_body, chat_id=chat_id_obj)
if response.message:
print(f"Message sent successfully! Message ID: {response.message.message_id}")
else:
print(f"Failed to send message: {response}")
except Exception as e:
print(f"An error occurred: {e}")
This example demonstrates a basic interaction: client initialization, message construction, and sending. More complex interactions, such as handling incoming webhooks, parsing various message types, or managing chat members, would involve additional SDK methods and event listeners. Developers can find comprehensive examples and API details in the TamTam Bot API documentation.
Community libraries
Beyond the official SDKs, the TamTam developer community has contributed various client libraries and tools. These community-driven projects can offer alternative approaches, specialized functionalities, or support for languages and frameworks not officially covered by TamTam. While official SDKs are maintained directly by TamTam, community libraries are maintained by their respective creators.
When considering a community library, it is advisable to evaluate its active maintenance, documentation quality, and alignment with the latest TamTam Bot API specifications. Resources like GitHub and public package repositories are common places to discover these contributions. For instance, developers can explore the broader ecosystem of messaging API clients, which often includes community-contributed wrappers or integrations for platforms like TamTam, as detailed by resources such as MDN Web Docs on WebSockets for real-time communication patterns.
Examples of potential community contributions (specific libraries would need to be searched for on platforms like GitHub or package managers):
- Unofficial client wrappers: Libraries that wrap the TamTam API in languages not officially supported or provide a different API paradigm.
- Framework integrations: Modules or plugins that integrate TamTam bots with specific web frameworks (e.g., a Django or Flask extension for Python).
- Utility tools: Helper scripts or libraries for common bot development tasks, such as webhook setup, command parsing, or rich media handling.
Developers are encouraged to exercise due diligence when using community-contributed code, verifying its security, stability, and compatibility with their project requirements. The TamTam developer portal remains the authoritative source for API specifications.