Getting Started

This API documentation includes everything you need to start building your application. Whether you wish to create a connection with your CRM, CMS, website or other platform, you can simply choose the services that you want to include in your integration.
 

Before you start programming, you need to download the WSDL file.

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.

Example

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.

Example Basis (PHP 5)

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);
}
?>

Headers

Type: APIRequestHeader

The APIRequestHeader type is used for authentication on each request that is performed on the Flexmail API.

Table: Parameters for APIRequestHeader type

Parameter Mandatory Type Discription
userId Y Integer The user id, from the account you wish to access.
userToken Y String Your personal token

Type: APIResponseHeader

The APIResponseHeader type returns information on authentication. Any errors which occur on authentication are contained in the APIResponseHeader type.

Table: Parameters for 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
 

Table: List of all possible error codes

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
206 User is no longer active
207 This feature is not supported for your account

You are now ready to integrate the services.

API Deprecation status

Although Flexmail strives to make updates to its APIs compatible with all previous versions, there are times when an API becomes outdated and Flexmail must deprecate the API in order to provide a better service to its customers. API services will continue to be available during their deprecation period.

The table below lists the API services that are, or will soon be, deprecated.

Service Deprecation date Sunset date Notes
GetProfileUpdates 01-02-2022 No longer works for accounts using the interests feature
GetSubscriptions 01-02-2022 No longer works for accounts using the interests feature
GetUnsubscriptions 01-02-2022 No longer works for accounts using the interests feature
CreateGroup 01-02-2022 No longer works for accounts using the interests feature
CreateGroupSubscription 01-02-2022 No longer works for accounts using the interests feature
DeleteGroup 01-02-2022 No longer works for accounts using the interests feature
DeleteGroupSubscription 01-02-2022 No longer works for accounts using the interests feature
GetGroups 01-02-2022 No longer works for accounts using the interests feature
GetGroupSubscriptions 01-02-2022 No longer works for accounts using the interests feature
GetGroupUnsubscriptions 01-02-2022 No longer works for accounts using the interests feature
UpdateGroup 01-02-2022 No longer works for accounts using the interests feature
CreatePreference 01-02-2022 No longer works for accounts using the interests feature
CreatePreferenceSubscription 01-02-2022 No longer works for accounts using the interests feature
DeletePreference 01-02-2022 No longer works for accounts using the interests feature
DeletePreferenceSubscription 01-02-2022 No longer works for accounts using the interests feature
GetPreferences 01-02-2022 No longer works for accounts using the interests feature
GetPreferenceSubscriptions 01-02-2022 No longer works for accounts using the interests feature
GetPreferenceUnsubscriptions 01-02-2022 No longer works for accounts using the interests feature
ImportPreferenceSubscriptions 01-02-2022 No longer works for accounts using the interests feature
UpdatePreference 01-02-2022 No longer works for accounts using the interests feature
AccountAddCredits 01-11-2021 01-12-2021 This functionallity as a SOAP service is deprecated and only available via the Agency UI
AccountRevokeCredits 01-11-2021 01-12-2021 This functionallity as a SOAP service is deprecated and only available via the Agency UI
CreateAccount 01-11-2021 01-12-2021 This functionallity as a SOAP service is deprecated and only available via the Agency UI
DeleteAccount 01-11-2021 01-12-2021 This functionallity as a SOAP service is deprecated and only available via the Agency UI
GetAccounts 01-11-2021 01-12-2021 This functionallity as a SOAP service is deprecated and only available via the Agency UI
UpdateAccount 01-11-2021 01-12-2021 This functionallity as a SOAP service is deprecated and only available via the Agency UI
CreateEmailAddress 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
CreateSource 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
DeleteEmailAddress 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
GetCustomFields 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
GetEmailAddresses 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
GetSources 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
ImportEmailAddresses 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
UpdateEmailAddress 09-06-2020 No longer works for accounts using the interests feature. Contacts can be managed via our REST API.
CreateMailingList 19-09-2017 No longer works for accounts using the interests feature
DeleteMailingList 19-09-2017 No longer works for accounts using the interests feature
GetMailingLists 19-09-2017 No longer works for accounts using the interests feature
TruncateMailingList 19-09-2017 No longer works for accounts using the interests feature
UpdateMailingList 19-09-2017 No longer works for accounts using the interests feature