User Documentation
API Clients & Integrations
Scenario Recipes
The library allows you to request recommendations and send interactions between users and items (views, bookmarks, purchases …).
It is intended for usage in Android applications.
Example
import com.recombee.apiclientkotlin.RecombeeClient
import com.recombee.apiclientkotlin.bindings.RecommendationResponse
import com.recombee.apiclientkotlin.exceptions.ApiException
import com.recombee.apiclientkotlin.requests.*
import com.recombee.apiclientkotlin.util.Region
fun main() {
val client = RecombeeClient(
databaseId = "--your-database-id--",
publicToken = "--your-db-public-token--",
region = Region.UsWest
)
client.send(SetViewPortion(userId = "user-4289", itemId = "item-487", portion = 0.3))
val recommRequest = RecommendItemsToUser(userId = "user-4289", count = 10)
client.send(recommRequest,
{ response: RecommendationResponse ->
// Show recommendations
for (recommendedItem in response.recomms) {
println("ID: ${recommendedItem.id}")
}
},
{ exception: ApiException ->
println("Exception: $exception")
// use fallback ...
}
)
}