PUT - Add Send Mail Details

Purpose

This API is used to add send mail details such as the display name and the email address of the user. This can be done by the admin for a user or by the user for themselves.

OAuth Scope

Use the scope

Using admin authentication:

ZohoMail.organization.accounts.ALL (or) ZohoMail.organization.accounts.UPDATE

Using user authentication:

ZohoMail.accounts.ALL (or) ZohoMail.accounts.UPDATE

to generate the Authtoken.

ALL - Grants full access to user accounts.

UPDATE - Grants access to update account information.

Request URL

Method: PUT

Using admin authentication:

https://mail.zoho.com/api/organization/{zoid}/accounts/{accountId}

Using user authentication:

https://mail.zoho.com/api/accounts/{accountId}

Path Parameters

  • zoid long
    • This parameter denotes the unique Zoho Organization Identifier for the organization.
    • This parameter can be retrieved from the Get Organization Details API.
    • This parameter is mandatory while using admin authentication. 
  • accountId* long
    • This parameter is used to identify the account whose details are retrieved.
    • This parameter can be retrieved from the Get User Account Details API.

 

Request Body ( JSON Object)

  • zuid long
    • This denotes the unique Zoho User Identifier for the user.
    • This parameter can be fetched from the Get All Org User Details API.
    • This parameter is mandatory while using admin authentication. 
  • mode* string
    • This parameter represents the type of operation that is to be performed.
    • Provide the value as addsendmaildetails.
  • sendMailDetails* JSON object

    This JSON object contains the following sendMailDetails fields/members:

    • fromAddress string
      • This parameter specifies the email address to be updated as the default email of the user.
    • displayName* string
      • This parameter specifies the name that has to be updated has displayName for the given email address.
    • mode* string
      • This parameter specifies the mode of the from email address added to the account.
      • The possible values can be:
        • extmailbox
        • extfrom
    • serverName string
      • Specify the SMTP Server name, if the mode is set to extfrom, an external From address.
    • serverPortstring
      • Specify the port number in which the SMTP server should be connected.
    • userNamestring
      • Specify the user name of the account which is set as the From Address, to connect to the SMTP server.
    • passwordstring
      • Specify the password corresponding to the account used to connect to the SMTP Server.
    • smtpConnection string
      • Specifies the type of SMTP connection to attempt when connecting to the provided server.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request (Using Admin Authentication)

Copiedcurl "https://mail.zoho.com/api/organization/12345678/accounts/2560636000000008002" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****"
-d '{
"zuid": 11111111,
"mode": "addsendmaildetails",
"sendMailDetails": [
{
"fromAddress": "rebecca@zylker.com",
"displayName": "Rebecca",
"mode": "extfrom",
"serverPort": "465",
"serverName": "mail.zoho.com",
"userName": "rebecca@zylker.com",
"password": "Smknel@88",
"smtpConnection": "plain"
}
]
}'

Sample Request (Using User Authentication)

Copiedcurl "https://mail.zoho.com/api/accounts/2560636000000008002" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****"
-d '{
"mode": "addsendmaildetails",
"sendMailDetails": [
{
"fromAddress": "rebecca@zylker.com",
"displayName": "Rebecca",
"mode": "extfrom",
"serverPort": "465",
"serverName": "mail.zoho.com",
"userName": "rebecca@zylker.com",
"password": "Smknel@88",
"smtpConnection": "plain"
}
]
}'

Sample Response

Copied{
"status": {
"code": 200,
"description": "success"
}
}