submit Spot It Feedback
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
spot Id
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.
endorsement Id
Endorsement id from SpotItData.endorsements — arbitrary integers are rejected by the backend.
success Id
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}")
}
}Content copied to clipboard
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)")
}
}Content copied to clipboard