Programmatic Access to Session Data
The Entrupy Android SDK provides authentication data in three ways: the Detail View Controller for individual item details, fetchSessionDetails for your own UI, and the Entrupy API from your backend.
Overview
Authentication data flows through three channels:
- SDK UI (client-side): The Detail View displays authentication results and item details scoped to the logged-in user.
fetchSessionDetails(client-side): Returns the full result for one Entrupy ID, so you can show parts of it in your own screens.- Entrupy API (server-side): Your backend receives authentication results and status updates via webhooks, and can query the API for cross-user reporting and data synchronization.
1. SDK UI Components
Detail View
For individual item details, launch the Detail View using an Entrupy ID:
import com.entrupy.sdk.app.EntrupyApp
fun showItemDetails(entrupyId: String) {
EntrupyApp.sharedInstance().displayDetailViewForItem(entrupyId)
}
The Detail View displays:
- Authentication result (Authentic, Unknown, Not Supported, etc.)
- Item metadata (brand, item type, style)
- Processing status and timeline
- Certificate access (for authentic items)
- Flag status and support features
2. Fetch Session Details by Entrupy ID
Use fetchSessionDetails to get the full result of one item, including its timeline. The user must be logged in.
import com.entrupy.sdk.app.EntrupyApp
import com.entrupy.sdk.listeners.SessionDetailsCallback
import com.entrupy.sdk.model.EntrupyCaptureResult
fun loadSessionDetails(entrupyId: String) {
EntrupyApp.sharedInstance().fetchSessionDetails(
entrupyId,
object : SessionDetailsCallback {
override fun onSessionDetailsFetched(result: EntrupyCaptureResult) {
val brand = result.properties?.brand?.displayName
val header = result.status?.result?.display?.header
println("${result.entrupyId}: $brand, $header")
}
override fun onSessionDetailsError(errorCode: Int, description: String) {
println("Fetch failed ($errorCode): $description")
}
},
)
}
How the callback behaves:
- Exactly one of the two methods is called, on the main thread. The one exception is
SDK_NOT_INITIALIZED, which is reported right away on the calling thread. - If you call
EntrupyApp.cleanup()while a fetch is running, the fetch is dropped and neither method is called.
Error Codes
errorCode is one of the EntrupyErrorCode constants (com.entrupy.sdk.listeners.EntrupyErrorCode):
| Code | When |
|---|---|
SDK_NOT_INITIALIZED | EntrupyApp.init was not called yet |
BAD_REQUEST | The Entrupy ID is empty, or the backend answered 400 |
UNAUTHORIZED_ACCESS | The user is not logged in, or the backend answered 401 |
FORBIDDEN | The session ended during the fetch, or the user cannot see this item. This is also the answer for an Entrupy ID that does not exist |
NOT_FOUND, TOO_MANY_REQUESTS | The backend answered 404 or 429 |
SERVICE_UNAVAILABLE | The backend answered 503 |
INTERNAL_SERVER_ERROR | The backend answered any other 5xx |
UNKNOWN_ERROR | Any other status, such as 409 or 422, or no HTTP status at all, for example when the device is offline |
description is the backend's own message when it sent one, and a short English message otherwise.
3. Authentication Data Model
fetchSessionDetails returns an EntrupyCaptureResult (com.entrupy.sdk.model). Only the SDK creates it. Any field the backend can leave out is nullable or an empty list, so check for null before you use a value.
| Property | Description |
|---|---|
entrupyId | The Entrupy ID of the item, for example T8GV7QKJ |
sessionUuid | The capture session identifier |
properties | Brand, model and category (function) of the item |
status | The result (status.result), the flag state (status.flag) and linked marketplaces (status.integrations) |
moreDetails | The certificate links and whether Market Edge is supported |
textFields | Text inputs and barcodes submitted with the item, for example customer_item_id |
images | The item photo and the uploaded images, with thumbnail links |
eventTimes | When the capture started, and when the item was submitted, received and given a result |
timestamp | The submission time |
events | The item's timeline, newest first, for example "Flag Set" |
user | The user who submitted the item |
price | Whether to show the pricing widget |
batchRequest | The open retake request, when there is one |
Each timestamp has a display string (UTC) and an epoch value in seconds.
Result Status Values
status.result.id is an EntrupyResultStatusId:
import com.entrupy.sdk.model.EntrupyResultStatusId
| Value | Description |
|---|---|
AUTHENTIC | Item authenticated as genuine |
UNKNOWN | Unable to determine authenticity. Shown to users as "Unidentified" |
NOT_SUPPORTED | Item type not supported for authentication |
NEEDS_REVIEW | Entrupy is still reviewing the item. Make no assumption about when the result arrives |
INVALID | Invalid submission |
ANALYZED | Analysis complete |
RECEIVED | Submission received, processing |
NO_RESULT | No result yet |
MATCH | Match found in reference data |
NO_MATCH | No match found in reference data |
REGISTERED | Item registered in the system |
CANCELED | Authentication canceled |
DATA_REQUIRED | Additional data required |
NOT_AVAILABLE | Result not available |
REGISTRATION_INVALID | Registration is invalid |
REGISTRATION_NOT_SUPPORTED | Registration type not supported |
MATCH_FOUND | Match found |
NO_MATCH_FOUND | No match found |
OTHER | A value this SDK version does not know. Read status.result.rawId for the value the backend sent |
Use status.result.display.header for the text to show, for example "Authentic".
Flag Values
status.flag.id is an EntrupyFlagId:
| Value | Description |
|---|---|
NONE | The result has not been flagged |
FLAGGED | The result is currently flagged. status.flag.flagInfo holds the reason |
RESOLVED | Entrupy resolved the flag |
OTHER | A value this SDK version does not know. Read status.flag.rawId for the value the backend sent |
status.flag.isFlaggable tells you whether the user can flag the result. For flag actions, see Customer Support Integration.
4. Server-Side Data Access
For backend data access, reporting, and cross-user queries, use the Entrupy API:
- Webhooks: Receive real-time notifications for result updates, flag changes, and other events.
- API queries: Retrieve authentication details, search across users, and synchronize with your internal systems.
- Data mapping: Use
customer_item_idto map Entrupy authentications to your internal records.
Refer to Essential Backend Integration Tasks for setup details.
Best Practices
- Use SDK UI for full workflows. The Detail View provides a maintained, consistent experience, with the timeline, retakes and flags.
- Use
fetchSessionDetailsfor small pieces of your own UI, like a status line in a list or a result on your item screen. - Use the API for backend operations. Reporting, cross-user search, and data synchronization should go through your backend.
- Map IDs consistently. Store the
entrupyIdalongside yourcustomer_item_idfor reliable cross-referencing.
Next Steps
- Use Programmatic Search Items to list and page through the user's items.
- See Searching SDK Authentications for detail view and backend search.
- Review Customer Support Integration for flag and support features.
- Set up backend webhooks for server-side data flow.