Add a sync account using OAuth

Purpose 

This API is used to add a sync account in Mail360 using Oauth flow. Before adding an account via OAuth, connectors must be configured.

OAuth Scope

Use the scope

MailApps.accounts.ALL (or) MailApps.accounts.CREATE

ALL - Full access to the accounts.

CREATE - Add a new account through OAuth.

To generate Authtoken, refer here.

Request URL

Method: POST

https://mail360.zoho.com/api/accounts/oauth

Request Body (JSON object)

  • hintEmail* string
    • This is the email ID of the account to be added as a sync account.
  • displayName string
    • This is the short name to be used to identify the account.
  • mailProvider* string
    • This is the email provider name for which a connector is created.
  • rUrl* string
    • This is the URL to which redirection needs to be done after authentication.
  • gmailTypeSync  boolean
    • This parameter is applicable for Gmail accounts, determining the type of sync (based on labels).
    • The possible value can be
      • true - if sync should be based on labels.
      • false - if sync should not be based on labels
  • syncFromDate string
    • This is the timestamp value of the date from which the mail should be synced.
  • saveSentCopy integer
    • The value of this parameter determines whether to save a copy of sent mail in Mail360 storage or not.
    • The possible value can be
      • 0 - Do not save sent emails.
      • 1 - Save sent emails

 

* - Mandatory parameter

Sample request

Copiedcurl "https://mail360.zoho.com/api/accounts/oauth" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" \
-d '{
 "hintEmail":"tst@gmail.com",
 "mailProvider":"test",
 "rUrl":"https://app.login.callback/we232sas"
}'

Sample response

Copied{
  "status": {
    "code": 200,
    "description": "success"
  },
  "data": {
    "success": true,
    "url": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?prompt=select_account&access_type=offline&scope=https://outlook.office.com/IMAP.AccessAsUser.All+https://outlook.office.com/POP.AccessAsUser.All+https://outlook.office.com/SMTP.Send+https://outlook.office.com/User.Read+https://outlook.office.com/Mail.ReadWrite.Shared+offline_access&response_type=code&redirect_uri=https://****/v2/redirect&state=98686Mo80B5kb9Ru4cc0b87Me8T04RceqR0Jc00K4JSLdT6kdT0791f7Az3rfLk82vC67c19ET8b3cc880206A700rb8687Me66h6wkb877Xb8689Agi795c0Kx970fk0820MQKx6GcbS84Mee0630c9Of1r700B0w6lh919b6ll9wlTC02R0I670Fc06m1was8t1dG8J95rO8d0846uc94Tgc997i6y8e9b&client_id=f7831120-6686-44fe-9d71-7b69c756a58c&login_hint=*****@outlook.com"
  }
}