Skip to main content

Transaction Status Programming Examples

These examples show how to receive the POSTed JSON payload and handle it on your side. This creates an endpoint like yoursite.com/api/transaction-status, which you submit on your EgoSms/Comms settings page to begin receiving delivery reports. Persist the payload however you prefer (database, queue, log, etc.).

// DTO
public class TxStatusPayload {
public String MsgFollowUpUniqueCode;
public String number;
public String Status;
}

@RestController
public class TxStatusController {

@PostMapping("/api/transaction-status")
public ResponseEntity<String> receive(@RequestBody TxStatusPayload payload) {
// TODO: persist payload (DB, queue, etc.)
System.out.println("Status: " + payload.Status + " for " + payload.number);
return ResponseEntity.ok("OK");
}
}