Sorry, you need to enable JavaScript to visit this website.

You are here

Send SMS Failing - 500 Error "ReferenceError: \"messageText\" is not defined.

2 posts / 0 new
Last post

Nivetha's picture
by Nivetha

Send SMS Failing - 500 Error "ReferenceError: \"messageText\" is not defined.

Iam trying to send message using Message API Api via  java program and it is getting failed when called  .

Here is the code snippet
String url = ""; 
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Bearer "+token);
headers.add("Content-Type", "application/json");"setting Authorization header to: Bearer " + token);

String input = "{\"to\":[\"+9xxxxxxxx46\"],\"body\":\""+ content + "\",\"from\": \"\",\"validity\": 5,\"scheduledDelivery\": 1,\"notifyURL\": \"\",\"replyRequest\": false,\"priority\": true}";"Setting Authorization header to: input " + input);

RestTemplate restTemplate = new RestTemplate();
HttpEntity<String> requestHeaders = new HttpEntity<String>(input, headers);"Sending SMS -----------------------------------");
.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
restTemplate.setErrorHandler(new CustomResponseErrorHandler());
ResponseEntity<String>  response =, HttpMethod.POST,
requestHeaders, String.class);
Error what am getting when i invoke Sms
"message":"ReferenceError: \"messageText\" is not defined."


DeveloperSteve's picture
by DeveloperSteve

Hi nivethamanoharan

Have you provisioned a number against the account? 

Also have you tried sending just a plain text string in replace of the content variable?

Log in or register to post comments