Feedback Client
Primary HTTP API client for interacting with the CupThread developer platform.
Provides asynchronous, coroutine-based access to:
Feedback drafting and binary attachment uploads (submit, uploadAttachment)
Public application configuration and styling (fetchAppConfig)
Roadmap kanban boards and milestones (fetchColumns, fetchVersions)
Feature request submissions, filtering, and voting (fetchFeatureRequests, submitFeatureRequest, toggleVote)
Threaded feature request comments and replies (fetchComments, postComment)
What's-New changelog streams and email subscriptions (fetchChangelog, subscribeToChangelog, unsubscribeFromChangelog)
User telemetry and customer segment attributes (updateUserAttributes)
Public user profiles (fetchUserProfile)
Thread Safety and Concurrency
Every public method is a suspend function that automatically dispatches network operations on Dispatchers.IO. FeedbackClient maintains no mutable state and is safe to use concurrently from multiple coroutines. You should create a single instance during application startup and share it across your dependency injection graph.
Error Handling
All API and network failures are wrapped in subclasses of FeedbackException, allowing predictable and uniform exception handling:
FeedbackException.AuthenticationRequired: Endpoint requires an authenticated or permitted user session (HTTP 401).
FeedbackException.UnexpectedStatus: Server returned an unexpected HTTP error code.
FeedbackException.InvalidResponse: Network transport failure or malformed JSON payload.
FeedbackException.UnreadableUploadResponse: Upload succeeded but server response descriptor was unreadable.
Example Initialization
val config = FeedbackClientConfig(
baseUrl = "https://api.cupthread.com",
appKey = "app_live_yourConsoleAppKey",
defaultPlatform = FeedbackPlatform.ANDROID
)
val client = FeedbackClient(config)
val userToken = UserTokenStore.create(context).token
lifecycleScope.launch {
try {
val appConfig = client.fetchAppConfig()
println("Loaded app: ${appConfig.name}")
} catch (e: FeedbackException) {
Log.e("CupThread", "Failed to load config", e)
}
}Parameters
Immutable client configuration (FeedbackClientConfig).
Internal HTTP transport implementation; defaults to standard HttpURLConnection.
Constructors
Constructs a FeedbackClient with default HTTP URL connection transport.
Functions
Fetches public app configuration from GET /api/v1/public/config/{appKey}.
Fetches published changelog entries and release notes from GET /api/v1/public/apps/{appKey}/changelog.
Fetches the roadmap kanban columns from GET /api/v1/public/columns/{appKey}.
Fetches public comments on a feature request from GET /api/v1/feature-requests/{id}/comments.
Fetches a paginated list of public feature requests from GET /api/v1/feature-requests.
Fetches a public user profile from GET /api/v1/users/{userId}/profile.
Fetches milestone release versions from GET /api/v1/public/versions/{appKey}.
Checks whether the user has already viewed the changelog for versionOrId on this device.
Marks the changelog for versionOrId as seen on this device.
Posts a new comment or threaded @reply on a feature request via POST /api/v1/feature-requests/{id}/comments.
Prepares changelog entries and appearance styling for What's-New presentation overlays (dev.cupthread.feedback.ui.ChangelogOverlay and dev.cupthread.feedback.ui.presentLatestChangelog).
Convenience extension function that fetches console-configured What's-New copy and presents a modal bottom sheet dialog directly over an Android Activity.
Submits a completed feedback draft to POST /api/v1/feedback.
Submits a new feature request proposal to POST /api/v1/feature-requests.
Subscribes an email address to product update emails via POST /api/v1/public/apps/{appKey}/changelog/subscribe.
Toggles an upvote on a feature request via POST /api/v1/feature-requests/{id}/vote.
Unsubscribes an email address from product update emails via POST /api/v1/public/apps/{appKey}/changelog/unsubscribe.
Reports self-declared user segmentation attributes and telemetry via PUT /api/v1/public/apps/{appKey}/user.
Uploads a binary file or screenshot attachment to storage and returns a descriptor ready to be attached to a FeedbackDraft.