Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
REST API Version 17.0 References
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

POST /system/email_servers

date_range 24-May-22

SUMMARY Creates a new email server.

Table 1: POST /system/email_servers resource details:

POST /system/email_servers resource details

MIME Type

application/json

Table 2: POST /system/email_servers request body details:

POST /system/email_servers request body details

Parameter Data Type MIME Type Description Sample

email_server_details

Object

application/json

Required - An email server details record that contains the following fields:
  • description - String - Description identifying the email server.
  • hostname - String - Hostname of the email server.
  • port - Number - Port to connect to the email server with.
  • username - String - User name to authenticate with the email server.
  • password - String - Password to authenticate with the email server.
  • enable_tls - Boolean - Whether to ignore TLS verification errors to the email server.

{ "default": true, "description": "String", "enable_tls": true, "hostname": "String", "password": "String", "port": 42, "username": "String" }

Table 3: POST /system/email_servers response codes:

POST /system/email_servers response codes

HTTP Response Code Unique Code Description

201

The email server record was created.

409

4011

An email server with the same hostname, port and username already exists.

422

4000

The required field hostname was not given.

422

4001

The hostname is an IP address.

422

4002

The hostname cannot be longer than 255 characters.

422

4003

The username cannot be longer than 255 characters.

422

4004

The password cannot be longer than 255 characters.

422

4005

Problem encountered while encrypting email server password.

422

4006

Port must be bewtween 1 and 65535 inclusive.

422

4007

The default value can only be set to true.

422

4010

The description cannot be longer than 255 characters.

422

4014

The username cannot contain spaces or quotes.

422

4015

Username or password not given while creating either field for email server.

422

4016

null

500

4008

Problem encountered while updating default email server database entry.

500

4009

Problem encountered while attempting to read the default email server from the database.

500

4012

Problem encountered while creating new EmailServer database entry.

500

4013

Problem encountered while attempting to read the database.

Response Description

The created email server record that contains the following fields:
  • id - Number - ID of the email server.
  • description - String - Description identifying the email server.
  • hostname - String - Hostname of the email server.
  • port - Number - Port to connect to the email server with.
  • username - String - User name to authenticate with the email server.
  • password - String - Password to authenticate with the email server.
  • enable_tls - Boolean - Whether to ignore TLS verification errors to the email server.

Response Sample

content_copy zoom_out_map
{
    "default": true,
    "description": "String",
    "enable_tls": true,
    "hostname": "String",
    "id": 42,
    "password": "String",
    "port": 42,
    "username": "String"
}
footer-navigation