agoras.core.api_base module¶
Base API class for platform API client implementations.
Package Overview¶
The agoras.core.api_base module provides the BaseAPI class that serves as the foundation for all platform-specific API clients. Platform implementations in agoras-platforms extend this class.
Note
Platform APIs Moved: Platform-specific API managers have moved to agoras-platforms. See agoras.platforms package for platform API documentation.
agoras.core.api_base module¶
- class agoras.core.api_base.BaseAPI(**credentials)[source]¶
Bases:
ABCAbstract base class for social network API implementations.
Provides common functionality and patterns for API interactions including authentication, rate limiting, and error handling.
- abstract async authenticate()[source]¶
Authenticate with the API asynchronously.
- Returns:
BaseAPI: Self for method chaining
- Raises:
Exception: If authentication fails
- abstract async delete(post_id, *args, **kwargs)[source]¶
Delete a post from the social media platform.
- Args:
post_id (str): ID of the post to delete
- Returns:
str: Post ID
- Raises:
Exception: If deletion fails or not supported
- is_authenticated()[source]¶
Check if API is authenticated.
- Returns:
bool: True if authenticated, False otherwise
- abstract async like(post_id, *args, **kwargs)[source]¶
Like/react to a post on the social media platform.
- Args:
post_id (str): ID of the post to like
- Returns:
str: Post ID
- Raises:
Exception: If liking fails or not supported
- abstract async post(*args, **kwargs)[source]¶
Create a post on the social media platform.
- Returns:
str: Post ID
- Raises:
Exception: If posting fails
Share/repost a post on the social media platform.
- Args:
post_id (str): ID of the post to share
- Returns:
str: Share/Post ID
- Raises:
Exception: If sharing fails or not supported