Web services
Describes how to use the web services in Optimizely Campaign.
Basically, you need three things to use the web services in Optimizely Campaign:
- A functional SOAP 1.1 client environment
- A valid Optimizely Campaign account that has the permission to access the SOAP API (provided by Optimizely)
- A client ID (provided by Optimizely)
List of web services
- AttachmentWebservice: Query, create or update attachments
- BlacklistWebservice : Query, update or remove blocklist entries as well as determine whether a given email address is blocked
- ClosedLoopWebservice: Manage closed-loop processes
- CouponBlockWebservice: Create coupon blocks, query names and assignments and delete blocks
- CouponCodeWebservice: Create, query and delete coupon codes
- FolderWebservice: Retrieve information about folders, create folders, move or delete folders
- MailIdWebservice: Provides access to detailed information about a mail ID
- MailingReportingWebservice: Query statistics for a mailing
- MailingWebservice: Query, create, update, remove or start mailings as well as send emails on demand
- OptinProcessWebservice: Provides methods to access the opt-in processes
- RecipientFilterWebservice: Query, create or update recipient filters
- RecipientListWebservice: Query or update recipient lists
- RecipientWebservice: Query, add, update and remove recipients
- ResponseWebservice: Query email responses on a mailing or recipient basis, reset the bounce counter
- SessionWebservice: Session handling (login, logout etc.) for all web services
- Soap11Webservice: Basic interface for all web services
- SplitMailingWebservice: Query, create, edit and delete split mailings
- UnsubscribeWebservice: Query, update or delete unsubscribes
Validity of a session
A session is always valid for 20 minutes, i.e., after this time the so-called sessionId becomes invalid and you must request a new one. To do so, use the login method.
Web service endpoints
Currently, all web services are deployed RPC-encoded only. Each web service is deployed under a URL of the form. We recommend always using an encrypted SSL connection using the HTTPS protocol:
http://api.campaign.episerver.net/soap11/Rpc[WebserviceName]
https://api.campaign.episerver.net/soap11/Rpc[WebserviceName]
Note
Replace [WebserviceName] with the name of the actual web service without the term webservice. For example, the SessionWebservice is deployed under the URL http://api.campaign.episerver.net/soap11/RpcSession.
Coupon system web services
The WSDLs for the CouponBlock and CouponCode web service of the coupon system can be found under the following links:
https://api.campaign.episerver.net/soap11/addons/CouponCode?wsdl
https://api.campaign.episerver.net/soap11/addons/CouponBlock?wsdl
Note
These web services are not part of the standard distribution of our SOAP API. They must be activated separately. To do this, you need the Optimizely Campaign add-on coupon system. Contact [email protected] if you want to use this function.
Error messages
Throughout the whole API, errors are reported as exceptions (SOAP faults). So you should implement some kind of error handling on the client side.
Note
Due to updates on the API, HTTP responses will no longer contain the default reason phrase (status description) appended to the HTTP status code, such as HTTP 200 "OK" or HTTP 404 "NOT FOUND". If your API client relies on the reason phrase, and to avoid system failures, please adjust your API response handling to ignore the reason phrase until 2021-12-31. See also HTTP specification RFC 7230 3.1.2.
Usage example
Here is a short example (written in pseudo Java syntax) that illustrates the process flow of a web service session:
// Login to the client 1234
// The session ID obtained by this call is needed to call any other webservice's method.
// A session is valid for 20 minutes. String sessionID = SessionWebservice.login(1234, "myusername", "mypassword");
// Call some methods. In this example we retrieve the ids of all regular mailings available. long[] mailingIds = MailingWebservice.getIds(sessionId, "regular");
// Now do something with the mailingIds ...
// Finally logout SessionWebservice.logout (sessionId);
Updated over 1 year ago