Before you startPlease contact our support for the latest changes in xorlab API setup before you start configuring the API.
Configuration
-
First, activate the API as the source for receiving emails by xorlab Security Platform. Open the
activeguard/core/active_guard.ymlfile in Expert Editor and add the following line toscanSources: -
Add these two lines and set their values to the same value as
mainWorkerCount. IfmainWorkerCountis not set, use the default value of20: -
Now, you can configure xorlab API itself in Expert Editor by navigating to the
abby/abby/abby.ymlfile. When you open it, the following content appears: -
Under
hosts, adjust the addresses of the xorlab MTAs such that they match your deployment: -
Under
staticApiTokens, enter the name of your bearer authentication token and its value. For SaaS instances, the token will be preconfigured and provided by xorlab; for on-prem instances, we recommend using theopenssl rand -hex 32command to generate the token (32 bytes or 64 hex digits). In the following example, we generated the token with the value ofc51bfe0df36d88823b9fe903a310f36e24b417e427309842605644dcc22a74ac: - Click PUBLISH to apply changes.
API reference
Request
Requests are served by two endpoints:/v1/messageQueue/submitEmail/v1/admin/status
The
parameters argument accepts only one parameter, borderMtaData, which includes the following key:value pairs:
Maximum payloadThe maximum accepted payload size is 50 MiB. Payloads above this will result in a 413 error code.
Response
In response to your API request, you will receive either a message analysis result or an error. In the former case, the response will contain the following parameters:Examples
cURL
This is a sample cURL command for sending an email to XSP for analysis:<path to your eml file>is the path to the .eml file you wish to send, e.g.,fileName.eml<auth token>is the bearer auth token (see step #5 in the Configuration section above)<your XSP instance>is the domain of your XSP instance, e.g., forxyz.activeguard.cloud, the full link would readhttps://xyz.activeguard.cloud:9081/v1/messageQueue/submitEmail
Python
The following Python script makes use of the cURL command described above:<auth token> and <your XSP instance>—are the same as for the cURL example.