SMTP Configuration

The SMTP Configuration API allows you to set an Account’s SMTP connection settings which includes the custom URL, username and password and the port number that the Account will use when sending emails.

Fields

Tag Data Type Required Description
accountId Long No The id of the Account that owns this record.
id Auto-incremented Long Auto Unique Identifier
lastChangedDate Text Auto Auto-generated timestamp of the last change made to this record
Note:
Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z)
password Text Yes The password to be used by the configuration. If empty on POST or PUT, the old password will be retained.
port Integer Yes  The port number to be used by the configuration. 
tls Boolean No Indicates if TLS should be used or not
url Text Yes The URL to be used by the configuration.
username Text Yes The username to be used by the configuration

Create

API PATH: /api/v2/smtpConfiguration
METHOD: POST
EXAMPLE REQUEST:
{
  "url": "smtp.test.com",
  "port": 8080,
  "tls": true,
  "username": "smtp-user",
  "password": "smtp-password"
}
EXAMPLE RESPONSE:
{
  "url": "smtp.test.com",
  "port": 8080,
  "tls": true,
  "username": "smtp-user",
  "password": "smtp-password",
  "accountId": 1249229,
  "id": 4,
  "lastChangedDate": "2018-06-11T12:00:00.000Z"
}

Read

API PATH: /api/v2/smtpConfiguration
METHOD: GET
EXAMPLE RESPONSE:
{
  "url": "smtp.test.com",
  "port": 8080,
  "tls": true,
  "username": "smtp-user",
  "password": "smtp-password",
  "accountId": 1249229,
  "id": 4,
  "lastChangedDate": "2018-06-11T12:00:00.000Z"
}

Update

API PATH: /api/v2/smtpConfiguration
METHOD: PUT
EXAMPLE REQUEST:
{
  "url": "smtp.tester.com",
  "port": 8080,
  "tls": true,
  "username": "smtp-user",
  "password": "smtp-password",
  "id": 4
}
EXAMPLE RESPONSE:
{
  "url": "smtp.tester.com",
  "port": 8080,
  "tls": true,
  "username": "smtp-user",
  "password": "smtp-password",
  "accountId": 1249229,
  "id": 4,
  "lastChangedDate": "2018-06-11T12:00:00.000Z"
}

Delete

API PATH: /api/v2/smtpConfiguration/<id>
METHOD: DELETE

API error calls

ERROR MESSAGE POSSIBLE CAUSES
Host or URL is required POST or PUT error because there is no Host or URL provided
Port is required POST or PUT error because there is no Port provided
There is a problem with the provided SMTP Configuration. <error> POST or PUT error because validation and test connection using the SMTP Configuration failed