The Zoho Mail API enables developers to integrate their applications with the Zoho Mail platform, allowing them access to a wide range of email and collaboration features. With the API, developers can build sophisticated email applications that manage mailing lists, send and receive automated emails, analyze customer data, manage customer accounts, and more.
The following are a few examples of what you can build using the Zoho Mail API:
Once you've connected your account, you can run your workflow and fetch data from the API. You can change any of the code associated with this step, changing the API endpoint you'd like to retrieve data from, or modifying the results in any way.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
zoho_mail: {
type: "app",
app: "zoho_mail",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://mail.${this.zoho_mail.$auth.base_api_uri}/api/accounts`,
headers: {
"Authorization": `Zoho-oauthtoken ${this.zoho_mail.$auth.oauth_access_token}`,
},
})
},
})
Zoho Mail uses OAuth authentication. When you connect your Zoho Mail account, Pipedream will open a popup window where you can sign into Zoho Mail and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Zoho Mail API.
Pipedream requests the following authorization scopes when you connect your account:
ZohoMail.accounts.read
ZohoMail.accounts.update
ZohoMail.organization.subscriptions.read
ZohoMail.organization.subscriptions.update
ZohoMail.organization.spam.read
ZohoMail.organization.accounts.read
ZohoMail.organization.accounts.create
ZohoMail.organization.accounts.update
ZohoMail.messages.create
ZohoMail.messages.read
ZohoMail.messages.update
ZohoMail.messages.delete
ZohoMail.attachments.create
ZohoMail.attachments.read
ZohoMail.attachments.update
ZohoMail.attachments.delete
ZohoMail.organization.groups.create
ZohoMail.organization.groups.read
ZohoMail.organization.groups.update
ZohoMail.organization.groups.delete
ZohoMail.tags.create
ZohoMail.tags.read
ZohoMail.tags.update
ZohoMail.tags.delete
ZohoMail.folders.create
ZohoMail.folders.read
ZohoMail.folders.update
ZohoMail.folders.delete
ZohoMail.organization.domains.create
ZohoMail.organization.domains.read
ZohoMail.organization.domains.update
ZohoMail.organization.domains.delete
ZohoMail.tasks.create
ZohoMail.tasks.read
ZohoMail.notes.all
GET
https://accounts.{{custom_fields.base_api_uri}}/oauth/v2/auth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
prompt=consent
&
access_type=offline
POST
https://accounts.{{custom_fields.base_api_uri}}/oauth/v2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://accounts.{{custom_fields.base_api_uri}}/oauth/v2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}