HomeFAQDetails
Back to all questions
Developer Integration

What is the process for integrating the try-on SDK into an Android app?

For native Android applications, integration is streamlined through our high-performance mobile API. You can initialize the SDK with your API key, then invoke the try-on flows directly from your product screens. Check out the step-by-step setup guides, Gradle dependencies, and Kotlin/Java sample codes on docs.snapmydesign.com.

Developer Reference

Android Kotlin Asset Upload Request

val client = OkHttpClient()
val requestBody = MultipartBody.Builder()
  .setType(MultipartBody.FORM)
  .addFormDataPart("userId", "user_abc123")
  .addFormDataPart("files", "tshirt.png", 
    File("tshirt.png").asRequestBody("image/png".toMediaType()))
  .build()

val request = Request.Builder()
  .url("https://apisdk.snapmydesign.com/api/v1/vton/upload")
  .post(requestBody)
  .addHeader("X-API-Key", "smd_live_your_key_here")
  .build()

client.newCall(request).execute().use { response ->
  val responseBody = response.body?.string()
  println("Upload Response: $responseBody")
}

REST Endpoint Specification

POSThttps://apisdk.snapmydesign.com/api/v1/vton/upload

Upload image files (person profiles, garment photos) to obtain the public cloud URLs required for triggering the try-on generator.

Request Parameters

ParameterTypeRequiredDescription
filesList[Binary]Yes1 to 4 image files to upload. Supports JPEG, PNG, WEBP.
userIdstringYesThe user ID associated with the API key owner.
resolutionintegerNoTarget resolution limit. Default is 1000 (auto-resize/optimize).

Sample JSON Response

{
  "success": true,
  "statusCode": 200,
  "message": "Upload successful",
  "uploaded": [
    {
      "id": "e4a2d8b5-908c-4a34-be57-410a0e954a1a",
      "url": "https://firebasestorage.googleapis.com/v0/b/xdesign-d72cd.appspot.com/o/vton_uploaded_image..."
    }
  ]
}

Looking for more endpoints, models, or credit rates?

View Full API Reference