submitSpotItFeedback

abstract suspend fun submitSpotItFeedback(spotId: String, endorsementId: Int, successId: Int, feedback: String?): AFResult

Submits feedback for a Spot It session.

Feedback includes which endorsement and success were chosen, along with optional free-text input from the user.

Return

AFResult indicating submission success.

Parameters

spotId

Spots-request id (UUID) — SpotItResult.requestId returned by generateSpots. The parameter is named spotId for historical reasons but per-spot ids will be rejected by the backend.

endorsementId

Endorsement id from SpotItData.endorsements — arbitrary integers are rejected by the backend.

successId

Success id from SpotItData.successes — same rule as endorsementId.

feedback

Optional text feedback from the user.

Throws

if feedback cannot be submitted.

Android (Kotlin)

lifecycleScope.launch {
try {
val result = AFCore.mentalFitness().submitSpotItFeedback(
spotId = "session123",
endorsementId = 10,
successId = 20,
feedback = "This worked well for me"
)
showMessage(result.message ?: "Feedback submitted")
} catch (t: Throwable) {
showError("Feedback submission failed: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let result = try await AFCore.shared.mentalFitness().submitSpotItFeedback(
spotId: "session123",
endorsementId: 10,
successId: 20,
feedback: "This worked well for me"
)
self.showMessage(result.message ?? "Feedback submitted")
} catch {
self.showError("Feedback submission failed: \\(error.localizedDescription)")
}
}