Contents

  1. Rest API
    1. API Base URLs
    2. Types
    3. Parameter Locations
    4. Responses
    5. Error responses
    6. Authentication
  2. Resource URLs
  3. Resource Models

REST API

The SendPro API is a RESTful API. Everything you can manipulate is a resource with its own unique URL. The API calls are identified by their resource URL and HTTP method.

The following HTTP methods are used:

The requests and responses for all requests (except the OAuth2 authentication calls) are in JSON format. There is no guarantee about the field ordering in JSON responses.

All requests should contain the Accept header with value application/vnd.flowmailer.v1.12+json.

The OAuth2 authentication requests are in application/x-www-form-urlencoded format. The authentication responses are in JSON format.

API Base urls

OAuth2 https https://login.flowmailer.net
http http://api.flowmailer.net
https https://api.flowmailer.net

Types

Name Format Example Description
integer 12640 A whole number
boolean true, false true
string Test flow Text string
base64 RXhhbXBsZQo= Base64 encoded binary data as described by rfc4648
items_range items={start}-{end} items=0-10 Range header
ref_range items={reference}:{count} items=:10 or items=REFERENCE:10 Range header
content_range (when call used items_range) items {start}-{end}/{total} items 0-10/22 or items 0-10/>10000 Content-Range header
content_range (when call used ref_range) items {startref}:{endref}/* items REFERENCE:REFERENCE/* Content-Range header
date yyyy-MM-dd'T'HH:mm:ssZZ 2014-12-16T05:50:11Z ISO8601 datetime format without milliseconds
date_range yyyy-MM-dd'T'HH:mm:ssZZ,yyyy-MM-dd'T'HH:mm:ssZZ 2014-12-16T05:50:00Z,2014-12-16T06:00:00Z Start and end date in ISO8601 format (without milliseconds) separated by a comma. Start date is inclusive and end date is exclusive.

Parameter locations

The SendPro REST API uses request parameters in different locations: path, matrix, query, form and body.

Arrays (types ending with []) in path and matrix parameters should be structured as comma-separated values.

path

Path parameters appear in the URL path component as a complete path segment.

Example url with path parameter with value 123:
http://api.flowmailer.net/123/flows

matrix

Matrix parameters appear in the URL path component, at the end of a path segment and begin with a semicolon (;). Matrix parameters are separated by a semicolon (;), each parameter is a name value pair separated by an equal sign (=).

Example url with matrix parameter daterange with value 2014-12-16T05:50:00Z,2014-12-16T06:00:00Z:
http://api.flowmailer.net/123/messages;daterange=2014-12-16T05:50:00Z,2014-12-16T06:00:00Z

query

Query parameters appear in the URL query component, the query component starts with a question mark (?). Query parameters separated by ampersand (&), each parameter is a name value pair separated by an equal sign (=).

Example url with query parameter addreturns with value true:
http://api.flowmailer.net/123/messages?addreturns=true

form

Form parameters do not appear in the URL. They are encoded as application/x-www-form-urlencoded and supplied as request body.

Example request body with two form parameters grant_type with value client_credentials and scope with value api:
grant_type=client_credentials&scope=api

body

There can only be one body parameter per request and it is an model object encoded as json and supplied as the request body.

The Content-Type header for the request should be application/vnd.flowmailer.v1.12+json.

Example request body:
{
    "name" : "value",
    "name2" : "value2"
}

Responses

All API responses are in JSON format and have the with mime type application/vnd.flowmailer.v1.12+json.

The following response codes are used by the SendPro API for success conditions:
HTTP Status code Extra headers Description
200 Ok Used to indicate that the request was successful
201 Created Location header Used to indicate that the response contains a Location header with the URL of the newly created API resource
206 Partial Content Content-Range and Next-Range header Used as indication that a subset of the requested data is returned. Only applicable to requests with the Range header

Error responses

The following response codes are used by the SendPro API for failure conditions:
HTTP Status code Description Extra headers Response Model
400 Bad Request Errors
403 Forbidden Exception
404 Not Found Exception
401 Unauthorized, reason is specified in the WWW-Authenticate header and response body, used for example when the access token is expired WWW-Authenticate header OAuthErrorResponse
500 Internal Server Error

Authentication

The SendPro REST API requires authentication using OAuth 2. A full specification for OAuth 2 is available in rfc6749.

Supported authentication types:

To use the SendPro API, an access token must be requested using the client id and secret. The access token must be included with every API call in the Authorization header using authentication scheme Bearer.

Access tokens are valid for 1 minute. When an access token expires, API calls using that token will result in a 401 Unauthorized http response. The 401 response will have a JSON encoded response body of type OAuthErrorResponse with error invalid_token. This response signals that the current access token is expired or invalid and a new access token should be requested.

Example Authorization header:
Authorization: Bearer e600a31c-cf8f-4c0a-8f26-386c555f6a54

Example API call sequence:

Resource URLs

POST /oauth/token

This call is used to request an access token using the client id and secret provided by flowmailer.

The form parameters must be posted in application/x-www-form-urlencoded format. But the response will be in JSON format.

Resource URL

Type URL format
POST https://login.flowmailer.net/oauth/token

Parameters

Name Location Type Required Default Description
client_id form string yes The API client id provided by Flowmailer
client_secret form string yes The API client secret provided by Flowmailer
grant_type form string yes must be client_credentials
scope form string no api Must be absent or api

Response Messages

HTTP Status Code Response Model Response Headers Description
200 OAuthTokenResponse The request was successfull, the access token can be found in the JSON encoded response
400 OAuthErrorResponse Bad Request, could also be an text/html response if the credentials are invalid

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

client_id=
client_secret=
grant_type=
scope=api

curl -s -X POST "https://login.flowmailer.net/oauth/token" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=${client_id}&client_secret=${client_secret}&grant_type=${grant_type}&scope=${scope}"
<?php
$client_id     = '';
$client_secret = '';
$grant_type    = '';
$scope         = 'api';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/x-www-form-urlencoded',
        ],
        'content' => http_build_query([
                'client_id' => $client_id,
                'client_secret' => $client_secret,
                'grant_type' => $grant_type,
                'scope' => $scope,
            ]),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    'https://login.flowmailer.net/oauth/token',
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

$access_token = $response->access_token;

GET /{account_id}/event_flow_rules

Get flow rule list for all event flows

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/event_flow_rules

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 FlowRuleItem[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\FlowRuleItemCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var FlowRuleItemCollection $result */
try {
    $result = $flowmailer->getEventFlowRules();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/event_flow_rules" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flow_rules',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/event_flow_rules HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[]

GET /{account_id}/event_flow_rules/hierarchy

Get flow rule list for all event flows

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/event_flow_rules/hierarchy

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 FlowRuleHierarchyItem[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\FlowRuleHierarchyItemCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var FlowRuleHierarchyItemCollection $result */
try {
    $result = $flowmailer->getEventFlowRulesHierarchy();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/event_flow_rules/hierarchy" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flow_rules/hierarchy',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/event_flow_rules/hierarchy HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[]

GET /{account_id}/event_flows

List flows per account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/event_flows

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 EventFlow[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\EventFlowCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var EventFlowCollection $result */
try {
    $result = $flowmailer->getEventFlows();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/event_flows" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/event_flows HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[]

POST /{account_id}/event_flows

Create a new flow

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/event_flows

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body EventFlow yes

Flow object

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\EventFlow;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$description = 'description';

$eventFlow = (new EventFlow())
   ->setDescription($description)
;

try {
    $result = $flowmailer->createEventFlow($eventFlow);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/event_flows" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

DELETE /{account_id}/event_flows/{event_flow_id}

Delete flow by id

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/event_flows/{event_flow_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

event_flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$eventFlowId = '';

try {
    $result = $flowmailer->deleteEventFlow($eventFlowId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
event_flow_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/event_flows/${event_flow_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id    = '';
$event_flow_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows/%s',
      $account_id,
      $event_flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/event_flows/{event_flow_id}

Get flow by id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/event_flows/{event_flow_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

event_flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 EventFlow

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\EventFlow;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$eventFlowId = '';

/** @var EventFlow $result */
try {
    $result = $flowmailer->getEventFlow($eventFlowId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
event_flow_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/event_flows/${event_flow_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id    = '';
$event_flow_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows/%s',
      $account_id,
      $event_flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

PUT /{account_id}/event_flows/{event_flow_id}

Save flow

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/event_flows/{event_flow_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body EventFlow yes

Flow object

event_flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 EventFlow

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\EventFlow;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$description = 'new description';

$eventFlowId = '';
$eventFlow   = (new EventFlow())
   ->setDescription($description)
;

/** @var EventFlow $result */
try {
    $result = $flowmailer->updateEventFlow($eventFlowId, $eventFlow);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
event_flow_id=
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/event_flows/${event_flow_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id    = '';
$event_flow_id = '';
$body          = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows/%s',
      $account_id,
      $event_flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/event_flows/{event_flow_id}/rule

Get flow conditions for a flow

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/event_flows/{event_flow_id}/rule

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

event_flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 EventFlowRuleSimple

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\EventFlowRuleSimple;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$eventFlowId = '';

/** @var EventFlowRuleSimple $result */
try {
    $result = $flowmailer->getEventFlowRule($eventFlowId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
event_flow_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/event_flows/${event_flow_id}/rule" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id    = '';
$event_flow_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows/%s/rule',
      $account_id,
      $event_flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

PUT /{account_id}/event_flows/{event_flow_id}/rule

Set conditions for a flow

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/event_flows/{event_flow_id}/rule

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body EventFlowRuleSimple yes

Flow conditions

event_flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\EventFlowRuleSimple;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$eventFlowId         = '';
$eventFlowRuleSimple = new EventFlowRuleSimple();

try {
    $result = $flowmailer->updateEventFlowRule($eventFlowId, $eventFlowRuleSimple);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
event_flow_id=
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/event_flows/${event_flow_id}/rule" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id    = '';
$event_flow_id = '';
$body          = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/event_flows/%s/rule',
      $account_id,
      $event_flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/filters

List filters per account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/filters

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

daterange matrix date_range no

Date range the filter was added in

range header ref_range yes

Limits the returned list

sortorder query string no

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Filter[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\FilterCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 39;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$range     = new ReferenceRange($count, $reference);
$daterange = new DateRange($startDate, $endDate);
$sortorder = '';

/** @var FilterCollection $result */
try {
    $result = $flowmailer->getFilters($range, $daterange, $sortorder);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
sortorder=
range=items=:10

curl -s -X GET "https://api.flowmailer.net/${account_id}/filters;daterange=${daterange}?sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id = '';
$daterange  = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$sortorder  = '';
$range      = 'items=:10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$query    = '?'.http_build_query([
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/filters%s%s',
      $account_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/filters;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=:10

Response

HTTP/1.1 206 Partial Content
Content-Range: items :10/*
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[]

DELETE /{account_id}/filters/{filter_id}

Delete a recipient from the filter

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/filters/{filter_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

filter_id path string yes

Filter ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$filterId = '';

try {
    $result = $flowmailer->deleteFilter($filterId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
filter_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/filters/${filter_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$filter_id  = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/filters/%s',
      $account_id,
      $filter_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/flow_rules

Get flow rule list for all flows

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flow_rules

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 FlowRuleItem[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\FlowRuleItemCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var FlowRuleItemCollection $result */
try {
    $result = $flowmailer->getFlowRules();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/flow_rules" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flow_rules',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flow_rules HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "flow": {
            "id": "16791",
            "description": "BCC messages"
        },
        "conditions": [
            {
                "type": "sourceId",
                "name": null,
                "value": "6949",
                "matchType": null
            },
            {
                "type": "header",
                "name": "X-Flowmailer",
                "value": "bccmail",
                "matchType": null
            }
        ]
    },
    {
        "flow": {
            "id": "16792",
            "description": "Re-sent messages"
        },
        "conditions": [
            {
                "type": "sourceId",
                "name": null,
                "value": "6949",
                "matchType": null
            },
            {
                "type": "header",
                "name": "X-Flowmailer",
                "value": "resend",
                "matchType": null
            }
        ]
    },
    {
        "flow": {
            "id": "16801",
            "description": "test flow 1 (updated)"
        },
        "conditions": [
            {
                "type": "sourceId",
                "name": null,
                "value": "6953",
                "matchType": null
            },
            {
                "type": "header",
                "name": "X-Flow",
                "value": "flow1",
                "matchType": null
            }
        ]
    },
    {
        "flow": {
            "id": "16814",
            "description": "test flow 2"
        },
        "conditions": [
            {
                "type": "sourceId",
                "name": null,
                "value": "6953",
                "matchType": null
            },
            {
                "type": "header",
                "name": "X-Flow",
                "value": "flow2",
                "matchType": null
            }
        ]
    },
    {
        "flow": {
            "id": "16790",
            "description": "Default"
        },
        "conditions": []
    }
]

GET /{account_id}/flow_templates

List flow templates per account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flow_templates

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 FlowTemplate[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\FlowTemplateCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var FlowTemplateCollection $result */
try {
    $result = $flowmailer->getFlowTemplates();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/flow_templates" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flow_templates',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flow_templates HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "id": "3146",
        "templateId": "1",
        "description": "Default",
        "steps": null,
        "editable": true
    },
    {
        "id": "1",
        "templateId": null,
        "description": "System Default",
        "steps": null,
        "editable": false
    }
]

GET /{account_id}/flows

List flows per account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flows

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

statistics query boolean no true

Whether to return statistics per flow

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Flow[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\FlowCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$statistics = true;

/** @var FlowCollection $result */
try {
    $result = $flowmailer->getFlows($statistics);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
statistics=true

curl -s -X GET "https://api.flowmailer.net/${account_id}/flows?statistics=${statistics}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$statistics = true;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'statistics' => $statistics,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows%s',
      $account_id,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flows?statistics=false HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "id": "16791",
        "templateId": "3146",
        "description": "BCC messages",
        "steps": null
    },
    {
        "id": "16790",
        "templateId": "3146",
        "description": "Default",
        "steps": null
    },
    {
        "id": "16792",
        "templateId": "3146",
        "description": "Re-sent messages",
        "steps": null
    },
    {
        "id": "16801",
        "templateId": "3146",
        "description": "test flow 1 (updated)",
        "steps": null
    },
    {
        "id": "16814",
        "templateId": "3146",
        "description": "test flow 2",
        "steps": null
    }
]

POST /{account_id}/flows

Create a new flow

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/flows

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Flow yes

Flow object

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Flow;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$description = 'description';
$templateId  = '48681';

$flow = (new Flow())
   ->setDescription($description)
   ->setTemplateId($templateId)
;

try {
    $result = $flowmailer->createFlow($flow);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/flows" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

POST /545/flows HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "description": "test flow 2",
  "steps": [
    {
      "template": {
        "id": "48681"
      },
      "type": "template"
    },
    {
      "archive": {
        "onlineLink": true
      },
      "type": "archive"
    }
  ],
  "templateId": "3146"
}

Response

HTTP/1.1 201 Created
Location: https://api.flowmailer.net/545/flows/16814
Content-Length: 0

DELETE /{account_id}/flows/{flow_id}

Delete flow by id

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/flows/{flow_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$flowId = '';

try {
    $result = $flowmailer->deleteFlow($flowId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/flows/${flow_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$flow_id    = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s',
      $account_id,
      $flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/flows/{flow_id}

Get flow by id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flows/{flow_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Flow

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Flow;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$flowId = '';

/** @var Flow $result */
try {
    $result = $flowmailer->getFlow($flowId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=16801

curl -s -X GET "https://api.flowmailer.net/${account_id}/flows/${flow_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$flow_id    = '16801';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s',
      $account_id,
      $flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flows/16801 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "id": "16801",
    "templateId": "3146",
    "description": "test flow 1 (updated)",
    "steps": [
        {
            "type": "template",
            "id": "49728",
            "template": {
                "id": "48679",
                "description": "template 1"
            }
        },
        {
            "type": "archive",
            "id": "49729",
            "archive": {
                "onlineLink": true
            }
        }
    ]
}

PUT /{account_id}/flows/{flow_id}

Save flow

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/flows/{flow_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Flow yes

Flow object

flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Flow

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Flow;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$description = 'new description';
$templateId  = 'new templateId';

$flowId = '';
$flow   = (new Flow())
   ->setDescription($description)
   ->setTemplateId($templateId)
;

/** @var Flow $result */
try {
    $result = $flowmailer->updateFlow($flowId, $flow);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=16801
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/flows/${flow_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$flow_id    = '16801';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s',
      $account_id,
      $flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

PUT /545/flows/16801 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "description": "test flow 1 (updated)",
  "steps": [
    {
      "template": {
        "id": "48679"
      },
      "type": "template"
    },
    {
      "archive": {
        "onlineLink": true
      },
      "type": "archive"
    }
  ],
  "templateId": "3146"
}

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "id": "16801",
    "templateId": "3146",
    "description": "test flow 1 (updated)",
    "steps": [
        {
            "type": "template",
            "id": "49728",
            "template": {
                "id": "48679",
                "description": "template 1"
            }
        },
        {
            "type": "archive",
            "id": "49729",
            "archive": {
                "onlineLink": true
            }
        }
    ]
}

GET /{account_id}/flows/{flow_id}/messages

List messages per flow

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flows/{flow_id}/messages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false
addtags query boolean no false
daterange matrix date_range yes

Date range the message was submitted in

flow_id path string yes

Flow ID

range header items_range yes

Limits the returned list

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Message[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ItemsRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');
$start     = 10;
$end       = 50;

$flowId        = '';
$daterange     = new DateRange($startDate, $endDate);
$range         = new ItemsRange($start, $end);
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;

/** @var MessageCollection $result */
try {
    $result = $flowmailer->getFlowMessages($flowId, $daterange, $range, $addheaders, $addonlinelink, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=16801
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
addheaders=false
addonlinelink=false
addtags=false
range=items=0-10

curl -s -X GET "https://api.flowmailer.net/${account_id}/flows/${flow_id}/messages;daterange=${daterange}?addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$flow_id       = '16801';
$daterange     = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$range         = 'items=0-10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$query    = '?'.http_build_query([
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s/messages%s%s',
      $account_id,
      $flow_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flows/16801/messages;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z?addheaders=true&addonlinelink=true HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=0-10

Response

HTTP/1.1 206 Partial Content
Content-Range: items 0-10/1
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "submitted": "2021-12-30T13:04:07.000Z",
        "id": "20211230130407e3b36e2e92fdbefc86",
        "transactionId": "5f133c15a8de4ddca8fff9a26652b513",
        "messageIdHeader": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>",
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16801",
            "description": "test flow 1 (updated)"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:13.122Z",
        "backendDone": "2021-12-30T13:04:28.577Z",
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:08 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow1"
            },
            {
                "name": "Subject",
                "value": "test message 1"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "headersOut": [
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow1"
            },
            {
                "name": "Subject",
                "value": "test message 1"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            },
            {
                "name": "Feedback-ID",
                "value": "545:545-6953:545-16801:flowmailer"
            },
            {
                "name": "Message-ID",
                "value": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>"
            },
            {
                "name": "Date",
                "value": "Thu, 30 Dec 2021 13:04:25 +0000"
            },
            {
                "name": "X-Job",
                "value": "fm-6953-16801"
            }
        ],
        "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:s5pAd-51D2MTsnViCJSrmQ:WwRZlg4nXZI5U5YVmd2zt_F3aohcJxTW9DniDn5de7H8TLIhEh2AreIYBBenAJqPqhRjXWw6Zt_NnzPn2FR0jRl1I3NOEu0Sfd1uDBJeddfVAO7ydsQwOFXfa-io8HRK:wm1zEZsMupWu_cBngVthfwKu97-UXRbxWXTocogHGiI",
        "status": "DELIVERED",
        "subject": "test message 1",
        "from": "casper@flowmailer.local",
        "events": null,
        "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:EmVvynDMjH-rlpGzIq8hzw:Knyl6-J3C13WaolkQnmNSquNL3IAY6Ge65R41DgmQBMlM06FyNCud_atQGPh0Q3TXY2bSPpNsiz1scg-4tT4MO0wGe0fFEoY83WP11eIKkDZGywUwQeDld6GwzwnHHS_:AJhSP7eXVbT-li81Ec0C_v_R48Xb0CLx5F6d6RzQ_Iw&code=74bc00f87c12b8e88c622797a302653f9dbd5606",
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    }
]

GET /{account_id}/flows/{flow_id}/rule

Get flow conditions for a flow

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flows/{flow_id}/rule

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 FlowRuleSimple

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\FlowRuleSimple;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$flowId = '';

/** @var FlowRuleSimple $result */
try {
    $result = $flowmailer->getFlowRule($flowId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=16801

curl -s -X GET "https://api.flowmailer.net/${account_id}/flows/${flow_id}/rule" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$flow_id    = '16801';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s/rule',
      $account_id,
      $flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flows/16801/rule HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "flowId": "16801",
    "sourceId": "6953",
    "sender": null,
    "headers": [
        {
            "name": "X-Flow",
            "value": "flow1"
        }
    ]
}

PUT /{account_id}/flows/{flow_id}/rule

Set conditions for a flow

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/flows/{flow_id}/rule

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body FlowRuleSimple yes

Flow conditions

flow_id path string yes

Flow ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\FlowRuleSimple;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$flowId         = '';
$flowRuleSimple = new FlowRuleSimple();

try {
    $result = $flowmailer->updateFlowRule($flowId, $flowRuleSimple);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=16814
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/flows/${flow_id}/rule" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$flow_id    = '16814';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s/rule',
      $account_id,
      $flow_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

PUT /545/flows/16814/rule HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "headers": [
    {
      "name": "X-Flow",
      "value": "flow2"
    }
  ],
  "sourceId": "6953"
}

Response

HTTP/1.1 200 OK
Content-Length: 0

GET /{account_id}/flows/{flow_id}/stats

Get time based message statistics for a message flow

The resolution of the returned data may be lower than specified in the interval parameter if the data is old or the requested date range is too large.

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/flows/{flow_id}/stats

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

daterange matrix date_range yes

Date range the messages were submitted in

flow_id path string yes

Flow ID

interval matrix integer no

Time difference between samples

Response Messages

HTTP Status Code Response Model Response Headers Description
200 DataSets

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\DataSets;
use Flowmailer\API\Parameter\DateRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$flowId    = '';
$daterange = new DateRange($startDate, $endDate);
$interval  = 60;

/** @var DataSets $result */
try {
    $result = $flowmailer->getFlowStats($flowId, $daterange, $interval);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
flow_id=16801
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
interval=86400

curl -s -X GET "https://api.flowmailer.net/${account_id}/flows/${flow_id}/stats;daterange=${daterange};interval=${interval}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$flow_id    = '16801';
$daterange  = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$interval   = 86400;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
    'interval' => $interval,
], '', ';');
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/flows/%s/stats%s',
      $account_id,
      $flow_id,
      $matrix
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/flows/16801/stats;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z;interval=86400 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "list": [
        {
            "name": "processed",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 1
                }
            ]
        },
        {
            "name": "email",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 1
                }
            ]
        },
        {
            "name": "sms",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "sent",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 1
                }
            ]
        },
        {
            "name": "delivered",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 1
                }
            ]
        },
        {
            "name": "deliver_time",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "opened",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "unique_opened",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "clicked",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "unique_clicked",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        }
    ]
}

GET /{account_id}/message_events

List message events

Ordered by received, new events first.

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/message_events

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addmessagetags query boolean no false

Message tags will be included with each event if this parameter is true

daterange matrix date_range no
flow_ids matrix string[] no

Filter results on message flow ID

range header ref_range yes

Limits the returned list

receivedrange matrix date_range no
sortorder query string no
source_ids matrix string[] no

Filter results on message source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
206 MessageEvent[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageEventCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 34;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$range          = new ReferenceRange($count, $reference);
$flowIds        = [];
$sourceIds      = [];
$sortorder      = '';
$addmessagetags = false;
$daterange      = new DateRange($startDate, $endDate);
$receivedrange  = new DateRange($startDate, $endDate);

/** @var MessageEventCollection $result */
try {
    $result = $flowmailer->getMessageEvents($range, $flowIds, $sourceIds, $sortorder, $addmessagetags, $daterange, $receivedrange);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
daterange=
flow_ids=
receivedrange=
source_ids=
addmessagetags=false
sortorder=
range=items=:10

curl -s -X GET "https://api.flowmailer.net/${account_id}/message_events;daterange=${daterange};flow_ids=${flow_ids};receivedrange=${receivedrange};source_ids=${source_ids}?addmessagetags=${addmessagetags}&sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id     = '';
$daterange      = '';
$flow_ids       = '';
$receivedrange  = '';
$source_ids     = '';
$addmessagetags = false;
$sortorder      = '';
$range          = 'items=:10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
    'flow_ids' => $flow_ids,
    'receivedrange' => $receivedrange,
    'source_ids' => $source_ids,
], '', ';');
$query    = '?'.http_build_query([
    'addmessagetags' => $addmessagetags,
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/message_events%s%s',
      $account_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/message_events HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=:10

Response

HTTP/1.1 206 Partial Content
Content-Range: items 7KOJCD1G70R3ID1N6GOJGCPQCHHMAD34CCOJAB9K6KPJIB9K74OM4BB1CGO64B9M65IM8D1G6PJ62DB468:64R38C1O6OSJ8DPK68S34EHN60S38D3164OIQCPGC8P2QD1M6TGIQE32CGP2QOJ6CPH3GE9P69IJID9O/*
Next-Range: items=64R38C1O6OSJ8DPK68S34EHN60S38D3164OIQCPGC8P2QD1M6TGIQE32CGP2QOJ6CPH3GE9P69IJID9O:10
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "id": "dce4dc15-4539-491b-ad0b-61ed406fa5d2",
        "messageId": "202112301304100c7ded281d3069537b",
        "type": "DELIVERED",
        "received": "2021-12-30T13:04:28.898Z",
        "inserted": "2021-12-30T13:04:34.183Z",
        "snippet": "smtp;250 Ok",
        "mta": "[127.0.0.1] (127.0.0.1)",
        "data": null
    },
    {
        "id": "4254bf5b-5482-40a4-979a-514c3721910b",
        "messageId": "20211230130412891aae52e2f9e6ed11",
        "type": "ERROR",
        "received": "2021-12-30T13:04:34.129Z",
        "inserted": "2021-12-30T13:04:34.194Z",
        "snippet": "The following has evaluated to null or missing:",
        "mta": null,
        "data": null
    },
    {
        "id": "70844a11-30b2-467a-8bd2-bffb8992e958",
        "messageId": "20211230130407e3b36e2e92fdbefc86",
        "type": "DELIVERED",
        "received": "2021-12-30T13:04:28.898Z",
        "inserted": "2021-12-30T13:04:34.282Z",
        "snippet": "smtp;250 Ok",
        "mta": "[127.0.0.1] (127.0.0.1)",
        "data": null
    }
]

GET /{account_id}/message_hold

List messages which could not be processed

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/message_hold

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

daterange matrix date_range no

Date range the message was submitted in

range header items_range yes

Limits the returned list

Response Messages

HTTP Status Code Response Model Response Headers Description
206 MessageHold[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageHoldCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ItemsRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$start     = 24;
$end       = 43;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$range     = new ItemsRange($start, $end);
$daterange = new DateRange($startDate, $endDate);

/** @var MessageHoldCollection $result */
try {
    $result = $flowmailer->getMessageHolds($range, $daterange);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
range=items=0-10

curl -s -X GET "https://api.flowmailer.net/${account_id}/message_hold;daterange=${daterange}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id = '';
$daterange  = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$range      = 'items=0-10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/message_hold%s',
      $account_id,
      $matrix
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/message_hold;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=0-10

Response

HTTP/1.1 206 Partial Content
Content-Range: items 0-10/1
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "messageId": "20211230130412891aae52e2f9e6ed11",
        "transactionId": "5d7ac76c8f7b41c1b417a71505c9ef80",
        "submitted": "2021-12-30T13:04:12.000Z",
        "sender": null,
        "recipient": "richard@flowmailer.local",
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16814",
            "description": "test flow 2"
        },
        "status": "NEW",
        "dataCoding": 0,
        "data": null,
        "backendDone": "2021-12-30T13:04:34.129Z",
        "reason": "ERROR",
        "exceptionText": null,
        "errorText": "The following has evaluated to null or missing:\n==> var1  [in template \"48681\" at line 1, column 29]\n\n----\nTip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing<\/#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??\n----\n\n\t- Failed at: ${var1}  [in template \"48681\" at line 1, column 27]\n"
    }
]

GET /{account_id}/message_hold/{message_id}

Get a held message by its id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/message_hold/{message_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

message_id path string yes

Message ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 MessageHold

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\MessageHold;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageId = '';

/** @var MessageHold $result */
try {
    $result = $flowmailer->getMessageHold($messageId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
message_id=20211230130412891aae52e2f9e6ed11

curl -s -X GET "https://api.flowmailer.net/${account_id}/message_hold/${message_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$message_id = '20211230130412891aae52e2f9e6ed11';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/message_hold/%s',
      $account_id,
      $message_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/message_hold/20211230130412891aae52e2f9e6ed11 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "messageId": "20211230130412891aae52e2f9e6ed11",
    "transactionId": "5d7ac76c8f7b41c1b417a71505c9ef80",
    "submitted": "2021-12-30T13:04:12.000Z",
    "sender": null,
    "recipient": "richard@flowmailer.local",
    "messageType": "EMAIL",
    "source": {
        "id": "6953",
        "description": "test source a"
    },
    "flow": {
        "id": "16814",
        "description": "test flow 2"
    },
    "status": "NEW",
    "dataCoding": 0,
    "data": null,
    "backendDone": "2021-12-30T13:04:34.129Z",
    "reason": "ERROR",
    "exceptionText": null,
    "errorText": "The following has evaluated to null or missing:\n==> var1  [in template \"48681\" at line 1, column 29]\n\n----\nTip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing<\/#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??\n----\n\n\t- Failed at: ${var1}  [in template \"48681\" at line 1, column 27]\n"
}

GET /{account_id}/messages

List messages

This API call can be used to retrieve all messages and keep your database up to date (without missing messages due to paging issues). To do this sortfield must be set to INSERTED, and sortorder should be set to ASC.

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/messages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addevents query boolean no false

Whether to add message events

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false
addtags query boolean no false
daterange matrix date_range no

Date range the message was submitted in

flow_ids matrix string[] no

Filter results on flow ID

range header ref_range yes

Limits the returned list

sortfield query string no

Sort by INSERTED or SUBMITTED (default INSERTED)

sortorder query string no

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Message[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 27;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$range         = new ReferenceRange($count, $reference);
$flowIds       = [];
$sortfield     = '';
$sortorder     = '';
$addevents     = false;
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$daterange     = new DateRange($startDate, $endDate);

/** @var MessageCollection $result */
try {
    $result = $flowmailer->getMessages($range, $flowIds, $sortfield, $sortorder, $addevents, $addheaders, $addonlinelink, $addtags, $daterange);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
flow_ids=
addevents=false
addheaders=false
addonlinelink=false
addtags=false
sortfield=
sortorder=
range=items=:10

curl -s -X GET "https://api.flowmailer.net/${account_id}/messages;daterange=${daterange};flow_ids=${flow_ids}?addevents=${addevents}&addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}&sortfield=${sortfield}&sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$daterange     = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$flow_ids      = '';
$addevents     = false;
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$sortfield     = '';
$sortorder     = '';
$range         = 'items=:10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
    'flow_ids' => $flow_ids,
], '', ';');
$query    = '?'.http_build_query([
    'addevents' => $addevents,
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
    'sortfield' => $sortfield,
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages%s%s',
      $account_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/messages;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z?addevents=true&addheaders=true&addonlinelink=true HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=:10

Response

HTTP/1.1 206 Partial Content
Content-Range: items 94U34C1I64OJ4CPG64PJ0D1H6OO34CPI60P32C9I6CO32CPG6GO3EP9JC8PJCP9ICKSJ4PJ4C9IMCOPO6O:94V34C1I64OJ4CPG64PJ0D1J6CSJ4E1I60P32C9I6CO32CPG6GOJ4E1P65GM2P9L69IJ4PHPCKR6AP1H64/*
Next-Range: items=94V34C1I64OJ4CPG64PJ0D1J6CSJ4E1I60P32C9I6CO32CPG6GOJ4E1P65GM2P9L69IJ4PHPCKR6AP1H64:10
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "submitted": "2021-12-30T13:04:07.000Z",
        "id": "20211230130407e3b36e2e92fdbefc86",
        "transactionId": "5f133c15a8de4ddca8fff9a26652b513",
        "messageIdHeader": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>",
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16801",
            "description": "test flow 1 (updated)"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:13.122Z",
        "backendDone": "2021-12-30T13:04:28.577Z",
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:08 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow1"
            },
            {
                "name": "Subject",
                "value": "test message 1"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "headersOut": [
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow1"
            },
            {
                "name": "Subject",
                "value": "test message 1"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            },
            {
                "name": "Feedback-ID",
                "value": "545:545-6953:545-16801:flowmailer"
            },
            {
                "name": "Message-ID",
                "value": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>"
            },
            {
                "name": "Date",
                "value": "Thu, 30 Dec 2021 13:04:25 +0000"
            },
            {
                "name": "X-Job",
                "value": "fm-6953-16801"
            }
        ],
        "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:yqB0A-5zF1Nm5Ra5FC5KcA:I8SgIqmRZHC7oUQ0cOIVv8d-EjZC_GKiE6elZzbebzcluS05rh_0p2Q3WC3jRronKznxAP2D6f3X_pRx6r3W4QjKf0HJ1fhBCm9xKM3KeFX9lZe0xJiWhsYCgimBJiY2:2GnJcdfrRr9p7dKL9aU1pfg7VaqTSRCMMd-Yoo5pt9Y",
        "status": "DELIVERED",
        "subject": "test message 1",
        "from": "casper@flowmailer.local",
        "events": [
            {
                "id": "70844a11-30b2-467a-8bd2-bffb8992e958",
                "messageId": "20211230130407e3b36e2e92fdbefc86",
                "type": "DELIVERED",
                "received": "2021-12-30T13:04:28.898Z",
                "inserted": "2021-12-30T13:04:34.282Z",
                "snippet": "smtp;250 Ok",
                "mta": "[127.0.0.1] (127.0.0.1)",
                "data": null,
                "sourceMta": "mta.flowmailer.local"
            },
            {
                "id": null,
                "messageId": "20211230130407e3b36e2e92fdbefc86",
                "type": "PROCESSED",
                "received": "2021-12-30T13:04:28.577Z",
                "inserted": "2021-12-30T13:04:16.023Z",
                "snippet": null,
                "mta": null,
                "data": null
            },
            {
                "id": null,
                "messageId": "20211230130407e3b36e2e92fdbefc86",
                "type": "SUBMITTED",
                "received": "2021-12-30T13:04:07.000Z",
                "inserted": "2021-12-30T13:04:16.023Z",
                "snippet": null,
                "mta": null,
                "data": null
            }
        ],
        "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:bRjmfqt7SSFksLcJGFM-7g:ftgUpVhCyQxLVZyqon1QOcpakh346CvwRYh2ct16YdjgfQzdsU0U8PBkU6jAp1ILORApJB-EU35shb1Bm65v8KtWHuEr0_Qwe7Zl2S_6MBRJkmrFqdMMj0x_1tIvTG7s:jncD05ijczY6lHquBzdTwF02KR7Bf6w0ThDCss-aQiE&code=462940c8b48fd88aff19b30863637cdee6c0bab2",
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    },
    {
        "submitted": "2021-12-30T13:04:10.000Z",
        "id": "202112301304100c7ded281d3069537b",
        "transactionId": "4d09377e3d454dc8a69003ca8b1f0a63",
        "messageIdHeader": "<202112301304100c7ded281d3069537b@return.flowmailer.local>",
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16814",
            "description": "test flow 2"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:28.433Z",
        "backendDone": "2021-12-30T13:04:28.577Z",
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:10 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow2"
            },
            {
                "name": "Subject",
                "value": "test message 2"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "headersOut": [
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow2"
            },
            {
                "name": "Subject",
                "value": "test message 2"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            },
            {
                "name": "Feedback-ID",
                "value": "545:545-6953:545-16814:flowmailer"
            },
            {
                "name": "Message-ID",
                "value": "<202112301304100c7ded281d3069537b@return.flowmailer.local>"
            },
            {
                "name": "Date",
                "value": "Thu, 30 Dec 2021 13:04:28 +0000"
            },
            {
                "name": "X-Job",
                "value": "fm-6953-16814"
            }
        ],
        "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:vOzNF1QJuDA8rJA0N8qXMw:wV7Ts97CcI2kjYEPXX9oBwaX_lzeNKb_fctcaxtXS8t22DmM-W1WgHKVHvjCqqNQChtDIOOY5765JChm-fufyoi9ej3Ozo-BM2d2KA-wE5_fYX0EsgpBVCo9LRfkXtJT:BNybztpiItklSftbSZuiRn-lZCsFfAaD6s13pBE4occ",
        "status": "DELIVERED",
        "subject": "test message 2",
        "from": "casper@flowmailer.local",
        "events": [
            {
                "id": "dce4dc15-4539-491b-ad0b-61ed406fa5d2",
                "messageId": "202112301304100c7ded281d3069537b",
                "type": "DELIVERED",
                "received": "2021-12-30T13:04:28.898Z",
                "inserted": "2021-12-30T13:04:34.183Z",
                "snippet": "smtp;250 Ok",
                "mta": "[127.0.0.1] (127.0.0.1)",
                "data": null,
                "sourceMta": "mta.flowmailer.local"
            },
            {
                "id": null,
                "messageId": "202112301304100c7ded281d3069537b",
                "type": "PROCESSED",
                "received": "2021-12-30T13:04:28.577Z",
                "inserted": "2021-12-30T13:04:28.461Z",
                "snippet": null,
                "mta": null,
                "data": null
            },
            {
                "id": null,
                "messageId": "202112301304100c7ded281d3069537b",
                "type": "SUBMITTED",
                "received": "2021-12-30T13:04:10.000Z",
                "inserted": "2021-12-30T13:04:28.461Z",
                "snippet": null,
                "mta": null,
                "data": null
            }
        ],
        "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:3_8jv4YsOTEFqY-2SUEZiQ:Qs6lIfp-38XbTCxnKsp_l5tu84qgfF6xt7eWodni00yY_HB2qbWI2sNlS7xqDHfIJW-f3uF1BlFP0ri8EWMXK8xa0YWsAZ57DrII04JUbVcDy1vCpLV3f9oay4ODWTay:w4juMDpotut85I2n1zeLzR72_L6cOalZEwKXHdWmFLE&code=aa4487413f9257a84fe1911fb4fd6717a2cbace2",
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    },
    {
        "submitted": "2021-12-30T13:04:12.000Z",
        "id": "20211230130412891aae52e2f9e6ed11",
        "transactionId": "5d7ac76c8f7b41c1b417a71505c9ef80",
        "messageIdHeader": null,
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16814",
            "description": "test flow 2"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:33.897Z",
        "backendDone": null,
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:12 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow2"
            },
            {
                "name": "Subject",
                "value": "test message 3"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "status": "ERROR",
        "subject": "test message 3",
        "from": "casper@flowmailer.local",
        "events": [
            {
                "id": "4254bf5b-5482-40a4-979a-514c3721910b",
                "messageId": "20211230130412891aae52e2f9e6ed11",
                "type": "ERROR",
                "received": "2021-12-30T13:04:34.129Z",
                "inserted": "2021-12-30T13:04:34.194Z",
                "snippet": "The following has evaluated to null or missing:",
                "mta": null,
                "data": null,
                "extraData": {
                    "errorText": "The following has evaluated to null or missing:\n==> var1  [in template \"48681\" at line 1, column 29]\n\n----\nTip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing<\/#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??\n----\n\n\t- Failed at: ${var1}  [in template \"48681\" at line 1, column 27]\n",
                    "errorAfter": "QUEUE"
                }
            },
            {
                "id": null,
                "messageId": "20211230130412891aae52e2f9e6ed11",
                "type": "SUBMITTED",
                "received": "2021-12-30T13:04:12.000Z",
                "inserted": "2021-12-30T13:04:33.928Z",
                "snippet": null,
                "mta": null,
                "data": null
            }
        ],
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    }
]

POST /{account_id}/messages/simulate

Simulate an email or sms message

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/messages/simulate

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body SimulateMessage yes

Response Messages

HTTP Status Code Response Model Response Headers Description
200 SimulateMessageResult

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Enum\MessageType;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SimulateMessage;
use Flowmailer\API\Model\SimulateMessageResult;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageType      = MessageType::EMAIL;
$recipientAddress = 'example@example.com';
$senderAddress    = 'sender@example.com';
$sourceId         = 'sourceId';

$simulateMessage = (new SimulateMessage())
   ->setMessageType($messageType)
   ->setRecipientAddress($recipientAddress)
   ->setSenderAddress($senderAddress)
   ->setSourceId($sourceId)
;

/** @var SimulateMessageResult $result */
try {
    $result = $flowmailer->simulateMessage($simulateMessage);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/messages/simulate" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/simulate',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

POST /545/messages/simulate HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "data": {
    "var1": "value3"
  },
  "headerFromAddress": "casper@flowmailer.local",
  "headerFromName": "Casper Mout",
  "headerToName": "Richard van Looijen",
  "headers": [
    {
      "name": "X-Flow",
      "value": "flow2"
    }
  ],
  "messageType": "EMAIL",
  "recipientAddress": "richard@flowmailer.local",
  "senderAddress": "support@flowmailer.local",
  "sourceId": "6953",
  "subject": "test message 3"
}

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "messageType": "EMAIL",
    "subject": "test message 3",
    "text": "<html><body>html template value3<br\/>\\n\\nmet twee regions<br\/>\\n\\nnog wat onaanpasbare tekst<br\/>\\n\\ntekst in de tweede region<br\/>\\nnog een regel<br\/>\\n\\nnog meer onaanpasbare tekst\\n<br\/><\/body><\/html>",
    "html": null,
    "attachments": [],
    "mimedata": "TUlNRS1WZXJzaW9uOiAxLjANCkZyb206IENhc3BlciBNb3V0IDxjYXNwZXJAZmxvd21haWxlci5sb2NhbD4NClRvOiBSaWNoYXJkIHZhbiBMb29pamVuIDxyaWNoYXJkQGZsb3dtYWlsZXIubG9jYWw+DQpYLUZsb3c6IGZsb3cyDQpTdWJqZWN0OiB0ZXN0IG1lc3NhZ2UgMw0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PVVURi04DQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBxdW90ZWQtcHJpbnRhYmxlDQpGZWVkYmFjay1JRDogNTQ1OjU0NS02OTUzOjU0NS0xNjgxNDpmbG93bWFpbGVyDQpNZXNzYWdlLUlEOiA8MTExMTAxMDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBAcmV0dXJuLmZsb3dtYWlsZXIubG9jYWw+DQpEYXRlOiBUaHUsIDMwIERlYyAyMDIxIDEzOjA0OjQzICswMDAwDQpYLUpvYjogZm0tNjk1My0xNjgxNA0KDQo8aHRtbD48Ym9keT5odG1sIHRlbXBsYXRlIHZhbHVlMzxici8+XG5cbm1ldCB0d2VlIHJlZ2lvbnM8YnIvPlxuXG5ub2cgd2F0IG89DQpuYWFucGFzYmFyZSB0ZWtzdDxici8+XG5cbnRla3N0IGluIGRlIHR3ZWVkZSByZWdpb248YnIvPlxubm9nIGVlbiByZWdlbDxici89DQo+XG5cbm5vZyBtZWVyIG9uYWFucGFzYmFyZSB0ZWtzdFxuPGJyLz48L2JvZHk+PC9odG1sPg==",
    "flow": {
        "id": "16814",
        "description": "test flow 2"
    },
    "data": {
        "var1": "value3"
    }
}

POST /{account_id}/messages/submit

Send an email or sms message

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/messages/submit

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body SubmitMessage yes

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Enum\MessageType;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SubmitMessage;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageType      = MessageType::EMAIL;
$recipientAddress = 'example@example.com';
$senderAddress    = 'sender@example.com';

$submitMessage = (new SubmitMessage())
   ->setMessageType($messageType)
   ->setRecipientAddress($recipientAddress)
   ->setSenderAddress($senderAddress)
;

try {
    $result = $flowmailer->submitMessage($submitMessage);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/messages/submit" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/submit',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

POST /545/messages/submit HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "data": {
    "var2": "value3"
  },
  "headerFromAddress": "casper@flowmailer.local",
  "headerFromName": "Casper Mout",
  "headerToName": "Richard van Looijen",
  "headers": [
    {
      "name": "X-Flow",
      "value": "flow2"
    }
  ],
  "messageType": "EMAIL",
  "recipientAddress": "richard@flowmailer.local",
  "senderAddress": "support@flowmailer.local",
  "subject": "test message 3"
}

Response

HTTP/1.1 201 Created
Location: https://api.flowmailer.net/545/messages/20211230130412891aae52e2f9e6ed11
Content-Length: 0

GET /{account_id}/messages/{message_id}

Get message by id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/messages/{message_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addtags query boolean no false
message_id path string yes

Message ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Message

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Message;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageId = '';
$addtags   = false;

/** @var Message $result */
try {
    $result = $flowmailer->getMessage($messageId, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
message_id=20211230130407e3b36e2e92fdbefc86
addtags=false

curl -s -X GET "https://api.flowmailer.net/${account_id}/messages/${message_id}?addtags=${addtags}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$message_id = '20211230130407e3b36e2e92fdbefc86';
$addtags    = false;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'addtags' => $addtags,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/%s%s',
      $account_id,
      $message_id,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/messages/20211230130407e3b36e2e92fdbefc86 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "submitted": "2021-12-30T13:04:07.000Z",
    "id": "20211230130407e3b36e2e92fdbefc86",
    "transactionId": "5f133c15a8de4ddca8fff9a26652b513",
    "messageIdHeader": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>",
    "messageType": "EMAIL",
    "source": {
        "id": "6953",
        "description": "test source a"
    },
    "flow": {
        "id": "16801",
        "description": "test flow 1 (updated)"
    },
    "senderAddress": "support@flowmailer.local",
    "recipientAddress": "richard@flowmailer.local",
    "backendStart": "2021-12-30T13:04:13.122Z",
    "backendDone": "2021-12-30T13:04:28.577Z",
    "headersIn": [
        {
            "name": "Received",
            "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:08 +0100 (CET)"
        },
        {
            "name": "MIME-Version",
            "value": "1.0"
        },
        {
            "name": "From",
            "value": "Casper Mout <casper@flowmailer.local>"
        },
        {
            "name": "To",
            "value": "Richard van Looijen <richard@flowmailer.local>"
        },
        {
            "name": "X-Flow",
            "value": "flow1"
        },
        {
            "name": "Subject",
            "value": "test message 1"
        },
        {
            "name": "Content-Type",
            "value": "text\/plain; charset=UTF-8"
        },
        {
            "name": "Content-Transfer-Encoding",
            "value": "quoted-printable"
        }
    ],
    "headersOut": [
        {
            "name": "MIME-Version",
            "value": "1.0"
        },
        {
            "name": "From",
            "value": "Casper Mout <casper@flowmailer.local>"
        },
        {
            "name": "To",
            "value": "Richard van Looijen <richard@flowmailer.local>"
        },
        {
            "name": "X-Flow",
            "value": "flow1"
        },
        {
            "name": "Subject",
            "value": "test message 1"
        },
        {
            "name": "Content-Type",
            "value": "text\/plain; charset=UTF-8"
        },
        {
            "name": "Content-Transfer-Encoding",
            "value": "quoted-printable"
        },
        {
            "name": "Feedback-ID",
            "value": "545:545-6953:545-16801:flowmailer"
        },
        {
            "name": "Message-ID",
            "value": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>"
        },
        {
            "name": "Date",
            "value": "Thu, 30 Dec 2021 13:04:25 +0000"
        },
        {
            "name": "X-Job",
            "value": "fm-6953-16801"
        }
    ],
    "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:Unfnv8ATrpWS79MNSr7ZEA:CjpHXuEEnCwLEfLak1zJmoDB_vmsYUU1P4Af-I4YcW7YqO09oNGgyzgjatmM5Ix-LlkBLQWTCeU13EX6oo8rh9lRnlKZz81aKulIvhQ1_4NmCqNLDYpRU0WSuvwkrzye:792OyUGBnn7cAsoTfkyMoGgAaD6wSeQ0q1irB9uM9Mk",
    "status": "DELIVERED",
    "subject": "test message 1",
    "from": "casper@flowmailer.local",
    "events": [
        {
            "id": "70844a11-30b2-467a-8bd2-bffb8992e958",
            "messageId": "20211230130407e3b36e2e92fdbefc86",
            "type": "DELIVERED",
            "received": "2021-12-30T13:04:28.898Z",
            "inserted": "2021-12-30T13:04:34.282Z",
            "snippet": "smtp;250 Ok",
            "mta": "[127.0.0.1] (127.0.0.1)",
            "data": null,
            "sourceMta": "mta.flowmailer.local"
        },
        {
            "id": null,
            "messageId": "20211230130407e3b36e2e92fdbefc86",
            "type": "PROCESSED",
            "received": "2021-12-30T13:04:28.577Z",
            "inserted": "2021-12-30T13:04:16.023Z",
            "snippet": null,
            "mta": null,
            "data": null
        },
        {
            "id": null,
            "messageId": "20211230130407e3b36e2e92fdbefc86",
            "type": "SUBMITTED",
            "received": "2021-12-30T13:04:07.000Z",
            "inserted": "2021-12-30T13:04:16.023Z",
            "snippet": null,
            "mta": null,
            "data": null
        }
    ],
    "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:Ninse0HwHPvsPQpq0c1eJQ:w7razKp7JKr25ODO3WPyJ9rBnDTM5HpVY94uiAY1S_eabgOunUF8hwtfrxMmtkYFq-h4QVmRerDn0sUybWrR3l1PQjx1y8RfooNt88kjAj6U5rNgiGy5VcIZZfXW01-X:sguyJXod6WnqvbgJVbxt7HWfQd15dRp6Uon0hrGcfGc&code=cd55889265906c641c528c5162c664c3fa799049",
    "fromAddress": {
        "name": "Casper Mout",
        "address": "casper@flowmailer.local"
    },
    "toAddressList": [
        {
            "name": "Richard van Looijen",
            "address": "richard@flowmailer.local"
        }
    ]
}

GET /{account_id}/messages/{message_id}/archive

List the message as archived by one or more flow steps

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/messages/{message_id}/archive

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addattachments query boolean no false
adddata query boolean no false
message_id path string yes

Message ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 MessageArchive[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageArchiveCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageId      = '';
$addattachments = false;
$adddata        = false;

/** @var MessageArchiveCollection $result */
try {
    $result = $flowmailer->getMessageArchive($messageId, $addattachments, $adddata);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
message_id=20211230130407e3b36e2e92fdbefc86
addattachments=false
adddata=false

curl -s -X GET "https://api.flowmailer.net/${account_id}/messages/${message_id}/archive?addattachments=${addattachments}&adddata=${adddata}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id     = '';
$message_id     = '20211230130407e3b36e2e92fdbefc86';
$addattachments = false;
$adddata        = false;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'addattachments' => $addattachments,
    'adddata' => $adddata,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/%s/archive%s',
      $account_id,
      $message_id,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/messages/20211230130407e3b36e2e92fdbefc86/archive?addattachments=true&adddata=true HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "flowStepId": "49729",
        "messageType": "EMAIL",
        "onlineVersion": true,
        "subject": "test message 1",
        "text": "<html><body>html template<br\/>\\n\\nmet twee regions<br\/>\\n\\nnog wat onaanpasbare tekst<br\/>\\n\\ntekst in de tweede region<br\/>\\nnog een regel<br\/>\\n\\nnog meer onaanpasbare tekst\\n<br\/><\/body><\/html>",
        "html": null,
        "attachments": [],
        "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:nx7PLkb_GtJVC83sAbkSmw:M86B_tyLqaP7aFYG-j9AINaHw1HfYknI8UxUIQ9YpNpLCBf6thyffswhDFr-BhWDGkr4FSLsLtJdDesdzmGNhMMYpuOc5mfPKRzK9gHO58l7Ayd5IDK-A19zFItnjQbw:BSDTkBCMg5WUNXJ3cxRkpFTepGwrVzgp-1zHriqX1Dg",
        "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:3fEByu6_gPcL4DJelBkKDQ:-7SW7onYzlsYolkrp5jrGA0tGEA0VO08b6FL4BuXpONmA6peI5pxQfS7xQArZGZ4cX4cShalgEcjcaHeCr6nw9yXoKb0qXdGZ3EtmUMMf_L85ujYI39PXj7Wiw3tbGIf:H_1pYXo9KaULJSJLaqEs7-GD4L3DLcMAZrCQ9U67XM8&code=fe92309209743e28bcd91a8b6810991c9c4d8827",
        "mimedata": "TUlNRS1WZXJzaW9uOiAxLjANCkZyb206IENhc3BlciBNb3V0IDxjYXNwZXJAZmxvd21haWxlci5sb2NhbD4NClRvOiBSaWNoYXJkIHZhbiBMb29pamVuIDxyaWNoYXJkQGZsb3dtYWlsZXIubG9jYWw+DQpYLUZsb3c6IGZsb3cxDQpTdWJqZWN0OiB0ZXN0IG1lc3NhZ2UgMQ0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PVVURi04DQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBxdW90ZWQtcHJpbnRhYmxlDQoNCjxodG1sPjxib2R5Pmh0bWwgdGVtcGxhdGU8YnIvPlxuXG5tZXQgdHdlZSByZWdpb25zPGJyLz5cblxubm9nIHdhdCBvbmFhbnBhcz0NCmJhcmUgdGVrc3Q8YnIvPlxuXG50ZWtzdCBpbiBkZSB0d2VlZGUgcmVnaW9uPGJyLz5cbm5vZyBlZW4gcmVnZWw8YnIvPlxuXG5ubz0NCmcgbWVlciBvbmFhbnBhc2JhcmUgdGVrc3Rcbjxici8+PC9ib2R5PjwvaHRtbD4=",
        "data": {
            "var1": "value1"
        }
    }
]

GET /{account_id}/messages/{message_id}/archive/{flow_step_id}/attachment/{content_id}

Fetch an attachment including data for an archived message

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/messages/{message_id}/archive/{flow_step_id}/attachment/{content_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

content_id path string yes

Attachment content ID

flow_step_id path string yes

Flow step ID

message_id path string yes

Message ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Attachment

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Attachment;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageId  = '';
$flowStepId = '';
$contentId  = '';

/** @var Attachment $result */
try {
    $result = $flowmailer->getMessageArchiveAttachment($messageId, $flowStepId, $contentId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
content_id=
flow_step_id=
message_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/messages/${message_id}/archive/${flow_step_id}/attachment/${content_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id   = '';
$content_id   = '';
$flow_step_id = '';
$message_id   = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/%s/archive/%s/attachment/%s',
      $account_id,
      $message_id,
      $flow_step_id,
      $content_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/messages/{message_id}/error_archive

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/messages/{message_id}/error_archive

Parameters

Name Location Type Required Default Description
account_id path string yes
addattachments query boolean no false
adddata query boolean no false
message_id path string yes

Response Messages

HTTP Status Code Response Model Response Headers Description
200 MessageArchive

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\MessageArchive;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageId      = '';
$addattachments = false;
$adddata        = false;

/** @var MessageArchive $result */
try {
    $result = $flowmailer->getMessageErrorArchive($messageId, $addattachments, $adddata);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
message_id=20211230130412891aae52e2f9e6ed11
addattachments=false
adddata=false

curl -s -X GET "https://api.flowmailer.net/${account_id}/messages/${message_id}/error_archive?addattachments=${addattachments}&adddata=${adddata}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id     = '';
$message_id     = '20211230130412891aae52e2f9e6ed11';
$addattachments = false;
$adddata        = false;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'addattachments' => $addattachments,
    'adddata' => $adddata,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/%s/error_archive%s',
      $account_id,
      $message_id,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/messages/20211230130412891aae52e2f9e6ed11/error_archive?addattachments=true&adddata=true HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "messageType": "EMAIL",
    "onlineVersion": false,
    "subject": "test message 3",
    "text": "",
    "html": null,
    "attachments": [],
    "mimedata": "UmVjZWl2ZWQ6IGZyb20gMTI3LjAuMC4xDQogICBieSAgKEZsb3dtYWlsZXIgQVBJKSB3aXRoIEhUVFANCiAgIGZvciA8cmljaGFyZEBmbG93bWFpbGVyLmxvY2FsPjsNCiAgIFRodSwgMzAgRGVjIDIwMjEgMTQ6MDQ6MTIgKzAxMDAgKENFVCkNCk1JTUUtVmVyc2lvbjogMS4wDQpGcm9tOiBDYXNwZXIgTW91dCA8Y2FzcGVyQGZsb3dtYWlsZXIubG9jYWw+DQpUbzogUmljaGFyZCB2YW4gTG9vaWplbiA8cmljaGFyZEBmbG93bWFpbGVyLmxvY2FsPg0KWC1GbG93OiBmbG93Mg0KU3ViamVjdDogdGVzdCBtZXNzYWdlIDMNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOA0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogcXVvdGVkLXByaW50YWJsZQ0KDQo=",
    "data": {
        "var2": "value3"
    }
}

POST /{account_id}/messages/{message_id}/resend

Resend message by id

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/messages/{message_id}/resend

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body ResendMessage yes
message_id path string yes

Message ID

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\ResendMessage;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$messageId     = '';
$resendMessage = new ResendMessage();

try {
    $result = $flowmailer->resendMessage($messageId, $resendMessage);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
message_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/messages/${message_id}/resend" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$message_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messages/%s/resend',
      $account_id,
      $message_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/messagestats

Get time based message statistics for whole account

The resolution of the returned data may be lower than specified in the interval parameter if the data is old or the requested date range is too large.

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/messagestats

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

daterange matrix date_range yes

Date range the messages were submitted in

flow_ids matrix string[] no
interval query integer no

Time difference between samples

Response Messages

HTTP Status Code Response Model Response Headers Description
200 DataSets

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\DataSets;
use Flowmailer\API\Parameter\DateRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$daterange = new DateRange($startDate, $endDate);
$flowIds   = [];
$interval  = 60;

/** @var DataSets $result */
try {
    $result = $flowmailer->getMessageStats($daterange, $flowIds, $interval);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
flow_ids=
interval=86400

curl -s -X GET "https://api.flowmailer.net/${account_id}/messagestats;daterange=${daterange};flow_ids=${flow_ids}?interval=${interval}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$daterange  = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$flow_ids   = '';
$interval   = 86400;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
    'flow_ids' => $flow_ids,
], '', ';');
$query    = '?'.http_build_query([
    'interval' => $interval,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/messagestats%s%s',
      $account_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/messagestats;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z?interval=86400 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "list": [
        {
            "name": "processed",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "email",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "sms",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "sent",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "delivered",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "deliver_time",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "opened",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "unique_opened",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "clicked",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "unique_clicked",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        }
    ]
}

GET /{account_id}/recipient/{recipient}

Get information about a recipient

Message statistics are only included if a date range is specified.

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/recipient/{recipient}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

recipient path string yes

Recipient email address or phone number

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Recipient

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Recipient;
use Flowmailer\API\Parameter\DateRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$recipient = 'example@example.com';
$daterange = new DateRange($startDate, $endDate);

/** @var Recipient $result */
try {
    $result = $flowmailer->getRecipient($recipient, $daterange);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
recipient=

curl -s -X GET "https://api.flowmailer.net/${account_id}/recipient/${recipient}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$recipient  = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/recipient/%s',
      $account_id,
      $recipient
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/recipient/{recipient}/messages

List messages per recipient

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/recipient/{recipient}/messages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false

Whether to add online link

addtags query boolean no false
daterange matrix date_range no

Date range the messages were submitted in

range header ref_range yes

Limits the returned list

recipient path string yes

Recipient email address or phone number

sortorder query string no

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Message[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 36;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$recipient     = '';
$range         = new ReferenceRange($count, $reference);
$daterange     = new DateRange($startDate, $endDate);
$sortorder     = '';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;

/** @var MessageCollection $result */
try {
    $result = $flowmailer->getRecipientMessages($recipient, $range, $daterange, $sortorder, $addheaders, $addonlinelink, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
recipient=
daterange=
addheaders=false
addonlinelink=false
addtags=false
sortorder=
range=

curl -s -X GET "https://api.flowmailer.net/${account_id}/recipient/${recipient}/messages;daterange=${daterange}?addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}&sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$recipient     = '';
$daterange     = '';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$sortorder     = '';
$range         = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$query    = '?'.http_build_query([
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/recipient/%s/messages%s%s',
      $account_id,
      $recipient,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sender/{sender}/messages

List messages per sender

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sender/{sender}/messages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false

Whether to add online link

addtags query boolean no false
daterange matrix date_range no

Date range the messages were submitted in

range header ref_range yes

Limits the returned list

sender path string yes

Sender email address or phone number

sortorder query string no

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Message[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 49;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$sender        = '';
$range         = new ReferenceRange($count, $reference);
$daterange     = new DateRange($startDate, $endDate);
$sortorder     = '';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;

/** @var MessageCollection $result */
try {
    $result = $flowmailer->getSenderMessages($sender, $range, $daterange, $sortorder, $addheaders, $addonlinelink, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
sender=
daterange=
addheaders=false
addonlinelink=false
addtags=false
sortorder=
range=

curl -s -X GET "https://api.flowmailer.net/${account_id}/sender/${sender}/messages;daterange=${daterange}?addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}&sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$sender        = '';
$daterange     = '';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$sortorder     = '';
$range         = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$query    = '?'.http_build_query([
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender/%s/messages%s%s',
      $account_id,
      $sender,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sender_domains

List sender domains by account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sender_domains

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 SenderDomain[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\SenderDomainCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var SenderDomainCollection $result */
try {
    $result = $flowmailer->getSenderDomains();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/sender_domains" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sender_domains HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[]

POST /{account_id}/sender_domains

Create sender domain

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/sender_domains

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body SenderDomain yes

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SenderDomain;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$senderDomain = 'sub.example.com';

$senderDomain = (new SenderDomain())
   ->setSenderDomain($senderDomain)
;

try {
    $result = $flowmailer->createSenderDomain($senderDomain);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/sender_domains" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sender_domains/by_domain/{domain}

Get sender domain by domain name

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sender_domains/by_domain/{domain}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

domain path string yes

Sender domain name

validate query boolean no false

Validate DNS records for this SenderDomain

Response Messages

HTTP Status Code Response Model Response Headers Description
200 SenderDomain

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SenderDomain;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$domain   = 'example.com';
$validate = false;

/** @var SenderDomain $result */
try {
    $result = $flowmailer->getSenderDomainsByDomain($domain, $validate);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
domain=
validate=false

curl -s -X GET "https://api.flowmailer.net/${account_id}/sender_domains/by_domain/${domain}?validate=${validate}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$domain     = '';
$validate   = false;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'validate' => $validate,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains/by_domain/%s%s',
      $account_id,
      $domain,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

POST /{account_id}/sender_domains/validate

Validates but does not save a sender domain.

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/sender_domains/validate

Parameters

Name Location Type Required Default Description
account_id path string yes

body body SenderDomain yes

the sender domain to validate

Response Messages

HTTP Status Code Response Model Response Headers Description
200 SenderDomain

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SenderDomain;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$senderDomain = 'sub.example.com';

$senderDomain = (new SenderDomain())
   ->setSenderDomain($senderDomain)
;

/** @var SenderDomain $result */
try {
    $result = $flowmailer->validateSenderDomain($senderDomain);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/sender_domains/validate" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains/validate',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

DELETE /{account_id}/sender_domains/{domain_id}

Delete sender domain

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/sender_domains/{domain_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

domain_id path string yes

Sender domain ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$domainId = '';

try {
    $result = $flowmailer->deleteSenderDomain($domainId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
domain_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/sender_domains/${domain_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$domain_id  = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains/%s',
      $account_id,
      $domain_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sender_domains/{domain_id}

Get sender domain by id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sender_domains/{domain_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

domain_id path string yes

Sender domain ID

validate query boolean no false

Validate DNS records for this SenderDomain

Response Messages

HTTP Status Code Response Model Response Headers Description
200 SenderDomain

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SenderDomain;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$domainId = '';
$validate = false;

/** @var SenderDomain $result */
try {
    $result = $flowmailer->getSenderDomain($domainId, $validate);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
domain_id=
validate=false

curl -s -X GET "https://api.flowmailer.net/${account_id}/sender_domains/${domain_id}?validate=${validate}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$domain_id  = '';
$validate   = false;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'validate' => $validate,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains/%s%s',
      $account_id,
      $domain_id,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

PUT /{account_id}/sender_domains/{domain_id}

Save sender domain

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/sender_domains/{domain_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body SenderDomain yes

domain_id path string yes

Sender domain ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\SenderDomain;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$senderDomain = 'new senderDomain';

$domainId     = '';
$senderDomain = (new SenderDomain())
   ->setSenderDomain($senderDomain)
;

try {
    $result = $flowmailer->updateSenderDomain($domainId, $senderDomain);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
domain_id=
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/sender_domains/${domain_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$domain_id  = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sender_domains/%s',
      $account_id,
      $domain_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sources

List source systems per account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sources

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

statistics query boolean no true

Whether to include message statistics or not

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Source[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\SourceCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$statistics = true;

/** @var SourceCollection $result */
try {
    $result = $flowmailer->getSources($statistics);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
statistics=true

curl -s -X GET "https://api.flowmailer.net/${account_id}/sources?statistics=${statistics}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$statistics = true;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$query    = '?'.http_build_query([
    'statistics' => $statistics,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources%s',
      $account_id,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sources?statistics=false HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "id": "6949",
        "type": "FLOWMAILER",
        "description": "Flowmailer",
        "maxMessageSize": null,
        "dsnAddress": null,
        "feedbackLoopAddress": null,
        "lastActive": "2021-12-30T13:03:39.000+0000",
        "statistics": null,
        "messageSummary": null
    },
    {
        "id": "6953",
        "type": "SMTP",
        "description": "test source a",
        "maxMessageSize": 26214400,
        "humanReadableDsnAddress": "support@example.test",
        "humanReadableDsnEnable": true,
        "dsnAddress": "dsn@example.test",
        "dsnDisable": true,
        "feedbackLoopAddress": "feedbackloop@example.test",
        "lastActive": "2021-12-30T13:04:36.000+0000",
        "statistics": null,
        "messageSummary": null
    },
    {
        "id": "6960",
        "type": "API",
        "description": "test source b",
        "maxMessageSize": null,
        "dsnAddress": null,
        "feedbackLoopAddress": null,
        "lastActive": "2021-12-30T13:04:01.000+0000",
        "statistics": null,
        "messageSummary": null
    }
]

POST /{account_id}/sources

Create a new source

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/sources

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Source yes

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Enum\SourceType;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Source;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$description = 'description';
$tlsRequired = true;
$type        = SourceType::API;

$source = (new Source())
   ->setDescription($description)
   ->setTlsRequired($tlsRequired)
   ->setType($type)
;

try {
    $result = $flowmailer->createSource($source);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/sources" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

POST /545/sources HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "description": "test source b",
  "type": "API"
}

Response

HTTP/1.1 201 Created
Location: https://api.flowmailer.net/545/sources/6960
Content-Length: 0

DELETE /{account_id}/sources/{source_id}

Delete a source

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/sources/{source_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$sourceId = '';

try {
    $result = $flowmailer->deleteSource($sourceId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/sources/${source_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s',
      $account_id,
      $source_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sources/{source_id}

Get a source by id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sources/{source_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Source

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Source;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$sourceId = '';

/** @var Source $result */
try {
    $result = $flowmailer->getSource($sourceId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=6953

curl -s -X GET "https://api.flowmailer.net/${account_id}/sources/${source_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '6953';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s',
      $account_id,
      $source_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sources/6953 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "id": "6953",
    "type": "SMTP",
    "description": "test source a",
    "maxMessageSize": 26214400,
    "humanReadableDsnAddress": "support@example.test",
    "humanReadableDsnEnable": true,
    "dsnAddress": "dsn@example.test",
    "dsnDisable": true,
    "feedbackLoopAddress": "feedbackloop@example.test",
    "lastActive": "2021-12-30T13:04:36.000+0000",
    "statistics": null,
    "messageSummary": null
}

PUT /{account_id}/sources/{source_id}

Update a source

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/sources/{source_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Source yes
source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Source;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$description = 'new description';
$tlsRequired = true;
$type        = 'new type';

$sourceId = '';
$source   = (new Source())
   ->setDescription($description)
   ->setTlsRequired($tlsRequired)
   ->setType($type)
;

try {
    $result = $flowmailer->updateSource($sourceId, $source);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/sources/${source_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s',
      $account_id,
      $source_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sources/{source_id}/messages

List messages per source

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sources/{source_id}/messages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false
addtags query boolean no false
daterange matrix date_range yes

Date range the message was submitted in

range header items_range yes

Limits the returned list

source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Message[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ItemsRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');
$start     = 11;
$end       = 49;

$sourceId      = '';
$daterange     = new DateRange($startDate, $endDate);
$range         = new ItemsRange($start, $end);
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;

/** @var MessageCollection $result */
try {
    $result = $flowmailer->getSourceMessages($sourceId, $daterange, $range, $addheaders, $addonlinelink, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=6953
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
addheaders=false
addonlinelink=false
addtags=false
range=items=0-10

curl -s -X GET "https://api.flowmailer.net/${account_id}/sources/${source_id}/messages;daterange=${daterange}?addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$source_id     = '6953';
$daterange     = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$range         = 'items=0-10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$query    = '?'.http_build_query([
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/messages%s%s',
      $account_id,
      $source_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sources/6953/messages;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z?addheaders=true&addonlinelink=true HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=0-10

Response

HTTP/1.1 206 Partial Content
Content-Range: items 0-10/3
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "submitted": "2021-12-30T13:04:12.000Z",
        "id": "20211230130412891aae52e2f9e6ed11",
        "transactionId": "5d7ac76c8f7b41c1b417a71505c9ef80",
        "messageIdHeader": null,
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16814",
            "description": "test flow 2"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:33.897Z",
        "backendDone": null,
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:12 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow2"
            },
            {
                "name": "Subject",
                "value": "test message 3"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "status": "ERROR",
        "subject": "test message 3",
        "from": "casper@flowmailer.local",
        "events": null,
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    },
    {
        "submitted": "2021-12-30T13:04:10.000Z",
        "id": "202112301304100c7ded281d3069537b",
        "transactionId": "4d09377e3d454dc8a69003ca8b1f0a63",
        "messageIdHeader": "<202112301304100c7ded281d3069537b@return.flowmailer.local>",
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16814",
            "description": "test flow 2"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:28.433Z",
        "backendDone": "2021-12-30T13:04:28.577Z",
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:10 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow2"
            },
            {
                "name": "Subject",
                "value": "test message 2"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "headersOut": [
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow2"
            },
            {
                "name": "Subject",
                "value": "test message 2"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            },
            {
                "name": "Feedback-ID",
                "value": "545:545-6953:545-16814:flowmailer"
            },
            {
                "name": "Message-ID",
                "value": "<202112301304100c7ded281d3069537b@return.flowmailer.local>"
            },
            {
                "name": "Date",
                "value": "Thu, 30 Dec 2021 13:04:28 +0000"
            },
            {
                "name": "X-Job",
                "value": "fm-6953-16814"
            }
        ],
        "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:lEe655XhIaYwcoTQtKTwSA:HZqR9b4PQU3cSzCZ-YxOAHQTMs7grF3LzKdCJiZrh_4G9l1Kl6TeQ5cakQbvBXD0YjZgXVHC4IJ2bZQBsqZBor5zpkYLs-GHm4ecmSCXVBwuRsWpc_oMbu1n1iAPJOn4:8HWxX9i-N5ulN1JP30sqKjTJ6dUUbLS4H5SmSVzameA",
        "status": "DELIVERED",
        "subject": "test message 2",
        "from": "casper@flowmailer.local",
        "events": null,
        "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:ptQqe7n1AHGbOfq7R4IuTA:Kxo_sCt2ZDhAUDyLQbMHJqjW0k_J44QjlogrTYLkj1irWK-bNQMXkszW_aH0pTDMNhMHcNmDOZo78hhBbSc9zbTc91qqjWYfXDxFstXLZc8AaqoHkmQY99kimlS2ZC2a:4yIg5HvHn1s2zONpOiK9nlG6ksQEo0ETsMjqcQ6Vj2A&code=a1e2f0702104bf635e04600b1c9f92c9afaad77f",
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    },
    {
        "submitted": "2021-12-30T13:04:07.000Z",
        "id": "20211230130407e3b36e2e92fdbefc86",
        "transactionId": "5f133c15a8de4ddca8fff9a26652b513",
        "messageIdHeader": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>",
        "messageType": "EMAIL",
        "source": {
            "id": "6953",
            "description": "test source a"
        },
        "flow": {
            "id": "16801",
            "description": "test flow 1 (updated)"
        },
        "senderAddress": "support@flowmailer.local",
        "recipientAddress": "richard@flowmailer.local",
        "backendStart": "2021-12-30T13:04:13.122Z",
        "backendDone": "2021-12-30T13:04:28.577Z",
        "headersIn": [
            {
                "name": "Received",
                "value": "from 127.0.0.1   by  (Flowmailer API) with HTTP   for <richard@flowmailer.local>;   Thu, 30 Dec 2021 14:04:08 +0100 (CET)"
            },
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow1"
            },
            {
                "name": "Subject",
                "value": "test message 1"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            }
        ],
        "headersOut": [
            {
                "name": "MIME-Version",
                "value": "1.0"
            },
            {
                "name": "From",
                "value": "Casper Mout <casper@flowmailer.local>"
            },
            {
                "name": "To",
                "value": "Richard van Looijen <richard@flowmailer.local>"
            },
            {
                "name": "X-Flow",
                "value": "flow1"
            },
            {
                "name": "Subject",
                "value": "test message 1"
            },
            {
                "name": "Content-Type",
                "value": "text\/plain; charset=UTF-8"
            },
            {
                "name": "Content-Transfer-Encoding",
                "value": "quoted-printable"
            },
            {
                "name": "Feedback-ID",
                "value": "545:545-6953:545-16801:flowmailer"
            },
            {
                "name": "Message-ID",
                "value": "<20211230130407e3b36e2e92fdbefc86@return.flowmailer.local>"
            },
            {
                "name": "Date",
                "value": "Thu, 30 Dec 2021 13:04:25 +0000"
            },
            {
                "name": "X-Job",
                "value": "fm-6953-16801"
            }
        ],
        "onlineLink": "https://web.flowmailer.net/viewonline.html?id=VRbzZZWMpsc:oXOkvbDrOPCutBcqQfqEjg:kjXvyd2JpSJhOpOd1qHCQtaDXsF7T3VumsSfro8ZiklvpyVJTJqBqW2Voy03tN_KdDPoIqR1sULMipY-pqWq1BE3raBHYR9ssZ2-TaT7H-A_RE-RcIMlGMQcoeH6hCXO:C5jLt-wixniG3lGh-lAdGiOVXTO6KpDPOkITShUWWdQ",
        "status": "DELIVERED",
        "subject": "test message 1",
        "from": "casper@flowmailer.local",
        "events": null,
        "messageDetailsLink": "https://web.flowmailer.net/viewmessage.html?id=VRbzZZWMpsc:CU4aHLTEIaUU14MAroBH5g:KRNbOnl_Y4_QiUaYY8PxzdDpWRoq3tMLvM0NmB6yCahARYtQoGljSjIIKEbmJ6wuGJ9CeBJ3sivJQGUJx6wRciiR0ElxWsv95Le6s5PaC4HbwqTfQkwRjusGfLzcbX-z:w5D2VuofrJwTzNk7AFMONmaQVtIvNQlthuhGE7TZVtE&code=c579ae4daaedfea39c098c0c0a279a2ec8847459",
        "fromAddress": {
            "name": "Casper Mout",
            "address": "casper@flowmailer.local"
        },
        "toAddressList": [
            {
                "name": "Richard van Looijen",
                "address": "richard@flowmailer.local"
            }
        ]
    }
]

GET /{account_id}/sources/{source_id}/stats

Get time based message statistics for a message source

The resolution of the returned data may be lower than specified in the interval parameter if the data is old or the requested date range is too large.

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sources/{source_id}/stats

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

daterange matrix date_range yes

Date range the messages were submitted in

interval matrix integer no

Time difference between samples

source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 DataSets

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\DataSets;
use Flowmailer\API\Parameter\DateRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$sourceId  = '';
$daterange = new DateRange($startDate, $endDate);
$interval  = 60;

/** @var DataSets $result */
try {
    $result = $flowmailer->getSourceStats($sourceId, $daterange, $interval);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=6953
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
interval=86400

curl -s -X GET "https://api.flowmailer.net/${account_id}/sources/${source_id}/stats;daterange=${daterange};interval=${interval}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '6953';
$daterange  = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$interval   = 86400;

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
    'interval' => $interval,
], '', ';');
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/stats%s',
      $account_id,
      $source_id,
      $matrix
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sources/6953/stats;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z;interval=86400 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "list": [
        {
            "name": "processed",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "email",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "sms",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "sent",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "delivered",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 2
                }
            ]
        },
        {
            "name": "deliver_time",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "opened",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "unique_opened",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "clicked",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        },
        {
            "name": "unique_clicked",
            "samples": [
                {
                    "timestamp": "2021-12-30T00:00:00.000Z",
                    "value": 0
                }
            ]
        }
    ]
}

GET /{account_id}/sources/{source_id}/users

List credentials per source system

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sources/{source_id}/users

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Credentials[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\CredentialsCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$sourceId = '';

/** @var CredentialsCollection $result */
try {
    $result = $flowmailer->getSourceUsers($sourceId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=6953

curl -s -X GET "https://api.flowmailer.net/${account_id}/sources/${source_id}/users" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '6953';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/users',
      $account_id,
      $source_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sources/6953/users HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "id": "10269",
        "sourceId": "6953",
        "username": "YY88mW9Zg5C9HAVh",
        "password": null,
        "contactInfo": "Contact support@flowmailer.com for information about these source credentials",
        "description": "source credentials 1",
        "protocol": "SMTP",
        "allowedSenders": [
            "support2@example.test",
            "support@example.test"
        ],
        "allowedAddresses": [
            "123.123.123.0\/24",
            "124.124.124.124"
        ]
    }
]

POST /{account_id}/sources/{source_id}/users

Create credentials for a source

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/sources/{source_id}/users

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Credentials yes
source_id path string yes

Source ID

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Credentials Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Enum\Protocol;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Credentials;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$protocol = Protocol::SMTP;

$sourceId    = '';
$credentials = (new Credentials())
   ->setProtocol($protocol)
;

/** @var Credentials $result */
try {
    $result = $flowmailer->createSourceUsers($sourceId, $credentials);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=6953
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/sources/${source_id}/users" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$source_id  = '6953';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/users',
      $account_id,
      $source_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

POST /545/sources/6953/users HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "allowedAddresses": [
    "123.123.123.0\/24",
    "124.124.124.124"
  ],
  "allowedSenders": [
    "support@example.test",
    "support2@example.test"
  ],
  "contactInfo": "Contact support@flowmailer.com for information about these source credentials",
  "description": "source credentials 1",
  "protocol": "SMTP",
  "sourceId": "6953"
}

Response

HTTP/1.1 201 Created
Location: https://api.flowmailer.net/545/sources/6953/users/10269
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "id": "10269",
    "sourceId": "6953",
    "username": "YY88mW9Zg5C9HAVh",
    "password": "773i4NwVruPvQAUr",
    "contactInfo": "Contact support@flowmailer.com for information about these source credentials",
    "description": "source credentials 1",
    "protocol": "SMTP",
    "allowedSenders": [
        "support2@example.test",
        "support@example.test"
    ],
    "allowedAddresses": [
        "123.123.123.0\/24",
        "124.124.124.124"
    ]
}

DELETE /{account_id}/sources/{source_id}/users/{user_id}

Delete credentials

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/sources/{source_id}/users/{user_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

source_id path string yes

Source ID

user_id path string yes

Credential ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$sourceId = '';
$userId   = '';

try {
    $result = $flowmailer->deleteSourceUser($sourceId, $userId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=
user_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/sources/${source_id}/users/${user_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '';
$user_id    = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/users/%s',
      $account_id,
      $source_id,
      $user_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/sources/{source_id}/users/{user_id}

Get credentials for a source

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/sources/{source_id}/users/{user_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

source_id path string yes

Source ID

user_id path string yes

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Credentials

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Credentials;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$sourceId = '';
$userId   = '';

/** @var Credentials $result */
try {
    $result = $flowmailer->getSourceUser($sourceId, $userId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=6953
user_id=10269

curl -s -X GET "https://api.flowmailer.net/${account_id}/sources/${source_id}/users/${user_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '6953';
$user_id    = '10269';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/users/%s',
      $account_id,
      $source_id,
      $user_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/sources/6953/users/10269 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "id": "10269",
    "sourceId": "6953",
    "username": "YY88mW9Zg5C9HAVh",
    "password": null,
    "contactInfo": "Contact support@flowmailer.com for information about these source credentials",
    "description": "source credentials 1",
    "protocol": "SMTP",
    "allowedSenders": [
        "support2@example.test",
        "support@example.test"
    ],
    "allowedAddresses": [
        "123.123.123.0\/24",
        "124.124.124.124"
    ]
}

PUT /{account_id}/sources/{source_id}/users/{user_id}

Update credentials for a source

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/sources/{source_id}/users/{user_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Credentials yes
source_id path string yes

Source ID

user_id path string yes

Credential ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Credentials

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Enum\Protocol;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Credentials;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$protocol = Protocol::SMTP;

$sourceId    = '';
$userId      = '';
$credentials = (new Credentials())
   ->setProtocol($protocol)
;

/** @var Credentials $result */
try {
    $result = $flowmailer->updateSourceUser($sourceId, $userId, $credentials);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
source_id=
user_id=
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/sources/${source_id}/users/${user_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';
$source_id  = '';
$user_id    = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/sources/%s/users/%s',
      $account_id,
      $source_id,
      $user_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/tag/{tag}/messages

List messages per tag

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/tag/{tag}/messages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false

Whether to add online link

addtags query boolean no false
daterange matrix date_range no

Date range the messages were submitted in

range header ref_range yes

Limits the returned list

sortorder query string no
tag path string yes

Tag

Response Messages

HTTP Status Code Response Model Response Headers Description
206 Message[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\MessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 73;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$tag           = '';
$range         = new ReferenceRange($count, $reference);
$daterange     = new DateRange($startDate, $endDate);
$sortorder     = '';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;

/** @var MessageCollection $result */
try {
    $result = $flowmailer->getTagMessages($tag, $range, $daterange, $sortorder, $addheaders, $addonlinelink, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
tag=
daterange=
addheaders=false
addonlinelink=false
addtags=false
sortorder=
range=

curl -s -X GET "https://api.flowmailer.net/${account_id}/tag/${tag}/messages;daterange=${daterange}?addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}&sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$tag           = '';
$daterange     = '';
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$sortorder     = '';
$range         = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
], '', ';');
$query    = '?'.http_build_query([
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/tag/%s/messages%s%s',
      $account_id,
      $tag,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/templates

List templates by account

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/templates

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Template[]

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\TemplateCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

/** @var TemplateCollection $result */
try {
    $result = $flowmailer->getTemplates();
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=

curl -s -X GET "https://api.flowmailer.net/${account_id}/templates" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/templates',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/templates HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[
    {
        "id": "48679",
        "description": "template 1",
        "mimeType": "text\/plain",
        "templateEngine": "freemarker-2.3.20",
        "data": null
    },
    {
        "id": "48681",
        "description": "template 2",
        "mimeType": "text\/plain",
        "templateEngine": "freemarker-2.3.20",
        "data": null
    }
]

POST /{account_id}/templates

Create template

Resource URL

Type URL format
POST https://api.flowmailer.net/{account_id}/templates

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Template yes

Template object

Response Messages

HTTP Status Code Response Model Response Headers Description
201 Location

Extra Response Headers

Name Type HTTP status code Description
Location url 201 Contains the URL of the newly created API resource

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Enum\TemplateEngine;
use Flowmailer\API\Enum\TemplateMimeType;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Template;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$data           = 'data';
$description    = 'description';
$mimeType       = TemplateMimeType::PLAIN;
$templateEngine = TemplateEngine::FREEMARKER_2_3_20;

$template = (new Template())
   ->setData($data)
   ->setDescription($description)
   ->setMimeType($mimeType)
   ->setTemplateEngine($templateEngine)
;

try {
    $result = $flowmailer->createTemplate($template);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
body=

curl -s -X POST "https://api.flowmailer.net/${account_id}/templates" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Content-Type: application/vnd.flowmailer.v1.12+json" \
-d "${body}"
<?php
$account_id = '';
$body       = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'POST',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            'Content-Type: application/vnd.flowmailer.v1.12+json',
        ],
        'content' => json_encode($requestbody),
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/templates',
      $account_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

POST /545/templates HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
  "data": "<html><body>html template ${var1}<br\/>\\n<#-- REGION: region1 -->\\nmet twee regions<br\/>\\n<#-- END REGION: region1 -->\\nnog wat onaanpasbare tekst<br\/>\\n<#-- REGION: region2 -->\\ntekst in de tweede region<br\/>\\nnog een regel<br\/>\\n<#-- END REGION: region2 -->\\nnog meer onaanpasbare tekst\\n<br\/><\/body><\/html>",
  "description": "template 2",
  "mimeType": "text\/plain",
  "templateEngine": "freemarker-2.3.20"
}

Response

HTTP/1.1 201 Created
Location: https://api.flowmailer.net/545/templates/48681
Content-Length: 0

DELETE /{account_id}/templates/{template_id}

Delete template by id

Resource URL

Type URL format
DELETE https://api.flowmailer.net/{account_id}/templates/{template_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

template_id path string yes

Template ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$templateId = '';

try {
    $result = $flowmailer->deleteTemplate($templateId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
template_id=

curl -s -X DELETE "https://api.flowmailer.net/${account_id}/templates/${template_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id  = '';
$template_id = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'DELETE',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/templates/%s',
      $account_id,
      $template_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/templates/{template_id}

Get template by id

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/templates/{template_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

template_id path string yes

Template ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200 Template

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Template;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$templateId = '';

/** @var Template $result */
try {
    $result = $flowmailer->getTemplate($templateId);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
template_id=48679

curl -s -X GET "https://api.flowmailer.net/${account_id}/templates/${template_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id  = '';
$template_id = '48679';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/templates/%s',
      $account_id,
      $template_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/templates/48679 HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
{
    "id": "48679",
    "description": "template 1",
    "mimeType": "text\/plain",
    "templateEngine": "freemarker-2.3.20",
    "data": "<html><body>html template<br\/>\\n<#-- REGION: region1 -->\\nmet twee regions<br\/>\\n<#-- END REGION: region1 -->\\nnog wat onaanpasbare tekst<br\/>\\n<#-- REGION: region2 -->\\ntekst in de tweede region<br\/>\\nnog een regel<br\/>\\n<#-- END REGION: region2 -->\\nnog meer onaanpasbare tekst\\n<br\/><\/body><\/html>"
}

PUT /{account_id}/templates/{template_id}

Save template

Resource URL

Type URL format
PUT https://api.flowmailer.net/{account_id}/templates/{template_id}

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

body body Template yes

Template object

template_id path string yes

Template ID

Response Messages

HTTP Status Code Response Model Response Headers Description
200

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Model\Template;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$data           = 'new data';
$description    = 'new description';
$mimeType       = 'new mimeType';
$templateEngine = 'new templateEngine';

$templateId = '';
$template   = (new Template())
   ->setData($data)
   ->setDescription($description)
   ->setMimeType($mimeType)
   ->setTemplateEngine($templateEngine)
;

try {
    $result = $flowmailer->updateTemplate($templateId, $template);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
template_id=
body=

curl -s -X PUT "https://api.flowmailer.net/${account_id}/templates/${template_id}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json"
<?php
$account_id  = '';
$template_id = '';
$body        = '';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'PUT',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
        ],
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/templates/%s',
      $account_id,
      $template_id
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

GET /{account_id}/undeliveredmessages

List undeliverable messages

Resource URL

Type URL format
GET https://api.flowmailer.net/{account_id}/undeliveredmessages

Parameters

Name Location Type Required Default Description
account_id path string yes

Account ID

addevents query boolean no false

Whether to add message events

addheaders query boolean no false

Whether to add e-mail headers

addonlinelink query boolean no false
addtags query boolean no false
daterange matrix date_range no

Date range the message was submitted in

range header ref_range yes

Limits the returned list

receivedrange matrix date_range no

Date range the message bounced

sortorder query string no

Response Messages

HTTP Status Code Response Model Response Headers Description
206 BouncedMessage[] Content-Range,Next-Range

Extra Response Headers

Name Type HTTP status code Description
Content-Range content_range 206 Used to specify which subset of the requested data is returned
Next-Range ref_range 206 Used to specify the range that should be used in the next api call

Examples

<?php
require 'vendor/autoload.php';

use Flowmailer\API\Collection\BouncedMessageCollection;
use Flowmailer\API\Exception\ApiException;
use Flowmailer\API\Flowmailer;
use Flowmailer\API\FlowmailerInterface;
use Flowmailer\API\Parameter\DateRange;
use Flowmailer\API\Parameter\ReferenceRange;

// The credentials can be obtained in your Flowmailer account
$accountId    = '...';
$clientId     = '...';
$clientSecret = '...';

/** @var FlowmailerInterface $flowmailer */
$flowmailer = Flowmailer::init($accountId, $clientId, $clientSecret);

$count     = 67;
$reference = null;
$startDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-03-01T00:00:00O');
$endDate   = \DateTime::createFromFormat(\DateTime::ISO8601, '2024-05-01T00:00:00O');

$range         = new ReferenceRange($count, $reference);
$daterange     = new DateRange($startDate, $endDate);
$receivedrange = new DateRange($startDate, $endDate);
$sortorder     = '';
$addevents     = false;
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;

/** @var BouncedMessageCollection $result */
try {
    $result = $flowmailer->getUndeliveredMessages($range, $daterange, $receivedrange, $sortorder, $addevents, $addheaders, $addonlinelink, $addtags);
}
catch (ApiException $exception) {
    // Handle problems here, find API errors in $exception->getErrors()
}

See Flowmailer PHP SDK on GitHub for more info and installation instructions.
#!/bin/bash

access_token=
account_id=
daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z
receivedrange=
addevents=false
addheaders=false
addonlinelink=false
addtags=false
sortorder=
range=items=:10

curl -s -X GET "https://api.flowmailer.net/${account_id}/undeliveredmessages;daterange=${daterange};receivedrange=${receivedrange}?addevents=${addevents}&addheaders=${addheaders}&addonlinelink=${addonlinelink}&addtags=${addtags}&sortorder=${sortorder}" \
-H "Authorization: Bearer ${access_token}" \
-H "Accept: application/vnd.flowmailer.v1.12+json" \
-H "Range: ${range}"
<?php
$account_id    = '';
$daterange     = '2021-12-30T00:00:00Z,2021-12-31T00:00:00Z';
$receivedrange = '';
$addevents     = false;
$addheaders    = false;
$addonlinelink = false;
$addtags       = false;
$sortorder     = '';
$range         = 'items=:10';

$options = [
    'http' => [
        'ignore_errors' => true,
        'method' => 'GET',
        'header' => [
            sprintf('Authorization: Bearer %s', $access_token),
            'Accept: application/vnd.flowmailer.v1.12+json',
            sprintf('Range: %s', $range),
        ],
    ],
];

$context  = stream_context_create($options);
$matrix   = ';'.http_build_query([
    'daterange' => $daterange,
    'receivedrange' => $receivedrange,
], '', ';');
$query    = '?'.http_build_query([
    'addevents' => $addevents,
    'addheaders' => $addheaders,
    'addonlinelink' => $addonlinelink,
    'addtags' => $addtags,
    'sortorder' => $sortorder,
]);
$response = file_get_contents(
    sprintf(
      'https://api.flowmailer.net/%s/undeliveredmessages%s%s',
      $account_id,
      $matrix,
      $query
   ),
    false,
    $context
);
$response   = json_decode($response);
$statuscode = substr($http_response_header[0], 9, 3);

Request

GET /545/undeliveredmessages;daterange=2021-12-30T00:00:00Z,2021-12-31T00:00:00Z?addevents=true&addheaders=true&addonlinelink=true HTTP/1.1
Host: api.flowmailer.net
Authorization: Bearer {access_token}
Accept: application/vnd.flowmailer.v1.12+json;charset=UTF-8
Range: items=:10

Response

HTTP/1.1 206 Partial Content
Content-Range: items :10/*
Content-Type: application/vnd.flowmailer.v1.12+json;charset=UTF-8
[]

Resource Models

Address
Attachment
BouncedMessage
Credentials
DataExpression
DataSet
DataSets
DkimKey
DnsRecord
Error
Errors
EventFlow
EventFlowRuleSimple
Exception
Filter
Flow
FlowRuleHierarchyItem
FlowRuleItem
FlowRuleSimple
FlowStep
FlowStepAddAttachment
FlowStepAggregate
FlowStepArchive
FlowStepDiscard
FlowStepDnsLookup
FlowStepExternalContent
FlowStepExternalData
FlowStepExtractData
FlowStepLdapSearch
FlowStepResubmitMessage
FlowStepRewriteRecipient
FlowStepSchedule
FlowStepSetHeader
FlowStepSetSender
FlowTemplate
Header
InboundRecipient
MailPlusAPICredentials
Message
MessageArchive
MessageEvent
MessageHold
MessageReturn
MessageSummary
NamedSample
OAuthErrorResponse
OAuthTokenResponse
ObjectDescription
Recipient
ResendMessage
Role
Sample
SampleMessage
SenderDomain
SimulateMessage
SimulateMessageResult
Source
SourceConnectionInfo
SubmitMessage
Template
TemplatePreview
TlsInfo

Address

Fields

Name Type Description
address string

Email address or phone number

name string

Display name, only used for email messages

Attachment

Fields

Name Type Description
content base64

contentId string

Content-ID header (required for disposition related)

Example: <part1.DE1D8F7E.E51807FF@flowmailer.com>

contentType string

Examples: application/pdf, image/jpeg

disposition string

Content-Disposition header for the attachment.

Supported values include: attachment, inline and related

Special value related should be used for images referenced in the HTML.

filename string

BouncedMessage

Undeliverable message

Fields

Name Type Description
backendDone date

The time flowmailer was done processing this message

backendStart date

The time flowmailer started processing this message

bounceReceived date

Date on which the message was bounced

bounceSnippet string

bounceSubType string

bounceType string

events MessageEvent[]

Message events

Ordered by received, new events first.

flow ObjectDescription

Flow this message was processed in

from string

The email address in From email header

fromAddress Address

The address in From email header

headersIn Header[]

E-Mail headers of the submitted email message.

Only applicable when messageType = EMAIL and addheaders parameter is true

headersOut Header[]

Headers of the final e-mail.

Only applicable when messageType = EMAIL and addheaders parameter is true

id string

Message id

messageDetailsLink string

Link for the message details page. With resend button.

messageIdHeader string

Content of the Message-ID email header

messageType string

Message type: EMAIL, SMS or LETTER

onlineLink string

Last online link

recipientAddress string

Recipient address

senderAddress string

Sender address

source ObjectDescription

Source system that submitted this message

status string

Current message status

subject string

Message subject

Only applicable when messageType = EMAIL

submitted date

The time this message was submitted to flowmailer

tags string[]

Message tags, only available for api calls with addtags=true

toAddressList Address[]

The recipients in the To email header

transactionId string

The SMTP transaction id, returned with the SMTP 250 response

Credentials

Source system credentials

Fields

Name Type Description
allowedAddresses string[]

Allowed IP addresses that can connect to Flowmailer using these credentials

allowedSenders string[]

authSource string

clientId string

clientSecret string

contactInfo string

Contact info for these credentials

description string

id string

Source credentials ID

inboundDomain string

inboundRecipients InboundRecipient[]

password string

Password

protocol string

Protocol: SMTP, SMTP_RCPT, SMTP_HEADER, SMTP_IPONLY, or SMPP

roles string[]

Valid roles can be FEATURE_SUBMITMESSAGE for message submit only, or one of the roles returned by GET /{account_id}/roles.

Roles must contain exactly 1 role.

sourceId string

username string

Username

DataExpression

Fields

Name Type Description
expression string

Expression

value string

Value which must match the result of the expression

DataSet

Data set with statistics

Fields

Name Type Description
name string

Data set name

samples Sample[]

List of samples in this dataset

DataSets

Multiple data sets

Fields

Name Type Description
list DataSet[]

List of data sets

DkimKey

Fields

Name Type Description
cnameTarget string

domain string

publicKey string

selector string

DnsRecord

DNS record that should be configured

Fields

Name Type Description
errorMessages string[]

Error messages for this DNS record

Only filled when DNS records are validated.

name string

Record name

status string

Current record status

Only filled when DNS records are validated.

Possible values: UNKNOWN: We had an error while validating this DNS record ERROR: DNS record is not correct WARNING: DNS record is functional but could be improved OK: DNS record is ok

type string

Record type

value string

Record value description in HTML

warningMessages string[]

Warning messages for this DNS record

Only filled when DNS records are validated.

Error

Fields

Name Type Description
arguments Object[]

code string

defaultMessage string

field string

objectName string

rejectedValue Object

Errors

Fields

Name Type Description
allErrors Error[]

List of errors

EventFlow

Event flow

Fields

Name Type Description
description string

Flow description

id string

Flow ID

parentId string

Id of the flow parent

steps FlowStep[]

Flow steps that each message in this flow will be processed by

EventFlowRuleSimple

Conditions which must be true for a event to use a flow

Fields

Name Type Description
dataExpressions DataExpression[]

Data expressions which must be present in the message

eventFlowId string

Flow ID of the flow the events will use if the specified conditions are true

eventType string

Match type of the event

headers Header[]

Email headers which must be present in the message

linkName string

Name of the link that was clicked for CLICK events

linkTarget string

Url of the link that was clicked for CLICK events

messageFlowId string

Message Flow ID which handled the original message

Exception

Fields

Name Type Description
message string

type string

Filter

Filtered recipient address

Fields

Name Type Description
accountId string

Account ID

address string

Filtered recipient address

date date

Date on which this filter was added

expiresOn date

Date on which this filter expires

id string

Filter ID

messageReturn MessageReturn

Message event that was the reason for creating this filter

messageType string

This filter is for message type: EMAIL or SMS

reason string

Filter reason

Flow

Message flow

Fields

Name Type Description
description string

Flow description

id string

Flow ID

messageSummary MessageSummary

statistics Sample[]

steps FlowStep[]

Flow steps that each message in this flow will be processed by

templateId string

Id of the flow template

FlowRuleHierarchyItem

Fields

Name Type Description
conditions FlowCondition[]

flow ObjectDescription

nodes FlowRuleHierarchyItem[]

parentId string

FlowRuleItem

Fields

Name Type Description
conditions FlowCondition[]

flow ObjectDescription

FlowRuleSimple

Conditions which must be true for a message to use a flow

Fields

Name Type Description
dataExpressions DataExpression[]

Data expressions which must be present in the message

flowId string

Flow ID of the flow the messages will use if the specified conditions are true

flowSelector string

Flow selector

headers Header[]

Email headers which must be present in the message

sender string

Sender email address or phone number

sourceId string

Source ID which must have submitted the message

FlowStep

A processing step in a flow

Fields

Name Type Description
addAttachment FlowStepAddAttachment

Only applicable and required when type = addAttachment

aggregate FlowStepAggregate

Only applicable when type = aggregate

applyToLinkDomains string

Comma separated list of link domains to modify for analytics parameters.

Only applicable when type = analytics

archive FlowStepArchive

Only applicable and required when type = archive

discard FlowStepDiscard

Only applicable and required when type = discard

divisor integer

Only applicable when type = qamail

dnsLookup FlowStepDnsLookup

Only applicable and required when type = dnsLookup

enabledExpression string

errorOnNotFound boolean

Indicates whether the contact is required or not.

Only applicable when type = mailPlusContact

externalContent FlowStepExternalContent

Only applicable and required when type = externalContent

externalData FlowStepExternalData

Only applicable and required when type = externalData

extractData FlowStepExtractData

Only applicable and required when type = extractdata

id string

Flow step ID

ldapSearch FlowStepLdapSearch

Only applicable and required when type = ldapSearch

mailPlusApiCredentials MailPlusAPICredentials

Credentials to use for retrieving contacts from MailPlus

Only applicable when type = mailPlusContact

overwriteUrlParameters boolean

Overwrite existing URL Parameters in links.

Only applicable when type = analytics

resubmitMessage FlowStepResubmitMessage

Only applicable when type = resubmitMessage

rewriteRecipient FlowStepRewriteRecipient

Only applicable and required when type = rewriteRecipient

schedule FlowStepSchedule

Only applicable when type = schedule

setHeader FlowStepSetHeader

Only applicable and required when type = addHeader

setSender FlowStepSetSender

Only applicable and required when type = setSender

subjectTemplate string

Template for the new subject. Template variables can be used in this field.

Only applicable when type = subject

template ObjectDescription

Only applicable when type = template

to string

Email address the BCC mail will be sent to

Only applicable and required when type = qamail

type string

Flow step type

urlParametersTemplate string

URL Parameters to add to all links. Template variables can be used in this field.

Only applicable when type = analytics

FlowStepAddAttachment

Fields

Name Type Description
urlTemplate string

URL to load the external content from.

Template variables can be used in this field.

FlowStepAggregate

Fields

Name Type Description
alwaysSendFirst boolean

maxTimeSeconds integer

quietTimeSeconds integer

FlowStepArchive

Fields

Name Type Description
onlineLink boolean

Indicates whether this archive is available for online version link

retention string

ISO8601 period notation indicating a shorter retention time (than account settings) for message archives created by this flow step. The following values are valid P1M, P3M, P6M, P1Y

Empty means that the account retention time will be applied.

FlowStepDiscard

Fields

Name Type Description
reason string

FlowStepDnsLookup

Fields

Name Type Description
domainNameTemplate string

ignoreErrors boolean

recordType string

resultVariable string

Variable to store the external content in

FlowStepExternalContent

Fields

Name Type Description
resultVariable string

Variable to store the external content in

urlTemplate string

URL to load the external content from.

Template variables can be used in this field.

FlowStepExternalData

Fields

Name Type Description
fullResponseInVariable boolean

When true the result variable will be filled with a structure that also contains the response headers. When false the result variable will be filled with just the response body.

requestBodyTemplate string

Template text for the request body

Only useful for the following request methods POST, PUT and PATCH

requestHeaders Header[]

Request headers for external data HTTP request

requestMethod string

HTTP request method

Valid values: GET POST PUT PATCH DELETE

resultFormat string

Format of the external data, json or json

resultVariable string

Variable to store the external content in

urlTemplate string

URL to load the external content from.

Template variables can be used in this field.

FlowStepExtractData

Fields

Name Type Description
dataType string

filename string

htmlDecodeText boolean

mimeType string

removeMimePart boolean

selector string

FlowStepLdapSearch

Fields

Name Type Description
attributes string[]

baseDNTemplate string

bindDN string

bindPassword string

filterTemplate string

host string

port integer

resultVariable string

Variable to store the external content in

searchScope string

Search scope

Valid values: ONE BASE SUB

tlsMode string

Connection TLS Mode

Valid values: PLAIN TLS STARTTLS

FlowStepResubmitMessage

Fields

Name Type Description
account ObjectDescription

Account to submit the message to

duplicateMessage boolean

flowSelector string

Selector of the flow to submit the message to

headerName string

Name of the header to add to the email

headerValue string

Value to set in the header

source ObjectDescription

Source to submit the message to

FlowStepRewriteRecipient

Fields

Name Type Description
messageType string

recipientNameTemplate string

recipientTemplate string

rewriteHeaders boolean

FlowStepSchedule

Fields

Name Type Description
maxMessagesPerHour integer

offsetType string

offsetValue integer

scheduledTimeTemplate string

timeRangeDay0 string

timeRangeDay1 string

timeRangeDay2 string

timeRangeDay3 string

timeRangeDay4 string

timeRangeDay5 string

timeRangeDay6 string

timeZone string

FlowStepSetHeader

Fields

Name Type Description
headerName string

Name of the header to add to the email

headerValue string

Value to set in the header

FlowStepSetSender

Fields

Name Type Description
senderNameTemplate string

senderSetName boolean

senderTemplate string

FlowTemplate

Message flow template

Fields

Name Type Description
description string

Flow description

editable boolean

id string

Flow template ID

steps FlowStep[]

Flow steps that each message in this flow will be processed by

templateId string

Id of the parent flow

Fields

Name Type Description
name string

Header name

value string

Header value

InboundRecipient

Fields

Name Type Description
destinationRecipient string

inboundAddress string

MailPlusAPICredentials

Spotler API credentials

Fields

Name Type Description
consumerKey string

Consumer key

consumerSecret string

Consumer secret

Message

Fields

Name Type Description
backendDone date

The time flowmailer was done processing this message

backendStart date

The time flowmailer started processing this message

events MessageEvent[]

Message events

Ordered by received, new events first.

flow ObjectDescription

Flow this message was processed in

from string

The email address in From email header

fromAddress Address

The address in From email header

headersIn Header[]

E-Mail headers of the submitted email message.

Only applicable when messageType = EMAIL and addheaders parameter is true

headersOut Header[]

Headers of the final e-mail.

Only applicable when messageType = EMAIL and addheaders parameter is true

id string

Message id

messageDetailsLink string

Link for the message details page. With resend button.

messageIdHeader string

Content of the Message-ID email header

messageType string

Message type: EMAIL, SMS or LETTER

onlineLink string

Last online link

recipientAddress string

Recipient address

senderAddress string

Sender address

source ObjectDescription

Source system that submitted this message

status string

Current message status

subject string

Message subject

Only applicable when messageType = EMAIL

submitted date

The time this message was submitted to flowmailer

tags string[]

Message tags, only available for api calls with addtags=true

toAddressList Address[]

The recipients in the To email header

transactionId string

The SMTP transaction id, returned with the SMTP 250 response

MessageArchive

Archived message text and/or html

Fields

Name Type Description
attachments Attachment[]

Attachments, without the content

Only applicable when messageType = EMAIL

data Object
flowStepId string

The archive flow step that created this archived message

html string

Archived message html

messageDetailsLink string

Link for the message details page. With resend button.

Only applicable when messageType = EMAIL

messageType string

EMAIL, SMS or LETTER

onlineLink string

Online link

Only applicable when messageType = EMAIL

onlineVersion boolean

Indicates whether this archive is available for online version link

subject string

Archived message subject

text string

Archived message text

MessageEvent

Message event

Fields

Name Type Description
data base64

Event data

deviceCategory string

extraData

Event data

id string

Message event ID

inserted

Database insert date

linkName string

linkTarget string

messageId string

Message ID

messageTags string[]

Message tags

Only filled for the GET /{account_id}/message_events api call when the parameter addmessagetags is true

mta string

MTA that reported this event

operatingSystem string

operatingSystemVersion string

received date

Event date

referer string

remoteAddr string

snippet string

Bounce snippet or SMTP conversation snippet

subType

Bounce sub type

tag

Custom event type

type string

Event type, must be CUSTOM

userAgent string

userAgentDisplayName string

userAgentString string

userAgentType string

userAgentVersion string

MessageHold

Messages that could not be processed

Fields

Name Type Description
backendDone date

The time flowmailer was done processing this message

data base64

MIME message data or text for SMS messages

dataCoding byte

Only for SMS messages

errorText string

Message error text

extraData Object

flow ObjectDescription

The selected flow

messageId string

Message ID

messageType string

Message type: EMAIL, SMS or LETTER

reason string

Message processing failure reason

recipient string

Message recipient address

sender string

Message sender address

source ObjectDescription

Source system that submitted this message

status string

Message status

submitted date

Message submit date

transactionId string

Transaction ID

MessageReturn

Message event

Fields

Name Type Description
data base64

Event data

deviceCategory string

extraData

Event data

id string

Message event ID

inserted

Database insert date

linkName string

linkTarget string

messageId string

Message ID

messageTags string[]

Message tags

Only filled for the GET /{account_id}/message_events api call when the parameter addmessagetags is true

mta string

MTA that reported this event

operatingSystem string

operatingSystemVersion string

received date

Event date

referer string

remoteAddr string

snippet string

Bounce snippet or SMTP conversation snippet

sourceMta

subType

Bounce sub type

tag

Custom event type

type string

Event type, must be CUSTOM

userAgent string

userAgentDisplayName string

userAgentString string

userAgentType string

userAgentVersion string

MessageSummary

Message statistics summary

Fields

Name Type Description
averageDeliverTimeMillis integer

Average delivery time in milliseconds

clicked integer

Number of times a link has been clicked

delivered integer

Number of messages delivered

opened integer

Number of times a message has been opened

processed integer

Number of messages processed

sent integer

Number of messages sent

uniqueClicked integer

Number of messages in which a link has been clicked

uniqueOpened integer

Number of messages that have been opened

NamedSample

Fields

Name Type Description
name string

other boolean
value integer

OAuthErrorResponse

Described in http://tools.ietf.org/html/rfc6749

Fields

Name Type Description
error string
error_description string
error_uri string

OAuthTokenResponse

Response object which contains the requested access token

Fields

Name Type Description
access_token string The requested access token
expires_in integer The number of seconds this token is valid
scope string Only api is supported
token_type string Type of the returned token, only bearer is supported

ObjectDescription

Generic resource model with an ID and description.

Fields

Name Type Description
description string

Resource description

id string

Resource ID

Recipient

Statistics for a single recipient

Fields

Name Type Description
address string

Recipient email address or phone number

filters Filter[]

One or more filters for this recipient

messageSummary MessageSummary

Message statistics for this recipient

ResendMessage

Fields

Name Type Description
recipientAddress string

Override recipient email address or phone number.

Role

Fields

Name Type Description
description string

id string

name string

roles string[]

Sample

Fields

Name Type Description
timestamp date

value integer

SampleMessage

Fields

Name Type Description
created date

description string

extraData Object

fromAddress string

fromName string

id string

messageType string

mimedata base64

sender string

source ObjectDescription

SenderDomain

a SenderDomain configures which return-path and online tracking domain is used to send messages

DKIM keys are created for each configured SenderDomain.

DNS records are filled for the following api calls:
1. POST /{account_id}/sender_domains/validate
2. GET /{account_id}/sender_domains/{domain_id}
3. GET /{account_id}/sender_domains/by_domain/{domain}

DNS records are validated for the following api calls:
1. POST /{account_id}/sender_domains/validate
2. GET /{account_id}/sender_domains/{domain_id} when validate parameter is true
3. GET /{account_id}/sender_domains/by_domain/{domain} when validate parameter is true

Fields

Name Type Description
dnsRecords DnsRecord[]

List of DNS records that should exist

id string

ID of this SenderDomain

returnPathDomain string

Domain used for bounce receiving, usually a subdomain of the senderDomain

senderDomain string

Domain used to select this SenderDomain for emails with a matching From header

warnings Error[]

Only filled when DNS records are validated.

webDomain string

Domain used for online tracking, usually a subdomain of the senderDomain

SimulateMessage

Fields

Name Type Description
attachments Attachment[]

Attachments

Only applicable when messageType = EMAIL

data Object

Extra data that will be available in templates

deliveryNotificationType string

NONE, FAILURE or DELIVERY_AND_FAILURE

Defaults to NONE for SMS

Only applicable when messageType = SMS

flowSelector string

Freely configurable value that can be used to select a flow or one of its variants.

Examples: invoice, previsit, ticket.

headerFromAddress string

From header address

Only applicable when messageType = EMAIL

headerFromName string

From header name

Only applicable when messageType = EMAIL

headerToAddress string

To header address

Only applicable when messageType = EMAIL

headerToName string

To header name

Only applicable when messageType = EMAIL

headers Header[]

Email headers

html string

Email HTML content

Only applicable when messageType = EMAIL

messageType string

EMAIL, SMS or LETTER

mimedata base64

Complete email MIME message with headers.

Only applicable when messageType = EMAIL

recipientAddress string

Recipient email address or phone number.

For email messages this cannot contain a display name.

scheduleAt date

senderAddress string

Sender email address or phone number.

For email messages this cannot contain a display name.

sourceId string

subject string

Email subject

tags string[]

Tags

text string

Text content

SimulateMessageResult

Fields

Name Type Description
attachments Attachment[]

Attachments, without the content

Only applicable when messageType = EMAIL

data Object
flow ObjectDescription

html string

Archived message html

messageType string

EMAIL, SMS or LETTER

subject string

Archived message subject

text string

Archived message text

Source

Information about a source system

A source system can submit messages to flowmailer.

Fields

Name Type Description
description string

Source description

dsnAddress string

Email DSN messages will be sent to this address

dsnDisable boolean

Disable sending DSN messages for this source

extraData Object

feedbackLoopAddress string

Email feedback loop messages will be sent to this address

humanReadableDsnAddress string

Human readable notifications for undelivered messages will be sent to this address

humanReadableDsnEnable boolean

Enable sending human readable notifications for undelivered messages for this source

id string

Source ID

lastActive date

Date this source was last active

maxMessageSize integer

Maximum message size in bytes

messageSummary MessageSummary

Message statistics summary for this source

statistics Sample[]

Message statistics for this source

tlsRequired boolean

type

Source type: API, SMTP, SMTP_RCPT, SMTP_DOMAIN SMPP, or FLOWMAILER

SourceConnectionInfo

Fields

Name Type Description
authMethod string

lastUsed date

remoteIp string

tls TlsInfo

SubmitMessage

An email or sms message that can be submitted to Flowmailer.

Fields

Name Type Description
attachments Attachment[]

Attachments

Only applicable when messageType = EMAIL

data Object

Extra data that will be available in templates

deliveryNotificationType string

NONE, FAILURE or DELIVERY_AND_FAILURE

Defaults to NONE for SMS

Only applicable when messageType = SMS

flowSelector string

Freely configurable value that can be used to select a flow or one of its variants.

Examples: invoice, previsit, ticket.

headerFromAddress string

From header address

Only applicable when messageType = EMAIL

headerFromName string

From header name

Only applicable when messageType = EMAIL

headerToAddress string

To header address

Only applicable when messageType = EMAIL

headerToName string

To header name

Only applicable when messageType = EMAIL

headers Header[]

Email headers

html string

Email HTML content

Only applicable when messageType = EMAIL

messageType string

EMAIL, SMS or LETTER

mimedata base64

Complete email MIME message with headers.

Only applicable when messageType = EMAIL

recipientAddress string

Recipient email address or phone number.

For email messages this cannot contain a display name.

scheduleAt date

senderAddress string

Sender email address or phone number.

For email messages this cannot contain a display name.

subject string

Email subject

tags string[]

Tags

text string

Text content

Template

A flowmailer content template

Fields

Name Type Description
contentId string

Content-ID header (required for disposition related)

Example: <part1.DE1D8F7E.E51807FF@flowmailer.com>

Only supported for custom content-types.

data string

Template content

decodeBase64 boolean

Decode Base64

Only supported for custom content-types.

description string

Template description

disposition string

Content-Disposition header for the attachment.

Supported values include: attachment, inline and related

Special value related should be used for images referenced in the HTML.

Only supported for custom content-types.

doNotUpdateOnCopy boolean

Prevents this template from being updated when copying to another account.

This flag is checked on the source template.

filename string

Content filename.

Only supported for custom content-types and application/vnd.flowmailer.itext+pdf.

id string

Template ID

mimeType string

Supported mime types:

  • text/plain
  • text/html
  • application/vnd.flowmailer.itext+pdf

templateEngine string

The only supported template engine is freemarker-2.3.20

TemplatePreview

Fields

Name Type Description
error string

errorLine integer

result string

TlsInfo

Fields

Name Type Description
cipher string

protocol string