SMSSetup.GET;
SMSSetup.TESTFIELD(SMSSetup."SMS API URL");
SMSSetup.TESTFIELD("SMS Authentication Token");
SMSSetup.TESTFIELD(Identity);
IF GUIALLOWED THEN
Window.OPEN(Text000);
data := 'auth_token=' + SMSSetup."SMS Authentication Token";
data += '&from=' + SMSSetup.Identity;
data += '&to='+PhoneNo;
data += '&text='+COPYSTR(MessageText,1,SMSSetup."SMS Text Length");
stringContent := stringContent.StringContent(data,encoding.UTF8,'application/x-www-form-urlencoded');
ReturnValue := CallRESTWebService(SMSSetup."SMS API URL",'',SMSSetup.Method,stringContent,HttpResponseMessage);
result := HttpResponseMessage.Content.ReadAsStringAsync.Result;
IF GUIALLOWED THEN
Window.CLOSE;
IF NOT ReturnValue THEN
EXIT;
result := HttpResponseMessage.Content.ReadAsStringAsync.Result;
MESSAGE('%1',result.ToString);
separator := ',';
resultParts := result.Split(separator.ToCharArray());
statusCode := FORMAT(result);
ResponseCode := COPYSTR(statusCode,STRPOS(statusCode,'response_code') + 16,3);
IF (ResponseCode = '200') THEN BEGIN
EXIT(TRUE);
END
ELSE BEGIN
EXIT(FALSE);
END;