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
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}}