//-- Intent: Update sms message with smscode of 100000 --//


var jsonString = ' \
{ \
"SMSCode":100000, \
"Name":"API SMS", \
"Description":"created by api 2552", \
"FromName":"SwiftAPI 55", \
"FromAddress":"alerts@swiftreach.com", \
"DefaultSpokenLanguage":"English", \
"Body":[{ \
              "SpokenLanguage":"English", \
              "Subject":"my subject 555", \
              "Body":[{ \
                    "$type":"SwiftReach.Swift911.Core.Messages.SMS.SMS_TEXT_SOURCE_TEXT, SwiftReach.Swift911.Core", \
                    "Text":"this is the body of my sms", \
                    "TextType":0 \
                      }] \
            }], \
"ReplyType":0, \
"ReplyCriteria":null, \
"ReplyWindow":0, \
"ReplyConfirmation":null, \
"Visibility":0, \
"DeleteLocked":false \
}';

$.ajax({
  type: "PUT",
  contentType: "application/json; charset=utf-8",
  headers: {"SwiftAPI-Key": "12345"},
  url: "http://api.v4.swiftreach.com/api/Messages/Text/Update/100000",
  data: jsonString,
  dataType: "json"
  success: function(result) {
        // Do something with the result
    }

});

<!-- example return value -->
0