Update a sync account using OAuth
Purpose
This API allows you to update a sync account in Mail360 using the OAuth flow.
OAuth Scope
Use the scope
MailApps.accounts.ALL (or) MailApps.accounts.UPDATE
ALL - Full access to the accounts.
UPDATE - Update an account through OAuth.
To generate Authtoken, refer here.
Request URL
Method: PUT
https://mail360.zoho.com/api/accounts/{account_key}/oauth
Path Parameters
- account_key* string
- This is the unique key identifying the account, generated during account addition.
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 used to identify the account.
- mailProvider* string
- This is the email provider name for which a connector is created.
- rUrl* string
- This is the redirect URL after successful authentication.
- gmailTypeSync boolean
- This parameter is applicable for Gmail accounts, determining the type of sync (based on labels).
- The possible value can be
- true - sync based on labels.
- false - sync not based on labels
- syncFromDate string
- This is the timestamp from which emails should be synced.
- saveSentCopy integer
- This parameter specifies if sent emails should be saved in Mail360 storage.
- 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/N7A**C0CM/oauth" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *********" \
-d '{
"hintEmail": "rebecca@gmail.com",
"mailProvider": "gmail",
"rUrl": "https://mail360.zoho.com/api/connectors"
}'
Sample Response
Copied{
"status": {
"code": 200,
"description": "success"
},
"data": {
"success": true,
"url": "https://accounts.google.com/o/oauth2/auth?prompt=consent&access_type=offline&scope=https://mail.google.com/+https://www.googleapis.com/auth/userinfo.email&response_type=code&redirect_uri=https://mail360.zoho.com/api/connectors&state=98696B0M875GaMuK6w0KyR17e8Tc2tf7KE3Gdk686MB0Lx6MkB880Cx7870sM0064y7ls71cdlw00kb89W9NGux97Ob8687Me66h6wkb877Xfk7f4Gcu9B70dB8m8mby7L5qb70l4ab6j85tdtsV43O7701b6FS86Gc00834x79h8egKx677J87i1i807t6Mc8o84M0b6n6M0Fn70mI69N6hlTT69wc0K041cfC76ds7787PB8874vNvLF43d0c94Tgc896M97u5I&client_id=642802249120-601pq29qbct64rqca6po4o32isk96lea.apps.googleusercontent.com&login_hint=rebecca@gmail.com"
}
}