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.
Back to all questionsDeveloper Integration
View Full API Reference
What is the process for integrating the try-on SDK into an Android app?
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
POST
https://apisdk.snapmydesign.com/api/v1/vton/uploadUpload image files (person profiles, garment photos) to obtain the public cloud URLs required for triggering the try-on generator.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| files | List[Binary] | Yes | 1 to 4 image files to upload. Supports JPEG, PNG, WEBP. |
| userId | string | Yes | The user ID associated with the API key owner. |
| resolution | integer | No | Target 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?