HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

## Java

The native Java API is based on Axis (tested with version 1.2) and is accessed via a **factory class**.

The following libraries must be embedded:

  • optivo-broadmail-api\*.jar (this library can be found in [this ZIP file](🔗))

  • axis\*

  • axis-jaxrpc\*

  • org.apache.commons

  • commons-discovery\*

  • commons-logging\*

  • javax.mail\*

  • wsdl4j\*


## PHP

The webservice API can be queried directly and easily using the native PHP SOAP interface (from PHP 5.0.1 and newer). Whenever the API expects binary data (java.langByte[]), these must be submitted as a string. The string must represent the binary data. To read the binary data of a file, you may use the operation file\_get\_contents(). The following example shows the login and adding of an email address to a recipient list:

You can find the below mentioned **mandatorId** (i.e., the client ID) by performing the following steps:

  1. Open the Optimizely Campaign start menu and, under **Administration**, click **API Overview**

    The **API Overview** window opens.

  2. Switch to the **SOAP API** tab.

    Beneath the **Client ID** heading, you can find the client ID of the client you are currently working in.

Sample script for the native SOAP interface (from PHP 5.0.1):

#### Libraries for older PHP versions

If you are using an older PHP version (prior to version 5.0.1), we provide a library and samples in the archive file of this documentation to embed in your PHP. For PHP version 5.0.1 and newer, this library is deprecated, since it comes with a native SOAP client.

The following example shows the login and query of the blocklist status of an email address:

Sample script for NuSOAP Interface for older PHP Versions:

## .NET

If you want to use the SOAP-API with a .NET framework, all methods that require to submit a multidimensional array or return such arrays must be replaced by replacement methods. The reason for this is that .NET does not support processing of multidimensional arrays.


To query several recipients in the **RecipientWebservice**, the default method **getAll** would return a multidimensional array with the following pattern:

This array cannot be processed by the .NET framework. Use the replacement method **getAllFlat** instead. The returned array in this method has been flattened to the following pattern:

To process this array, the fields must be indexed to allocate the respective fields to one recipient.