Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main/kotlin/com/cloudcontactai/sdk/ExampleRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun main() {
message = "Hello John, this is a test message from CCAI SDK!",
title = "Test SMS Campaign"
)
println("SMS sent with ID: ${smsResponse.id}")
println("SMS sent with response ID:${smsResponse.responseId} and campaign ID: ${smsResponse.id}")

println("\n=== Email Examples ===")

Expand All @@ -43,7 +43,7 @@ fun main() {
""".trimIndent(),
textContent = null
)
println("Email sent with ID: ${emailResponse.id}")
println("Email sent with response ID:${emailResponse.responseId} and campaign ID: ${emailResponse.id}")

println("\n=== MMS Examples ===")

Expand All @@ -60,8 +60,7 @@ fun main() {
imageFile = imageFile,
senderPhone = null
)
val responseId = mmsResponse.campaignId ?: mmsResponse.id
println("MMS sent with ID: $responseId")
println("MMS sent with response ID:${mmsResponse.responseId} and campaign ID: ${mmsResponse.id}")
} else {
println("Skipping MMS example - test-image.jpg not found")
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/com/cloudcontactai/sdk/email/EmailModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ data class EmailResponse(
@JsonProperty("id") val id: String,
@JsonProperty("campaignId") val campaignId: String? = null,
@JsonProperty("status") val status: String,
@JsonProperty("message") val message: String? = null
@JsonProperty("message") val message: String? = null,
@JsonProperty("responseId") val responseId: String? = null
)

@JsonIgnoreProperties(ignoreUnknown = true)
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/com/cloudcontactai/sdk/mms/MMSModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ data class MMSResponse(
val timestamp: String? = null,
val cost: Double? = null,
val errorCode: String? = null,
val id: String? = null
val id: String? = null,
val responseId: String? = null
)

data class SignedUploadUrlRequest(
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/com/cloudcontactai/sdk/sms/SMSModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ data class SMSResponse(
@JsonProperty("id") val id: String,
@JsonProperty("campaignId") val campaignId: String? = null,
@JsonProperty("status") val status: String? = null,
@JsonProperty("message") val message: String? = null
@JsonProperty("message") val message: String? = null,
@JsonProperty("responseId") val responseId: String? = null
)

@JsonIgnoreProperties(ignoreUnknown = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class EmailServiceTest {
"id": "email-123",
"campaignId": "campaign-123",
"status": "sent",
"message": "Email sent successfully"
"message": "Email sent successfully",
"responseId": "resp-email-123"
}
""".trimIndent()

Expand All @@ -63,6 +64,7 @@ class EmailServiceTest {

assertEquals("email-123", response.id)
assertEquals("sent", response.status)
assertEquals("resp-email-123", response.responseId)
}

@Test
Expand All @@ -72,7 +74,8 @@ class EmailServiceTest {
"id": "email-456",
"campaignId": "campaign-456",
"status": "sent",
"message": "Emails sent successfully"
"message": "Emails sent successfully",
"responseId": "resp-email-456"
}
""".trimIndent()

Expand All @@ -94,6 +97,7 @@ class EmailServiceTest {

assertEquals("email-456", response.id)
assertEquals("sent", response.status)
assertEquals("resp-email-456", response.responseId)
}

@Test
Expand Down
8 changes: 6 additions & 2 deletions src/test/kotlin/com/cloudcontactai/sdk/mms/MMSServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class MMSServiceTest {
"failedNumbers": null,
"timestamp": "2026-02-02T22:00:00Z",
"cost": 0.05,
"errorCode": null
"errorCode": null,
"responseId": "resp-mms-123"
}
""".trimIndent()

Expand All @@ -99,6 +100,7 @@ class MMSServiceTest {
assertEquals("mms-campaign-123", response.campaignId)
assertEquals(1, response.sentCount)
assertTrue(response.success == true)
assertEquals("resp-mms-123", response.responseId)
}

@Test
Expand All @@ -113,7 +115,8 @@ class MMSServiceTest {
"failedNumbers": null,
"timestamp": "2026-02-02T22:00:00Z",
"cost": 0.05,
"errorCode": null
"errorCode": null,
"responseId": "resp-mms-single-123"
}
""".trimIndent()

Expand All @@ -133,6 +136,7 @@ class MMSServiceTest {

assertEquals("mms-single-123", response.campaignId)
assertTrue(response.success == true)
assertEquals("resp-mms-single-123", response.responseId)
}

@Test
Expand Down
8 changes: 6 additions & 2 deletions src/test/kotlin/com/cloudcontactai/sdk/sms/SMSServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class SMSServiceTest {
"id": "msg-123",
"campaignId": "campaign-123",
"status": "sent",
"message": "SMS sent successfully"
"message": "SMS sent successfully",
"responseId": "resp-123"
}
""".trimIndent()

Expand All @@ -64,6 +65,7 @@ class SMSServiceTest {
assertEquals("campaign-123", response.campaignId)
assertEquals("msg-123", response.id)
assertEquals("sent", response.status)
assertEquals("resp-123", response.responseId)
}

@Test
Expand All @@ -73,7 +75,8 @@ class SMSServiceTest {
"id": "msg-456",
"campaignId": "campaign-456",
"status": "sent",
"message": "Bulk SMS sent successfully"
"message": "Bulk SMS sent successfully",
"responseId": "resp-456"
}
""".trimIndent()

Expand All @@ -95,6 +98,7 @@ class SMSServiceTest {

assertEquals("campaign-456", response.campaignId)
assertEquals("msg-456", response.id)
assertEquals("resp-456", response.responseId)
}

@Test
Expand Down