TextMessages APIs
-
Create New SMS Message
Description: Creates a new sms message using a minimum set of optionsUsage:
POST api/Messages/Text/Create/Simple
Parameter Type Source Description SMSObject SimpleText FromBody SimpleText object Returns:
The unique numerical code identifying the new sms message
Examples:
<!-- Intent: Create a new SMS message using a minimal set of options POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Create/Simple --> <SimpleText> <Name>My Simple Message</Name> <Description>This is an example of a simple text message</Description> <From>Swift911</From> <Body>This is a simple text message.</Body> </SimpleText> <!-- example return value --> <int>123456</int>
-
Create New SMS Message
Description: Creates a new sms messageUsage:
POST api/Messages/Text/Create
Parameter Type Source Description SMSObject SMS_Message FromBody SMS_Message object Returns:
The unique numerical code identifying the new sms message
Examples:
<!-- POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Create --> <SMS_Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/SwiftReach.Swift911.Core.Messages.SMS"> <Name>API SMS</Name> <Description>created by api</Description> <FromName>SwiftAPI</FromName> <FromAddress>alerts@swiftreach.com</FromAddress> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <Body> <SMS_Content> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the body of my sms</Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> </Body> </SMS_Content> </Body> </SMS_Message> <!-- example return value --> <int>123456</int>
-
Update Existing SMS Message
Description: Updates the sms message parameters and content.Usage:
PUT api/Messages/Text/Update/{SMSCode}
Parameter Type Source Description SMSCode Int32 FromUri The unique numerical code of the sms message to update SMSObject SMS_Message FromBody The SMS_Message object containing the modifications Returns:
Returns 0 on success
Examples:
<!-- Intent: Update sms message with smscode of 100000 PUT to the following url http://api.v4.swiftreach.com/api/Messages/Text/Update/100000 --> <SMS_Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/SwiftReach.Swift911.Core.Messages.SMS"> <SMSCode>100000</SMSCode> <Name>API SMS</Name> <Description>created by api</Description> <FromName>SwiftAPI</FromName> <FromAddress>alerts@swiftreach.com</FromAddress> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <Body> <SMS_Content> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the body of my message</Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> </Body> </SMS_Content> </Body> </SMS_Message> <!-- example return value --> <int>123456</int>
-
Delete Existing SMS Message
Description: Deletes the given SMS message.Usage:
DELETE api/Messages/Text/Delete/{SMSCode}
Parameter Type Source Description SMSCode Int32 FromUri The unique numerical code identifying the sms message to delete Returns:
Returns 0 on success
Examples:
<!-- Intent: Delete sms message with smscode of 100000 DELETE to the following url http://api.v4.swiftreach.com/api/Messages/Text/Delete/100000 --> <!-- No XML input is required --> <!-- example return value --> <int>0</int>
-
List SMS Messages
Description: Returns a list of sms messagesUsage:
GET api/Messages/Text/List
Returns:
Returns a list of SMS_Message objects
Examples:
<!-- Intent: retrieve a list of existing sms messages GET to the following url http://api.v4.swiftreach.com/api/Messages/Text/List --> <!-- No XML input is required --> <!-- example return values --> <ArrayOfSMS_Message xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.Messages.SMS"> <SMS_Message> <ChangeStamp>2012-09-17T11:38:54.94</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <Body> <SMS_Content> <Body> <SMS_TEXT_SOURCE i:type="SMS_TEXT_SOURCE_TEXT"> <TextType>sms_text_source_text</TextType> <Text>this is a test of the sms messaging</Text> </SMS_TEXT_SOURCE> </Body> <SpokenLanguage>English</SpokenLanguage> <Subject>foobar</Subject> </SMS_Content> </Body> <CreateStamp>2012-09-17T11:21:55.647</CreateStamp> <CreatedByUser>sample</CreatedByUser> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <DeleteLocked>true</DeleteLocked> <Description>this is just a test</Description> <SMSCode>646697</SMSCode> <FromAddress>nick@swiftreach.com</FromAddress> <FromName>Swift911V4</FromName> <LastUsed>2012-12-21T08:44:18.38</LastUsed> <Name>Test SMS</Name> <Visibility>Visible</Visibility> </SMS_Message> <SMS_Message> <ChangeStamp>2012-09-25T15:13:11.59</ChangeStamp> <ChangedByUser/> <Body> <SMS_Content> <Body> <SMS_TEXT_SOURCE i:type="SMS_TEXT_SOURCE_TEXT"> <TextType>sms_text_source_text</TextType> <Text>kmandelbaum@swiftreach.com</Text> </SMS_TEXT_SOURCE> </Body> <SpokenLanguage>English</SpokenLanguage> <Subject>TEST</Subject> </SMS_Content> </Body> <CreateStamp>2012-09-25T15:13:11.59</CreateStamp> <CreatedByUser>kmandelbaum</CreatedByUser> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <DeleteLocked>false</DeleteLocked> <Description>TEST</Description> <SMSCode>647037</SMSCode> <FromAddress>nick@swiftreach.com</FromAddress> <FromName>Swift911V4</FromName> <LastUsed>0001-01-01T00:00:00</LastUsed> <Name>TEST</Name> <Visibility>Visible</Visibility> </SMS_Message> </ArrayOfSMS_Message>
-
Get SMS Message Profile
Description: Returns the SMS_Message object for the given smscodeUsage:
GET api/Messages/Text/{SMSCode}
Parameter Type Source Description SMSCode Int32 FromUri The unique numerical code identifying the sms message to return Returns:
Returns SMS_Message for the given smscode.
Examples:
<!-- Intent: retrieve the profile for sms message with smscode of 100000 GET to the following url http://api.v4.swiftreach.com/api/Messages/Text/100000 --> <!-- No XML input is required --> <!-- example return value --> <SMS_Message> <ChangeStamp>2012-09-17T11:38:54.94</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <Body> <SMS_Content> <Body> <SMS_TEXT_SOURCE i:type="SMS_TEXT_SOURCE_TEXT"> <TextType>sms_text_source_text</TextType> <Text>this is a test of the sms messaging</Text> </SMS_TEXT_SOURCE> </Body> <SpokenLanguage>English</SpokenLanguage> <Subject>foobar</Subject> </SMS_Content> </Body> <CreateStamp>2012-09-17T11:21:55.647</CreateStamp> <CreatedByUser>sample</CreatedByUser> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <DeleteLocked>true</DeleteLocked> <Description>this is just a test</Description> <SMSCode>100000</SMSCode> <FromAddress>nick@swiftreach.com</FromAddress> <FromName>Swift911V4</FromName> <LastUsed>2012-12-21T08:44:18.38</LastUsed> <Name>Test SMS</Name> <Visibility>Visible</Visibility> </SMS_Message>
-
Verify SMS Message Exists
Description: Checks to see if the given SMS message exists.Usage:
GET api/Messages/Text/Exists/{SMSCode}
Parameter Type Source Description SMSCode Int32 FromUri The unique numerical code identifying the sms message Returns:
Returns true if the sms message exists.
Examples:
<!-- Intent: verify that sms message with smscode of 100000 exists GET to the following url http://api.v4.swiftreach.com/api/Messages/Text/Exists/100000 --> <!-- No XML input is required --> <!-- example return value --> <boolean>true</boolean>
-
Send SMS to gzipped Array of Contacts
Description: Launches an alert. The gzip compressed contacts array xml should be sent in the HTTP POST body using a content-type of application x-www-form-urlencoded.Usage:
POST api/Messages/Text/Send/Compressed/{TaskName}/{SMSCode}
Parameter Type Source Description TaskName String FromUri The name of the alert. SMSCode Int32 FromUri The unique numerical code identifying the SMS message to send. Returns:
Returns a positive 32-bit integer value that uniquely identifies the alert job.
Examples:
//-- Currently no examples for XML --//
-
Send SMS to Contact List
Description: Launches an alertUsage:
POST api/Messages/Text/Send/{TaskName}/{SMSCode}/{ListCode}
Parameter Type Source Description TaskName String FromUri The name of the alert. SMSCode Int32 FromUri The unique numerical code identifying the sms message to send. ListCode Int32 FromUri The unique numerical code identifying the contact list to send the sms message to. Returns:
Returns a positive 32-bit integer value that uniquely identifies the alert job.
Examples:
<!-- Intent: send the sms message with smscode of 100000 to an existing contact list with listcode 200000 and name the alert "My Test Alert" POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Send/MY%20Test%20Alert/100000/200000 --> <!-- No XML input is required --> <!-- example return value --> <int>123456</int>
-
Send SMS to Array of Contacts
Description: Launches an alertUsage:
POST api/Messages/Text/Send/{TaskName}/{SMSCode}
Parameter Type Source Description TaskName String FromUri The name of the alert. SMSCode Int32 FromUri The unique numerical code identifying the SMS message to send. Contacts Contact[] FromBody Array of Contact to send the SMS message to. Returns:
Returns a positive 32-bit integer value that uniquely identifies the alert job.
Examples:
<!-- Intent: send the sms message with smscode of 100000 to an array of contacts posted in the body of the request and name the alert "My Test Alert" POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Send/MY%20Test%20Alert/100000 --> <ArrayOfContact> <Contact> <EntityName>Sample One</EntityName> <EntityGuid>a44667cf-e4e5-4f28-b4e2-948ba2065c09</EntityGuid> <SMSNetwork>0</SMSNetwork> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <Phone>5551234567</Phone> <Extension/> <OptInSMS>true</OptInSMS> <PhoneType>phonetype_voice</PhoneType> <PhoneLabel>Mobile</PhoneLabel> </PhoneProfile> </Phones> </Contact> <Contact> <EntityName>Sample Two</EntityName> <EntityGuid>a44667cf-e4e5-4f28-b4e2-948ba2065c09</EntityGuid> <SMSNetwork>0</SMSNetwork> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <Phone>5551234568</Phone> <Extension/> <OptInSMS>true</OptInSMS> <PhoneType>phonetype_voice</PhoneType> <PhoneLabel>Mobile</PhoneLabel> </PhoneProfile> </Phones> </Contact> </ArrayOfContact> <!-- example return value --> <int>123456</int>
-
String to SMS_TEXT_SOURCE[] Helper Function
Description: Converts the given text content including auto-fields into a SMS_TEXT_SOURCE object.Usage:
POST api/Messages/Text/Helpers/TextToSMSSourceObject
Parameter Type Source Description TextContent String FromBody The text content of the message. This may contain auto-fields such as [Name/] or [Date/] etc. Returns:
Returns a new SMS_TEXT_SOURCE object array.
Examples:
<!-- Intent: parses the text content and returns an array of text sources POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Helpers/TextToSMSSourceObject --> <TextContent>this is the body of my message</TextContent> <!-- Example Return Value --> <ArrayOfSMS_TEXT_SOURCE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the body of my message</Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> </ArrayOfSMS_TEXT_SOURCE>
-
SMS_Content[] to String Helper Function
Description: Retrieves the text content for the given content typeUsage:
POST api/Messages/Text/Helpers/SMSContentObjectArrayToText/{SpokenLanguage}
Parameter Type Source Description SpokenLanguage String FromUri The language to extract the content from ContentObject SMS_Content[] FromBody The SMS_Content array that contains the current content Returns:
Returns a string containing the textual content of the message including auto-fields if used.
Examples:
<!-- Intent: return the text for the English profile of the message. POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Helpers/SMSContentObjectArrayToText/English --> <ArrayOfSMS_Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SMS_Content> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the body of my English sms. </Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the second part of my english message.</Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> </Body> </SMS_Content> <SMS_Content> <SpokenLanguage>Spanish</SpokenLanguage> <Subject>my subject</Subject> <Body> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the body of my Spanish sms</Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> </Body> </SMS_Content> </ArrayOfSMS_Content> <!-- Example Return Value --> <string>this is the body of my English sms. this is the second part of my english message.</string>
-
SMS_Content to String Helper Function
Description: Retrieves the text content for the given alert content objectUsage:
POST api/Messages/Text/Helpers/SMSContentObjectToText
Parameter Type Source Description ContentObject SMS_Content FromBody The SMS_Content object that contains the current content Returns:
Returns a string containing the textual content of the message including auto-fields if used.
Examples:
<!-- Intent: return the text content of the sms_content object POST to the following url http://api.v4.swiftreach.com/api/Messages/Text/Helpers/SMSContentObjectToText --> <SMS_Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <SMS_TEXT_SOURCE xsi:type="SMS_TEXT_SOURCE_TEXT"> <Text>this is the body of my message</Text> <TextType>sms_text_source_text</TextType> </SMS_TEXT_SOURCE> </Body> </SMS_Content> <!-- Example Return Value --> <string>this is the body of my message</string>