Docs
Send SMS

Send SMS

Send SMS messages to eSIM profiles

Send SMS

Send SMS messages to eSIM profiles that support SMS functionality.

Send SMS to eSIM

Endpoint: POST /api/v1/open/esim/sendSms

Request Parameters

NameTypeRequiredDescriptionExample
esimTranNoStringRequiredTarget eSIM transaction number23072017992029
messageStringRequiredSMS message contentYour Message!

Example Request

curl --location --request POST 'https://your-api-domain.com/api/v1/open/esim/sendSms' \
--header 'RT-AccessCode: YOUR_ACCESS_CODE' \
--header 'RT-SecretKey: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "esimTranNo": "23072017992029",
    "message": "Your Message!"
}'

Response Parameters

NameTypeDescription
successBooleantrue = succeeded, false = failed
errorCodeStringError code when failed
errorMsgStringError message
objObjectResponse data

Example Success Response

{
    "errorCode": null,
    "errorMsg": null,
    "success": true,
    "obj": null
}

SMS Support Levels

Check the smsStatus field in package data:

ValueDescription
0SMS not supported
1API + mobile phone SMS delivery
2API SMS delivery only
// Check SMS support before sending
const package = await getPackage('TH_1_7');
if (package.smsStatus === 0) {
    console.log('SMS not supported for this package');
} else {
    // SMS is supported
    await sendSMS(esimTranNo, message);
}

Error Handling

SMS Not Supported

{
    "errorCode": "200002",
    "errorMsg": "This operation is not allowed",
    "success": false,
    "obj": null
}

eSIM Not Found

{
    "errorCode": "310403",
    "errorMsg": "The eSIM transaction number does not exist",
    "success": false,
    "obj": null
}

Use Cases

  1. Verification codes - Send OTP for customer verification
  2. Welcome messages - Send eSIM activation instructions
  3. Support messages - Send troubleshooting information
  4. Notifications - Alert customers of important updates

Best Practices

  1. Check SMS support - Verify smsStatus before attempting to send
  2. Keep messages short - Respect SMS character limits
  3. Don't spam - Respect customer communication preferences
  4. Log delivery status - Track which messages were sent successfully