api-object-access

SMTP configuration

SMTP (Simple Mail Transfer Protocol) is used for any email functionality. Mojo Aware uses SMTP settings to notify users through email.

JSON Table

Attribute Data Type Description
policyCreatedAtLocId application/json ID of the location where policy is created. The value is of the type Location ID JSON.
policyType String A read-only field for internal use.
ipAddress String IP Address or the hostname of the SMTP server used by the system for
sending email alerts.
port int Port number of the SMTP server used by the system for sending e-mail
alerts.
emailAddress String Source address from which email alerts are sent.
authenticationInfo application/json
authenticationInfo/authenticationReqd boolean A true or false value indicating whether to enable or disable SMTP authentication.
authenticationInfo/username String Username for SMTP server authentication, when SMTP server authentication
is enabled.
authenticationInfo/password String Password for SMTP server authentication, when SMTP server authentication
is enabled.
certificateFileKeys List of private CA certificate file keys to be used for SMTP server
authentication
existingCertificatesInfo application/json
verifyCertficate boolean A true or false value indicating whether to verify SMTP server’s certificate
against built-in well-known CA certificates or uploaded CA certificate.
If set to true, an e-mail is not sent out if the certificate match fails.
startTLSMandatory boolean A true or false value indicating whether to

Copy Sample JSON
Sample JSON
{
    "policyCreatedAtLocId": {
        "type": "locallocationid",
        "id": 0
    },
    "policyType": "SMTP_POLICY",
    "ipAddress": "127.0.0.1",
    "port": 25,
    "emailAddress": "[email protected]",
    "authenticationInfo": {
        "authenticationReqd": false,
        "username": "",
        "password": ""
    },
    "certificateFileKeys": null,
    "existingCertificatesInfo": [],
    "verifyCertficate": false,
    "startTLSMandatory": false
}
API Calls

/V5/configuration/global/smtp

/V5/configuration/global/smtp

Get SMTP Configuration

Description The API is used to retrieve the SMTP settings configured for any email functionality.
Syntax
GET <Base_URL>/configuration/global/smtp?isDefault=<value>&nodeid=<value>

Here,

  • isDefault

    When we pass this parameter as true then system default configuration for that location is return else whatever user has defined is returned. It takes a boolean value. The default value is false.

  • nodeid

    A system-generated unique ID for the child server in a cluster environment. The value for this parameter will be same as that of the childId attribute in the Location JSON. It takes an integer value.

Sample code
GET https://training.mojonetworks.com/new/webservice/V5/configuration/global/smtp?isDefault=<true/false>&nodeid=0
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the SMTP configuration. The response is in the application/json format.

Save SMTP Configuration

Description The API is used to save or update SMTP configurations.
Syntax
PUTĀ  <Base_URL>/configuration/global/smtp?isDefault=<value>&to=<value>

Here,

  • isDefault

    When we pass this parameter as true then system default configuration for that location is return else whatever user has defined is returned. It takes a boolean value. The default value is false.

  • to

    It specifies the email address of the user to whom the notification email is to be sent. It takes String value. If email address not specified then it uses the email address specified while configuration

Sample code
PUT https://training.mojonetworks.com/new/webservice/V5/configuration/global/smtp?isDefault=<true/false>&[email protected]
Request Body This API call requires the details of the SMTP configurations to be updated, which is passed as parameters in the request body. The parameters are passed in the application/json format.

A sample request body is as follows:

{
	"policyCreatedAtLocId": {
		"type": "locallocationid",
		"id": 0
	},
	"policyType": "SMTP_POLICY",
	"ipAddress": "127.0.0.1",
	"port": 25,
	"emailAddress": "[email protected]",
	"authenticationReqd": false,
	"username": "",
	"password": "",
	"v6Enabled": false,
	"certificateFileKeys": null,
	"existingCertificatesInfo": null,
	"verifyCertficate": false,
	"startTLSMandatory": false
}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the updated SMTP configuration. The response is in the application/json format.

Put APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Post APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Delete APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Test APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.