Send SMS (submitMT)
POST https://api.anchor-sms.com:8443/mt/sendMtSms submits a Mobile Terminating message for delivery to a Malaysian mobile number. Requires a Bearer token.
Request parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| clientMsgId | Your unique message ID | Alphanumeric, max 20 | Yes |
| msgEncoded | SMS content, Base64 encoded | Alphanumeric, max 480 | Yes |
| senderId | Sender number or short code in international format | Alphanumeric, max 15 | Yes |
| destAddr | Destination number in international format with country code (e.g. 60123456789) | Alphanumeric, max 15 | Yes |
| dataCoding | 0 = ASCII (English, Malay); 8 = Unicode (Chinese, Korean, etc.) | Number, 1 digit | Yes |
| srcTon, srcNpi, destTon, destNpi | Type of Number / Number Plan Indicator. Value: 0 | Number, 1 digit | Optional |
Example request
{
"clientMsgId": "MT001",
"dataCoding": 0,
"destAddr": "60123456789",
"destNpi": "0",
"destTon": "0",
"msgEncoded": "aGVsbG8=",
"senderId": "YOUR_SENDER_ID",
"srcNpi": "0",
"srcTon": "0"
}
Successful response (HTTP 201)
{
"timestamp": "2024-04-08T06:13:48.925+00:00",
"status": 201,
"message": "Created",
"data": {
"clientMsgId": "MT001",
"umgTxId": "240408141348960d4b",
"statusCode": "001",
"statusDescription": "Submitted"
},
"path": "/mt/sendMtSms"
}
Java Spring Boot example
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class AnchorSmsClient {
private static final String BASE = "https://api.anchor-sms.com:8443";
private final RestTemplate rest = new RestTemplate();
public String getToken(String username, String password) {
Map<String, String> body = Map.of("username", username, "password", password);
Map<?, ?> res = rest.postForObject(BASE + "/auth/getToken", body, Map.class);
return (String) res.get("accessToken");
}
public ResponseEntity<String> sendSms(String token, String to, String text) {
Map<String, Object> body = new HashMap<>();
body.put("clientMsgId", UUID.randomUUID().toString().substring(0, 18));
body.put("dataCoding", 0);
body.put("destAddr", to);
body.put("senderId", "YOUR_SENDER_ID");
body.put("msgEncoded", Base64.getEncoder()
.encodeToString(text.getBytes(StandardCharsets.UTF_8)));
body.put("srcTon", "0"); body.put("srcNpi", "0");
body.put("destTon", "0"); body.put("destNpi", "0");
HttpHeaders headers = new HttpHeaders();
headers.setBearerAuth(token);
headers.setContentType(MediaType.APPLICATION_JSON);
return rest.postForEntity(BASE + "/mt/sendMtSms",
new HttpEntity<>(body, headers), String.class);
}
}
Delivery notification
When the message is delivered, UMG calls your registered DN URL with GwMsgId, SvrMsgId and StatusCode. See status codes.
Prefer SMPP? UMG supports standard SMPP v3.4 SubmitSM requests.
