EmailMessages APIs
-
Create New Email Message
Description: Creates a new Email message using a minimum set of optionsUsage:
POST api/Messages/Email/Create/Simple
Parameter Type Source Description EmailObject SimpleEmail FromBody SimpleEmail object Returns:
The unique numerical code identifying the new Email message
Examples:
<!-- Intent: Create a new E-mail message using a minimal set of options POST to the following url http://api.v4.swiftreach.com/api/Messages/Email/Create/Simple --> <SimpleEmail> <Name>My Simple Email</Name> <Description>this is an example of a simple email message</Description> <FromName>Swift911</FromName> <FromAddress>alerts@swiftreach.com</FromAddress> <Subject>Simple Email Example</Subject> <Body>This is a simple email message.</Body> </SimpleEmail> <!-- example return value --> <int>123456</int>
-
Create New Email Message
Description: Creates a new Email messageUsage:
POST api/Messages/Email/Create
Parameter Type Source Description EmailObject Email_Message FromBody Email_Message object Returns:
The unique numerical code identifying the new Email message
Examples:
<!-- POST to the following url http://api.v4.swiftreach.com/api/Messages/Email/Create --> <Email_Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/SwiftReach.Swift911.Core.Messages.Email"> <Name>API Email</Name> <Description>created by api</Description> <FromName>SwiftAPI</FromName> <FromAddress>alerts@swiftreach.com</FromAddress> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <Content> <Email_Content> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the body of my email</Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> </Body> </Email_Content> </Content> </Email_Message> <!-- example return value --> <int>123456</int>
-
Updates Existing Email Message
Description: Updates the Email message parameters and content.Usage:
PUT api/Messages/Email/Update/{EmailCode}
Parameter Type Source Description EmailCode Int32 FromUri The unique numerical code of the Email message to update EmailObject Email_Message FromBody The Email_Message object containing the modifications Returns:
Returns 0 on success
Examples:
<!-- Intent: Update email message with emailcode of 100000 PUT to the following url http://api.v4.swiftreach.com/api/Messages/Email/Update/100000 --> <Email_Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/SwiftReach.Swift911.Core.Messages.Email"> <EmailCode>100000</EmailCode> <Name>API Email</Name> <Description>created by api</Description> <FromName>SwiftAPI</FromName> <FromAddress>alerts@swiftreach.com</FromAddress> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <Content> <Email_Content> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the body of my email</Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> </Body> </Email_Content> </Content> </Email_Message> <!-- example return value --> <int>123456</int>
-
Deletes Existing Email Message
Description: Deletes the given Email message.Usage:
DELETE api/Messages/Email/Delete/{EmailCode}
Parameter Type Source Description EmailCode Int32 FromUri The unique numerical code identifying the Email message to delete Returns:
Returns 0 on success
Examples:
<!-- Intent: Delete email message with emailcode of 100000 DELETE to the following url http://api.v4.swiftreach.com/api/Messages/Email/Delete/100000 --> <!-- No XML input is required --> <!-- example return value --> <int>0</int>
-
List Email Messages
Description: Returns a list of Email messagesUsage:
GET api/Messages/Email/List
Returns:
Returns a list of Email_Message objects
Examples:
<!-- Intent: retrieve a list of existing email messages GET to the following url http://api.v4.swiftreach.com/api/Messages/Email/List --> <!-- No XML input is required --> <!-- example return values --> <ArrayOfEmail_Message xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.Messages.Email"> <Email_Message> <ChangeStamp>2012-09-17T11:38:54.94</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <Content> <Email_Content> <Body> <EMAIL_TEXT_SOURCE i:type="EMAIL_TEXT_SOURCE_TEXT"> <TextType>email_text_source_text</TextType> <Text>this is a test of the email messaging</Text> </EMAIL_TEXT_SOURCE> </Body> <SpokenLanguage>English</SpokenLanguage> <Subject>foobar</Subject> </Email_Content> </Content> <CreateStamp>2012-09-17T11:21:55.647</CreateStamp> <CreatedByUser>sample</CreatedByUser> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <DeleteLocked>true</DeleteLocked> <Description>this is just a test</Description> <EmailCode>646697</EmailCode> <FromAddress>nick@swiftreach.com</FromAddress> <FromName>Swift911V4</FromName> <LastUsed>2012-12-21T08:44:18.38</LastUsed> <Name>Test Email</Name> <Visibility>Visible</Visibility> </Email_Message> <Email_Message> <ChangeStamp>2012-09-25T15:13:11.59</ChangeStamp> <ChangedByUser/> <Content> <Email_Content> <Body> <EMAIL_TEXT_SOURCE i:type="EMAIL_TEXT_SOURCE_TEXT"> <TextType>email_text_source_text</TextType> <Text>kmandelbaum@swiftreach.com</Text> </EMAIL_TEXT_SOURCE> </Body> <SpokenLanguage>English</SpokenLanguage> <Subject>TEST</Subject> </Email_Content> </Content> <CreateStamp>2012-09-25T15:13:11.59</CreateStamp> <CreatedByUser>kmandelbaum</CreatedByUser> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <DeleteLocked>false</DeleteLocked> <Description>TEST</Description> <EmailCode>647037</EmailCode> <FromAddress>nick@swiftreach.com</FromAddress> <FromName>Swift911V4</FromName> <LastUsed>0001-01-01T00:00:00</LastUsed> <Name>TEST</Name> <Visibility>Visible</Visibility> </Email_Message> </ArrayOfEmail_Message>
-
Get Email Message Profile
Description: Returns the Email_Message object for the given EmailcodeUsage:
GET api/Messages/Email/{EmailCode}
Parameter Type Source Description EmailCode Int32 FromUri The unique numerical code identifying the Email message to return Returns:
Returns Email_Message object for the given Emailcode.
Examples:
<!-- Intent: retrieve the profile for emailmessage with emailcode of 100000 GET to the following url http://api.v4.swiftreach.com/api/Messages/Email/100000 --> <!-- No XML input is required --> <!-- example return value --> <Email_Message> <ChangeStamp>2012-09-17T11:38:54.94</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <Content> <Email_Content> <Body> <EMAIL_TEXT_SOURCE i:type="EMAIL_TEXT_SOURCE_TEXT"> <TextType>email_text_source_text</TextType> <Text>this is a test of the email messaging</Text> </EMAIL_TEXT_SOURCE> </Body> <SpokenLanguage>English</SpokenLanguage> <Subject>foobar</Subject> </Email_Content> </Content> <CreateStamp>2012-09-17T11:21:55.647</CreateStamp> <CreatedByUser>sample</CreatedByUser> <DefaultSpokenLanguage>English</DefaultSpokenLanguage> <DeleteLocked>true</DeleteLocked> <Description>this is just a test</Description> <EmailCode>100000</EmailCode> <FromAddress>nick@swiftreach.com</FromAddress> <FromName>Swift911V4</FromName> <LastUsed>2012-12-21T08:44:18.38</LastUsed> <Name>Test Email</Name> <Visibility>Visible</Visibility> </Email_Message>
-
Verify Email Message Exists
Description: Checks to see if the given Email message exists.Usage:
GET api/Messages/Email/Exists/{EmailCode}
Parameter Type Source Description EmailCode Int32 FromUri The unique numerical code identifying the Email message Returns:
Returns true if the Email message exists.
Examples:
<!-- Intent: verify that emailmessage with emailcode of 100000 exists GET to the following url http://api.v4.swiftreach.com/api/Messages/Email/Exists/100000 --> <!-- No XML input is required --> <!-- example return value --> <boolean>true</boolean>
-
Send Email Message 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/Email/Send/Compressed/{TaskName}/{EmailCode}
Parameter Type Source Description TaskName String FromUri The name of the alert. EmailCode Int32 FromUri The unique numerical code identifying the Email message to send. Returns:
Returns a positive 32-bit integer value that uniquely identifies the alert job.
Examples:
//-- Currently no examples for XML --//
-
Send Email Message to Contact List
Description: Launches an alertUsage:
POST api/Messages/Email/Send/{TaskName}/{EmailCode}/{ListCode}
Parameter Type Source Description TaskName String FromUri The name of the alert. EmailCode Int32 FromUri The unique numerical code identifying the Email message to send. ListCode Int32 FromUri The unique numerical code identifying the contact list to send the Email message to. Returns:
Returns a positive 32-bit integer value that uniquely identifies the alert job.
Examples:
<!-- Intent: send the emailmessage with emailcode 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/Email/Send/MY%20Test%20Alert/100000/200000 --> <!-- No XML input is required --> <!-- example return value --> <int>123456</int>
-
Send Email Message to Array of Contacts
Description: Launches an alertUsage:
POST api/Messages/Email/Send/{TaskName}/{EmailCode}
Parameter Type Source Description TaskName String FromUri The name of the alert. EmailCode Int32 FromUri The unique numerical code identifying the Email message to send. Contacts Contact[] FromBody Array of Contact to send the Email message to. Returns:
Returns a positive 32-bit integer value that uniquely identifies the alert job.
Examples:
<!-- Intent: send the emailmessage with emailcode 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/Email/Send/MY%20Test%20Alert/100000 --> <ArrayOfContact> <Contact> <EntityName>Sample One</EntityName> <EntityGuid>a44667cf-e4e5-4f28-b4e2-948ba2065c09</EntityGuid> <Email>alerts@swiftreach.com</Email> <SMSNetwork>0</SMSNetwork> <PagerNetwork>0</PagerNetwork> <UserDefined> <KeyValue><Key>FieldOne</Key><Value>foobar</Value></KeyValue> <KeyValue><Key>FieldTwo</Key><Value>other</Value></KeyValue> </UserDefined> </Contact> <Contact> <EntityName>Sample Two</EntityName> <EntityGuid>a44667cf-e4e5-4f28-b4e2-948ba2065c09</EntityGuid> <Email>alerts@swiftreach.com</Email> <SMSNetwork>0</SMSNetwork> <PagerNetwork>0</PagerNetwork> <UserDefined> <KeyValue><Key>FieldOne</Key><Value>foobar</Value></KeyValue> <KeyValue><Key>FieldTwo</Key><Value>other</Value></KeyValue> </UserDefined> </Contact> </ArrayOfContact> <!-- example return value --> <int>123456</int>
-
String to EMAIL_TEXT_SOURCE[] Helper Function
Description: Converts the given text content including auto-fields into a Email_TEXT_SOURCE object.Usage:
POST api/Messages/Email/Helpers/TextToEmailSourceObject
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 EMAIL_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/Email/Helpers/TextToEmailSourceObject --> <TextContent>this is the body of my email</TextContent> <!-- Example Return Value --> <ArrayOfEMAIL_TEXT_SOURCE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the body of my email</Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> </ArrayOfEMAIL_TEXT_SOURCE>
-
Email_Content[] to String Helper Function
Description: Retrieves the text content for the given content typeUsage:
POST api/Messages/Email/Helpers/EmailContentObjectArrayToText/{SpokenLanguage}
Parameter Type Source Description SpokenLanguage String FromUri The language to extract the content from ContentObject Email_Content[] FromBody The Email_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/Email/Helpers/EmailContentObjectArrayToText/English --> <ArrayOfEmail_Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Email_Content> <SpokenLanguage>English</SpokenLanguage> <Subject>my subject</Subject> <Body> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the body of my English email. </Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the second part of my english message.</Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> </Body> </Email_Content> <Email_Content> <SpokenLanguage>Spanish</SpokenLanguage> <Subject>my subject</Subject> <Body> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the body of my Spanish email</Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> </Body> </Email_Content> </ArrayOfEmail_Content> <!-- Example Return Value --> <string>this is the body of my email. this is the second part of my english message.</string>
-
Email_Content to String Helper Function
Description: Retrieves the text content for the given alert content objectUsage:
POST api/Messages/Email/Helpers/EmailContentObjectToText
Parameter Type Source Description ContentObject Email_Content FromBody The Email_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 email_content object POST to the following url http://api.v4.swiftreach.com/api/Messages/Email/Helpers/EmailContentObjectToText --> <Email_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> <EMAIL_TEXT_SOURCE xsi:type="EMAIL_TEXT_SOURCE_TEXT"> <Text>this is the body of my email</Text> <TextType>email_text_source_text</TextType> </EMAIL_TEXT_SOURCE> </Body> </Email_Content> <!-- Example Return Value --> <string>this is the body of my email</string>