|
|
Documentation Wiki > Developer Documentation > Web Service Guide > Working with SOAP Web Service API
Working with SOAP Web Service APIFrom $1Table of contents
(Click the banner to go to the related Docs.Code.ExactTarget.com page.) This guide contains conceptual, procedural, and reference information you can use to implement ExactTarget's AMP SOAP (Simple Object Access Protocol) web service API in your business application. Prerequisites for Using the SOAP Web Service APIPerform the following steps before you begin to use the SOAP Web Service API:
What is the SOAP Web Service APIThe AMP SOAP Web Service API is a service-oriented architecture (SOA) for customers who need deeper integrations with their email service provider than the application interface can provide. The web service API provides comprehensive integration flexibility by exposing portions of functionality of the ExactTarget application as interoperable, reusable services. The composite processes and solutions combine with other services to meet your business needs. The web service API is built on web service standards that assure enterprise-level security and reliability. Because it is SOAP-based, developers can use leading integration processes and tools. The web service API is designed to:
Why Use the SOAP Web Service APIWhile you can accomplish several different tasks using the SOAP API, the examples below illustrate some of the most common SOAP API uses. NOTE: When working with the SOAP API, you can only successfully complete calls that use features enabled for the account containing your API user login. If a feature has not been enabled for your account, you cannot use the SOAP API to perform that feature. Please contact your ExactTarget representative for more information about identifying and enabling features for your account. Create EmailThe AMP SOAP Web Service API can support many different email creation scenarios. You can create emails in the application user interface and operate on the emails with the API or perform the entire email creation process with the web service API. Retrieve Tracking DataWith the SOAP Web Service API, you can retrieve tracking data and use it to create reports and dashboards to see how your customers view and respond to your data. Note that tracking data can be filtered based on actual data returned via the API. Dates returned in these tracking events represent the date on which the event occured. For example, when retrieving OpenEvents and filtering on the OpenDate using a date range, you will receive all open events that occurred within the specified date range. This includes opens from messages where the send occurred outside of the specified data range. Send EmailYou can schedule and send emails with the AMP SOAP Web Service API. You can identify message recipients using dynamic, rule-based segmentation of lists, events, and profiles. After the send, you can use the web service API to return aggregate statistics. NOTE: Please note that at this time, the SOAP Web Service API's scope does not include certain functions related to account configuration, such as configuring private IP addresses, dedicated domains, and file transfer locations. The API also offers little control over the creation and execution of file transfer activities, groups, and data filters. AuthenticationAuthenticating to the AMP SOAP Web Service API requires passing a WS-Security 1.0 security token in the SOAP header. Development Platform Support for WS-Security 1.0
JavaYou can connect to the web service API using Java. Review the linked document for instructions and code samples illustrating how to make that connection. ExactTarget recommends using the Axis2 client. If authenticating with other Java SOAP clients, visit the Developer Community at http://code.exacttarget.com. Samples are available for Axis1.4, Axis2, and CXF. PHPYou can connect to the web service API using PHP. Review the linked document for instructions and code samples illustrating how to make that connection. Asynchronous ProcessingYour account can be configured to queue calls and process them asynchronously, rather than processing each call at the time it is made. Asynchronous processing prevents dropping calls that are made when the service is unavailable. If you use asynchronous processing for your triggered emails, ExactTarget also offers a feature to allow you to set the priority of the email send. Contact ExactTarget if you are interested in enabling this functionality. Expected Response Times for Typical Synchronous CallsResponse times for calls vary depending on the types of calls and the amount of data handled by that call. These values represent expected and approximate times and should not be interpreted as guarantees:
DeliverabilityWhen planning your integration, consider the following deliverability issues. If you have questions, contact your ExactTarget account manager. Opt-inLists coming into ExactTarget-whether programmatically or via the ExactTarget user interface - must contain subscribers who have opted-in. CAN-SPAMMarketing emails must comply with CAN-SPAM (Controlling the Assault of Non-Solicited Pornography) and Marketing laws Transactional emails are less restricted by CAN-SPAM laws. If you have question about whether an email is commercial or transactional, contact ExactTarget's deliverability team. Deliverability ReportsDeliverability reports for an account or subaccounts are sent to the email address associated with the main SOAP web service API account. Private Domain / Private IP AddressSOAP web service API accounts must have a private domain and private IP address to protect your integration from potential abuse from other SOAP web service API enabled accounts. From AddressAs much as possible, you should require that sub-accounts use From addresses that are not tied to free email providers like Hotmail, Yahoo, and Gmail. Using a free-email provider email address can decrease the deliverability of your customers' email messages (since Yahoo knows the email was not sent from Yahoo). Error HandlingThe SOAP web service commands can act on multiple objects in a single call. Layers of error handling support the flexibility offered by the SOAP web service API. Command LevelEach command returns single string representing the overall status of the action. This status can help you understand of any error occurring during the processing of the command. Example String status =
integrationFramework.Execute(ref requestID, new ExecuteRequest[] { request }, out results);
// Command Level Status:
// status = OK, Has Error, or Error
Command-Level Status Values
Object LevelCreateResult[] results =
integrationFramework.Create(new CreateOptions(), subscribers, out requestid, out status);
// Print out results for each new object created
foreach (CreateResult result in results) {
Console.WriteLine(string.Format("Results for object {0}: Status code: {1}. Message: {2}.", result.OrdinalID, result.StatusCode, result.StatusMessage));
}
Output
Each command also returns a collection of result objects. Each result object contains both an overall status and a status message. The status message will contain details about the overall status. Object-Level Status Values
Triggered EmailsSee the Triggered Emails Scenario Guide for Developers for detailed information on implementing triggered emails with the Web Service API. InternationalizationThe SOAP web service API allows emails to be sent in a variety of character sets. However, this broad support does not guarantee that content will be correctly displayed across international email clients. You should test international emails extensively. Supported Encoding for Outbound EmailsThe default encoding for outbound email is us-ascii. The default can be overridden with any of the following encoding types:
The character set of an email can be overridden when the Email object is created or when the email is associated with a Send object. Example Email email = new Email(); email.CharacterSet = "UTF-8"; Send send = new Send(); send.Email... // other email information send.Email.CharacterSet = "UTF-8"; Email Creation and InternationalizationUnicode is supported for the email subject line, HTML body, and text body. Example Email email = new Email(); email.Subject = "Unicode Supported"; email.HTMLBody = "Unicode Supported"; email.TextBody = "Unicode Supported"; Unicode is also supported for attribute values if ExactTarget does not serve as database of record. Triggered Emails and InternationalizationIt is possible to create different TriggeredSendDefinitions for each language - complete with different email content types and headers and footers. For example, if an application needs to support Chinese and Unicode content types for transactional emails, you can programmatically reference the associated TriggeredSendDefinitions as follows: Example String encoding = "big5"; TriggeredSendDefinition tsd = new TriggeredSendDefinition (); tsd.CustomerKey = encoding + " Order Confirmation"; TriggeredSend ts = new TriggeredSend(); TriggeredSend.TriggeredSendDefinition = tsd; ... // additional triggered send information The benefits of this approach include a single account for all content types and rollup reporting by language. Null ValuesDepending on the development platform used in your integration and the WSDL proxy used, a generated object may have some additional properties to handle null values. The following code samples are examples from .NET 2.0 (for the development environment) and WSE 3.0 (the proxy generator). Due to the way .NET (and other platforms such as Java) handles value types with a null value, the proxy generator outputs additional properties to provide the null value granularity assumed by the WSDL. Example // Set a non-null value send.ID = 2345; send.IDSpecified = true; Retrieving Objects and Sub-ObjectsSome WSDL objects include sub-objects with individual properties. In order to retrieve the information for those sub-objects, you must specify those properties on the sub-object in your call. For example, the Send object includes Client and Email sub-objects, and you can specify the ID of those sub-objects in order to retrieve that information. To get information on those sub-objects, perform a retrieve on the Send object and include the Send.Client.ID and Send.Email.ID properties in that call. Once you have retrieved that information, you can use the IDs to perform a second retrieve and get more information about those sub-objects. Not all properties on all sub-objects are available to be retrieved. In general, you can perform retrieves using ID, ObjectID, and CustomerKey. Working with DatesExactTarget stores dates in Central Standard Time (CST) with no variation for Daylight Savings Time. When setting dates on objects, use a Coordinated Universal Time (UTC) offset for best results (UTC-6:00). When retrieving dates, convert the dates to the UTC offset to ensure dates are in the format suitable for your application. Managing DowntimeWhen building an integration with an external SOA service, it is useful to have a queuing mechanism in place as part of your architecture to handle any downtime related to ExactTarget or your application. ExactTarget provides an asynchronous architecture that can receive calls regardless of system status to handle issues related to ExactTarget systems. For Internet-related issues, having appropriate queues in place helps when delivering mission critical emails. Effective use of the GetSystemStatus call can allow an application to gracefully handle any downtime related to ExactTarget, the internet, or your application. Below is an example of the GetSystemStatus call. Do not run this call prior to every web service call, but only on exception scenarios. For example, if you receive a SOAP fault or another unexpected error, run this call to ensure the exception was not the result of ExactTarget system maintenance. // 1. Invoke the GetSystemStatus Call
string message;
SystemStatusResult[] results =
integrationFramework.GetSystemStatus(null, out status, out message, out requestID);
// 2. Output the Overall Status of the Request
Console.WriteLine("Status: {0}", status);
// 3. Output the Status of the System
foreach (SystemStatusResult result in results)
{
Console.WriteLine("_________________");
Console.WriteLine(result.SystemStatus);
}
Supported StandardsThe SOAP API supports the following standards:
This page was last updated by Ryan Williams on Tue, 24 Jan 2012 13:23:04 GMT. If you require assistance with the ExactTarget application, please contact Global Support. If you wish to send Ryan direct feedback, fill out the form below:
Tags: (Edit tags)
|
||||||||||||||||||||||||||||||||||||||||||||||
Powered by MindTouch 2010 |