Initial situation:
The customer wishes to carry out queries and management processes, such as the on- or off-boarding of users, on the SEPPmail Secure E-Mail Gateway via third-party systems.
Question:
Is it possible to test the API access to the SEPPmail Secure E-Mail Gateway ?
Answer:
If API access has been set up on the SEPPmail Secure E-Mail Gateway (see Admin: API Functions and/or RestAPI), this can be tested, for example, via "Postman".
For this, Postman must first be installed locally (see also https://www.postman.com).
Configuration:
The configuration starts with setting up an
"Environment".
This defines the access information for the system that is to be accessed via the REST API. In the specific case, this is the SEPPmail Secure E-Mail Gateway.
To create an environment, under "Environment" first click on the plus symbol "+".

The new environment should be given a meaningful name. The corresponding parameters must then be set.
!IMPORTANT!
The parameter names must exactly match those in the following table. Otherwise, the script for using the values will not work.
Parameter name |
Value |
---|---|
server |
URL on which the SEPPmail Secure E-Mail Gateway can be reached, for example https://securemail.mycompany.tld Alternatively, an IP address (for example https://192.168.0.10) can be used. |
port |
Port which is entered under RestAPI HTTPS Port , that is 8445 by default |
version |
v1 |
X-SM-API-TOKEN |
string from RestAPI RestAPI keys API token), for example gAhAMwP2PyDVd3YlxbcNiTFWtjFYBAQJ |
X-SM-API-SECRET |
string from RestAPI RestAPI keys API secret), for example GuvQXNA8B2Zzq0S9G2oFKvEClpIUYJhi |
accept |
application/json |
A fully configured environment could then look as follows:

This point is completed by saving the environment.
The configuration is continued with the setting up of a
"Collection"
This defines the commands available for controlling the SEPPmail Secure E-Mail Gateway.
For this, first click on "Collections"
and then on "File" -> "Import" -> "Raw Text".
Now, open the path https://github.com/seppmail/OpenAPI-YAML/blob/main/seppmail_rest_api.yaml in your web browser of choice to view the contents of the file in the GitHub editor. For the display in the GitHub editor, select the "Raw" format. The displayed text should look something like this

and is now to be copied to the clipboard. Then switch to the Postman dialogue and paste the text previously copied to the clipboard.

After clicking on "continue", the following dialogue should appear in Postman:

In "Collections" , the API with the folders of the individual areas is visible

With the "Pre-Request Script", the API call-ups from the "Collections" are tested with the help of the "Environment", which is defined in detail.
The pre-request script can also be found on the GitHub Repository at
https://github.com/seppmail/OpenAPI-YAML/blob/main/postmanConfig.js
The content of this file is copied in the same way as the "Collections" and is to be inserted as follows:

Now, the "Collection" needs to be "authorised".
Since the authorisation is carried out by means of headers in the REST API, the authorisation must be set to "No Auth".

Possibly existing collection"variables" must now be deleted.

For the actual access, the values from the "Environment" are used.
Finally, the collection must be saved.

Now an access test can take place.
This takes place in the Collections. First of all, it should be ensured that the previously created environment (in the example "SEPPmail Test") has been selected. Now, in the "SEPPmail API" the command "Get statistics" is selected and sent via "Send".
If necessary, check the settings in Postman again. For example, when using a self-signed certificate on the SEPPmail Secure E-Mail Gateway, the certificate check in Postman would have to be turned off. |