|
|
SOAP API Best PracticesFrom $1Table of contents
(Click the banner to go to the related Docs.Code.ExactTarget.com page.) This document presents a broad conceptual overview of ExactTarget's SOAP API. Review this document to understand how the SOAP API can be used to interact with ExactTarget's application and accomplish specific tasks. Read this page to understand the difference between the XML and SOAP APIs offered by ExactTarget. Workflow Best PracticesYou can use the SOAP API to interact with the ExactTarget application and accomplish the following tasks outlined in the diagrams below:
This list does not present the complete capabilities of the SOAP API, but it illustrates a common workflow for SOAP API users. You can view more specific examples of workflows: Importing Data via the SOAP API
When you define an import activity for a data file, you provide the following information about the source file to import and the destination of the data:
When you define an import activity for a Salesforce report or object, you provide the following information:
When you save an import definition configured to import a Salesforce object or report, the system auto-creates the data extension according to the schema of the object or report. After the data extension is created, you cannot change the data source. Interaction Best PracticesYou can access the SOAP API using several different languages:
The linked articles include instructions and sample code. A complete list of available sample code and technical articles can be found here. Standard API UsersStandard API users can interact with the API to accomplish all tasks outlined above. Enterprise API UsersIn addition to the tasks that can be accomplished by standard API users, enterprise API users can use the API to work with different business units and account users. This includes the ability to perform the following actions:
More information can be found in the Managing Enterprise 2.0 Accounts with the Web Services API document. Embedded API UsersEmbedded API users can interact with the SOAP API in the same manner as standard API users, but they can also utilize additional functionality that allows them to control the accounts and sub-accounts of their clients. That functionality includes the following examples: Architecture and Coding Best PracticesThis section outlines the best practices (both in general and for specific languages) for interacting with the SOAP API. GeneralThese best practices apply in all instances, regardless of language. PlanningUse the best practices below to plan for the eventualities that could be encountered with your use of the SOAP API.
You can use multiple concurrent API sessions to increase overall throughput. However, note that a large number of sessions may result in diminishing returns. Test your API calls thoroughly to ensure that you are using the optimum number of concurrent API sessions. Maintaining Service Level AgreementsExactTarget agrees to maintain consistent levels of service through the use of service level agreements, or SLAs. You should observe the best practices below in order to ensure the performance outlined in your SLA:
Monitoring Sends Through the SOAP APIThe best way to monitor sends through the API is by polling the Send object on the following properties:
NumberSent will increment as the send is processing. Processing will be complete once SentTime has a value. If you have programs enabled for your account, you can set up those programs in your account's user interface and begin the programs from the SOAP API. You can also modify the components of that program (such as import definitions and email send definitions) through the SOAP API to better define the information you would like to use in monitoring your sends. By automating these tasks, you can gain an understanding of how a send is progressing by which tasks are being executed. Triggered SendsUse the best practices outlined below to improve the performance of your triggered sends via the SOAP API. This logic allows you take advantage of the instant notifications of the synchronous API and the solid reliability of the asynchronous API.
Retrieving Data from the ApplicationUse data extracts to retrieve information from the system whenever possible. Examples of data extract use can be found in the articles below: Connection Failures and TimeoutsYou should configure your code to handle potential problems with connecting to the SOAP API. Use the best practices outlined below to help your system handle these connectivity issues:
SecurityWhen interacting with the web service API, you should observe these best practices in order to maintain a secure connection between your integration or development environment and the ExactTarget system. Give Each User Separate API CredentialsMake sure that each user interacting with the web service API has their own username and password. You can set separate permissions for each user, ensuring that users have access to only those features that they need to complete their tasks using the web service API. Credentials should not be shared between users. A single, shared API user should be used ONLY for system-based processes, and that account should have only essential permissions applied to it. All other processes should be initiated by specific users. Always store your API endpoint, username, and password in a configuration file. This allows you to change this information quickly without requiring you to redeploy this code. Restrict Integration Partner Access to Necessary Functions OnlyIntegration partners should only be able to access those functions that are absolutely necessary to make the integration function. All other functions should be strictly restricted to prevent potential security issues. Use Strong PasswordsAll users with API access should use strong passwords.
No matter how strong your password is, you should regularly change it (either manually or by allowing your password to expire) to make it more difficult to guess or obtain your password. Data ManagementUse the best practices outlined below to best maintain your data.
.NETAll optional, value-type properties of an object (such as the Int, bool, and enum types) have an additional Boolean property defined with Specified appended to the name. This property is used to tell the XML Serializer whether the corresponding property should be included when generating the XML that will be sent. When deserializing, this property indicates whether the corresponding property was included in the XML. For example, the Subscriber object has an optional property called Status. When the proxy class is generated, a "StatusSpecified" property will also be created. When sending an object, if you specified a value for "Status", you must also set "StatusSpecified=true". If you do not, the value of "Status" will not be serialized and sent to the server. When receiving an object, you should check if "StatusSpecified=true". If it is, then you know that a "Status" value was received and the data in the "Status" property is valid. If "StatusSpecified=false", the value in "Status" will be the default value for that properties data type. In the following table, if you use the code in the first column, the second column shows the XML that will be generated. If you start with the XML in the second column, the third column shows what the properties will be set to.
To avoid confusion and possible bugs in your code, you should always be explicit as indicated in the first row. When processing received objects, you should use the following pattern: if (subscriber.StatusSpecified)
{
Console.WriteLine(subscriber.Status);
}
else
{
Console.WriteLine("The subscriber.Status property was not set");
}
Synchronous vs. Asynchronous SOAP APIYou can interact with the SOAP API in either a synchronous or asynchronous manner. The SOAP API processes synchronous calls at the time they are received, while it queues asynchronous calls and processes them in a specified order. ExactTarget recommends interacting with the SOAP API asynchronously as much as possible in order to ensure that API calls can be processed in the order you desire (supporting conversations) and avoid accidentally reprocessing calls due to connection interruption. You can find more information about interacting asynchronously with the SOAP API in the Asynchronous Processing technical article. This page was last updated by Ryan Williams on Fri, 06 Jan 2012 20:45:31 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 |