---
title: Web services
slug: campaign/docs/basic-usage
docTags: 
createdAt: 2026-07-02T19:01:45.566Z
---

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](docId\:zjgezJtp-SUqL9S6F8q5m): Query, create or update attachments
- [BlacklistWebservice](docId:0gWaAb-vbrfGt8P1bZBeh) : Query, update or remove blocklist entries as well as determine whether a given email address is blocked
- [ClosedLoopWebservice](docId\:L49NHN1OBPWVZK4NmhEql): Manage closed-loop processes
- [CouponBlockWebservice](docId\:IPOsxm9zm-NkgOZii9mqL): Create coupon blocks, query names and assignments and delete blocks
- [CouponCodeWebservice](docId\:hRztGKS1lpHJYMgpaJlO8): Create, query and delete coupon codes
- [FolderWebservice](docId\:xP1E9n3J-7RS8ZuTdu5AO): Retrieve information about folders, create folders, move or delete folders
- [MailIdWebservice](docId\:nrghOv9wEIlJ_r41HkUP-): Provides access to detailed information about a mail ID
- [MailingReportingWebservice](docId\:oVKoOF-7PkXOepKHF3OuJ): Query statistics for a mailing
- [MailingWebservice](docId:6NE7K_nyXFh5S_4OHoOLj): Query, create, update, remove or start mailings as well as send emails on demand
- [OptinProcessWebservice](docId\:vD7tf-oQJRYiADICVBeUH): Provides methods to access the opt-in processes
- [RecipientFilterWebservice](docId\:xmPsVLf4ck0PCtcoP2alH): Query, create or update recipient filters
- [RecipientListWebservice](docId\:im4D2oZbUxhUu04J_TUkF): Query or update recipient lists
- [RecipientWebservice](docId:6UIciUqK5w3NMqRyyJytu): Query, add, update and remove recipients
- [ResponseWebservice](docId\:lEdZccZZ6EwDmOJC0SBhi): Query email responses on a mailing or recipient basis, reset the bounce counter
- [SessionWebservice](docId\:Vn6ogYCtGCpkWKkkudvqj): Session handling (login, logout etc.) for all web services
- [Soap11Webservice](docId\:bWlb6pQ4aBSslQ571UAFI): Basic interface for all web services
- [SplitMailingWebservice](docId:2_h80v9kKJe6fpMklLPpt): Query, create, edit and delete split mailings
- [UnsubscribeWebservice](docId\:MU73S3M0DWMgcGd4EhQ3C): 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](docId\:tlboO9VcGDFaQwTiLsSwi) 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:

```javascript
http://api.campaign.episerver.net/soap11/Rpc[WebserviceName]
https://api.campaign.episerver.net/soap11/Rpc[WebserviceName]
```

::::hint{type="info"}
**Note**
Replace

:::BlockQuote
Replace **\[We** 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](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:

```javascript
https://api.campaign.episerver.net/soap11/addons/CouponCode?wsdl
https://api.campaign.episerver.net/soap11/addons/CouponBlock?wsdl
```

:::hint{type="info"}
**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](docId\:V5OJDVRBAoUBDge9djCe6). Contact [support@optimizely.com](mailto\:support@optimizely.com) 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.

:::hint{type="info"}
**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](https://datatracker.ietf.org/doc/html/rfc7230#section-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:

```javascript
// 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);
```
