A WSDL (Web Services Description Language) defines the interface for a SOAP Web services API. Normally, you use the WSDL file with a programming environment, such as Visual Studio or Axis, that generates classes or objects for calling the API. For PHP web applications, all that is necessary to use SOAP is to enable the SOAP Extension. The WSDL File: https://soap.flexmail.eu/3.0.0/flexmail.wsdl
The service itself connects to: https://soap.flexmail.eu/3.0.0/flexmail.php
Notice: rate limiting is effected to 60 calls/minute.
Every section of the API comes with a PHP 5 example. The examples put together are in fact one application, which is build up along the way. This is also the reason why the code cannot be repeated over and over again. The creation of the SOAPClient is only shown once, since it is a basic building block.
After you have saved the WSDL file to your local working directory, you need to create a new SOAP Client. The example below shows you how to do that. From now on in this reference guide the variable "$SoapClient" will reference to this SOAP Client.
<?php
try {
$SoapClient = new SoapClient('flexmail.wsdl', array(
'location' => 'https://soap.flexmail.eu/3.0.0/flexmail.php',
'uri' => 'https://soap.flexmail.eu/3.0.0/flexmail.php',
'trace' => 1
));
} catch(Exception $ex) {
echo "SOAP Exception\r\n";
print_r($ex);
}
?>
The APIRequestHeader type is used for authentication on each request that is performed on the Flexmail API.
Parameter | Mandatory | Type | Discription |
---|---|---|---|
userId | Y | Integer | The user id, from the account you wish to access. |
userToken | Y | String | Your personal token |
The APIResponseHeader type returns information on authentication. Any errors which occur on authentication are contained in the APIResponseHeader type.
Parameter | Mandatory | Type | Discription |
---|---|---|---|
errorCode | / | Integer | Numerical value of the error |
errorMessage | / | String | Short literal description of the error |
timestamp | / | String | Timestamp, format: YYYY-MM-DDTHH:ii:ss |
Code | Description |
---|---|
0 | No error |
201 | User ID is mandatory |
202 | User ID is invalid |
203 | User Token is mandatory |
204 | IP Address is not connectable |
205 | Invalid token |
You are now ready to integrate the services.