spambarrier API-Dokumentation

Sie können Ihren Account bei spambarrier über die öffentliche API administrieren und somit automatisiert Domains anlegen, bearbeiten, löschen, verifizieren und die Filter-Einstellungen ändern.

So wäre es zum Beispiel denkbar, dass Sie die spambarrier API in einer Server- Administrationsoberfläche einbinden und dort beim Anlegen einer neuen Domain automatisch den Spam- und Virenschutz über spambarrier konfigurieren.

Um die Sicherheit Ihrer Daten sicherzustellen, ist ein Zugriff auf die spambarrier API ausschließlich per HTTPS möglich!

API-Zugriffspunkt: https://www.spambarrier.de/api/

Der Request muss als POST übermittelt werden.

get-domains

Alle eingerichteten Domains zurückgeben

Request:

{
	"method": "get-domains",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789"
	}
}
		

Response:

{
	"result": "success",
	"params": {
		"count": 1,
		"domains": [
			{
				"id": "12345",
				"name": "example.org",
				"host": "my-destination-host.example.org",
				"has_authentication": false,
				"confirmed": true,
				"created": "1363209203",
				"quarantine_mail_count": 123
			}
		]
	}
}
		

add-domain

Eine Domain hinzufügen

Request:

{
	"method": "add-domain",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"host": "mail-server.example.org",
		"username": "auth@example.org",      (optional, kann null sein!)
		"password": "nesgihwehg12094"        (optional, kann null sein!)
	}
}
		

Response:

{
	"result": "success",
	"params": {
		"domain_id": 54321,
		"txt_record_for_confirmation": "spambarrier-verify-54321"
	}
}
		

edit-domain

Eine Domain bearbeiten

Request:

{
	"method": "edit-domain",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"host": "mail-server.example.org",
		"username": "auth@example.org",      (optional, kann null sein!)
		"password": "nesgihwehg12094"        (optional, kann null sein!)
	}
}
		

Response:

{
	"result": "success"
}
		

delete-domain

Eine Domain löschen

Request:

{
	"method": "delete-domain",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
	}
}
		

Response:

{
	"result": "success"
}
		

get-filter-settings

Filtereinstellungen für eine Domain abfragen

Request:

{
	"method": "get-filter-settings",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org"
	}
}
		

Response:

{
	"result": "success",
	"params": {
		"spam_treatment": "quarantine",
		"spam_threshold": 5,
		"virus_treatment": "quarantine",
		"greylisting": 0
	}
}
		

set-filter-settings

Filtereinstellungen für eine Domain ändern

Request:

{
	"method": "set-filter-settings",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"spam_treatment": "reject",
		"spam_threshold": 7,
		"virus_treatment": "reject",
		"greylisting": 0
	}
}
		

Mögliche Werte für spam_treatment: "reject", "quarantine", "tag"
Mögliche Werte für virus_treatment: "reject", "quarantine"

Response:

{
	"result": "success"
}
		

confirm-txt-record

Eine Domain per TXT-Record verifizieren.

Request:

{
	"method": "confirm-txt-record",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org"
	}
}
		

Response:

{
	"result": "success"
}
		

get-quarantine

Inhalt des Quarantäne-Postfachs einer Domain zurückgeben

Request:

{
	"method": "get-quarantine",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org"
	}
}
		

Response:

{
	"result": "success",
	"params": {
		"count": 1,
		"messages": [
			{
				"message_id": "98765",
				"from": "from@example.org",
				"to": "to@example.org",
				"subject": "test subject",
				"date": "1363209203",
				"seen": "false",
				"body": "(body of the message including headers)"
			}
		]
	}
}
		

resend-quarantine-message

Quarantäne-E-Mail erneut zustellen

Request:

{
	"method": "resend-quarantine-message",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"message_id": 98765
	}
}
		

Response:

{
	"result": "success",
	"params": {}
}
		

delete-quarantine-message

Quarantäne-E-Mail löschen

Request:

{
	"method": "delete-quarantine-message",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"message_id": 98765
	}
}
		

Response:

{
	"result": "success",
	"params": {}
}
		

get-domain-statistics

Domain-Statistiken abrufen

Request:

{
	"method": "get-domain-statistics",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"from": "2015-01-01", # (Datum im Format "(Jahr)-(Monat)-(Tag)")
		"to": "2015-01-02", # (Datum im Format "(Jahr)-(Monat)-(Tag)")
		"interval": "day" # ("hour", "day", "month")
	}
}
		

Response:

{
   "result":"success",
   "params":{
      "intervals":[
         {
            "label":"2015-01-01",
            "values":{
               "total_count":"2",
               "pass_count":"2",
               "spam_count":"0",
               "virus_count":"0"
            }
         },
         {
            "label":"2015-01-02",
            "values":{
               "total_count":"1",
               "pass_count":"1",
               "spam_count":"0",
               "virus_count":"0"
            }
         }
      ],
      "total":{
         "statistics":{
            "total_count":"3",
            "pass_count":"3",
            "spam_count":"0",
            "virus_count":"0"
         },
         "totalTraffic":370368,
         "passedTraffic":370368,
         "savedTraffic":0
      }
   }
}
		

get-whitelistentries

Whitelist-Einträge abrufen

Request:

{
	"method": "get-whitelistentries",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
	        "domain": "example.org"
	}
}
		

Response:

{
    "result": "success",
    "params": {
        "entries": [
            {
                "id": "123456789",
                "from": "customer@domain.com",
                "to": "test@example.org",
                "created": "04.01.2021 15:38:17"
            }
        ]
    }
}
		

add-whitelistentry

Whitelist-Eintrag hinzufügen

Request:

{
	"method": "add-whitelistentry",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"from": "customer@domain.com",
		"to": "test@example.org"	
	}
}
		

Response:

{
    "result": "success",
    "params": []
}
		

delete-whitelistentry

Whitelist-Eintrag löschen

Request:

{
	"method": "delete-whitelistentry",
	"params": {
		"user_id": 12345,
		"api_token": "abcdefghijklmnopqrstuvwxyz123456789",
		"domain": "example.org",
		"id": 123456789
	}
}
		

Response:

{
    "result": "success",
    "params": []
}