### Sample Request to Get Drafts - cURL Source: https://www.zoho.com/mail360/help/api/get-all-drafts This cURL command demonstrates how to make a GET request to the Zoho Mail360 API to retrieve drafts. It includes necessary headers for authentication and content type. The endpoint requires an account key and supports query parameters for pagination and sorting. ```curl curl "https://mail360.zoho.com/api/accounts/{account_key}/drafts" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken ***" \ ``` -------------------------------- ### Sample GET Request for Zoho Mail360 Accounts Source: https://www.zoho.com/mail360/help/api/get-all-accounts This cURL command demonstrates how to make a GET request to the Zoho Mail360 API to retrieve account information. It requires the Authorization header with a Zoho OAuth token and specifies JSON as the expected response format. Ensure you replace '***' with your actual OAuth token. ```bash curl "https://mail360.zoho.com/api/accounts" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken ***" ``` -------------------------------- ### Get All Folders Source: https://www.zoho.com/mail360/help/api/get-all-folders-api Retrieves a list of all folders within a mailbox, including those created or imported. ```APIDOC ## GET /folders ### Description This API is used to list all the folders created in or imported to the mailbox. ### Method GET ### Endpoint /folders ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the mailbox. ### Request Example ```json { "message": "Example request not provided for GET /folders" } ``` ### Response #### Success Response (200) - **data** (array) - List of folders. - **folderId** (string) - The ID of the folder. - **folderName** (string) - The name of the folder. - **type** (string) - The type of folder (e.g., "custom", "system"). - **unreadCount** (integer) - The number of unread messages in the folder. #### Response Example ```json { "data": [ { "folderId": "12345", "folderName": "Inbox", "type": "system", "unreadCount": 10 }, { "folderId": "67890", "folderName": "Sent Mail", "type": "system", "unreadCount": 0 } ], "message": "Folders listed successfully." } ``` ``` -------------------------------- ### GET /api/accounts/{account_key}/templates Source: https://www.zoho.com/mail360/help/api/get-all-templates-api Retrieves a list of email templates for a given account. Supports pagination, sorting, and filtering by view. ```APIDOC ## GET /api/accounts/{account_key}/templates ### Description Retrieves a list of email templates associated with a specific account. This endpoint allows for flexible retrieval of templates by supporting query parameters for pagination, sorting, and viewing counts. ### Method GET ### Endpoint https://mail360.zoho.com/api/accounts/{account_key}/templates ### Parameters #### Path Parameters - **account_key** (string) - Required - A unique key identifying the account. Generated during account addition and can be fetched using the Get All Accounts API. #### Query Parameters - **start** (int) - Optional - Specifies the starting sequence number for retrieving templates. Defaults to 0. - **limit** (int) - Optional - Specifies the number of templates to retrieve from the `start` value. Must be between 1 and 100. Defaults to 25. - **sortorder** (boolean) - Optional - Specifies the sort order. `true` for ascending, `false` for descending. Defaults to `false`. - **sortBy** (string) - Optional - Specifies the basis for sorting. Possible values: `date`, `messageId`, `size`. Defaults to `date`. - **view** (string) - Optional - If set to `count`, this parameter displays the total number of templates in the account. ### Request Example ``` curl "https://mail360.zoho.com/api/accounts/N7A**0CM/templates" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Zoho-oauthtoken ***" ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the response. - **code** (integer) - The HTTP status code. - **description** (string) - A message indicating the status of the request. - **data** (array) - An array of template objects. - **fromAddress** (string) - The sender's email address. - **toAddress** (string) - The recipient's email address. - **ccAddress** (string) - The CC recipient's email address. - **bccAddress** (string) - The BCC recipient's email address. - **templateId** (string) - The unique identifier for the template. - **folderId** (string) - The identifier for the folder the template belongs to. - **sender** (string) - The sender's email address. - **summary** (string) - A summary of the template content. - **status** (string) - The status of the template. - **subject** (string) - The subject line of the template. - **size** (string) - The size of the template. - **receivedTime** (string) - The time the template was received. - **sentDateInGMT** (string) - The date and time the template was sent in GMT. - **flagid** (string) - Identifier for any flags associated with the template. - **hasAttachment** (integer) - Indicates if the template has an attachment (0 for no, 1 for yes). #### Response Example ```json { "status": { "code": 200, "description": "success" }, "data": [ { "fromAddress": "rebecca@zylker.com", "toAddress": "", "ccAddress": "", "bccAddress": "", "templateId": "1674632567383110001", "folderId": "23450000000006001", "sender": "kavyamail360.1@gmail.com", "summary": "", "status": "1", "subject": "new Mail testing", "size": "281", "receivedTime": "1674632566998", "sentDateInGMT": "1674612766000", "flagid": "flag_not_set", "hasAttachment": 0 } ] } ``` ``` -------------------------------- ### Get All Threads Source: https://www.zoho.com/mail360/help/api/get-all-threads This API is used to list all the threads in an account. ```APIDOC ## GET /websites/zoho_mail360_help_api/threads ### Description This API is used to list all the threads in an account. ### Method GET ### Endpoint /websites/zoho_mail360_help_api/threads ### Parameters #### Query Parameters ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **threads** (array) - A list of all threads in the account. #### Response Example ```json { "threads": [ { "threadId": "12345", "subject": "Meeting Tomorrow", "lastMessageTimestamp": "2023-10-27T10:00:00Z" }, { "threadId": "67890", "subject": "Project Update", "lastMessageTimestamp": "2023-10-27T09:30:00Z" } ] } ``` ``` -------------------------------- ### Get All Templates Source: https://www.zoho.com/mail360/help/api/get-all-templates-api Retrieve all templates associated with a given account using the Zoho Mail360 API. ```APIDOC ## GET /websites/zoho_mail360_help_api/templates ### Description Use this API to retrieve all the templates associated with a given account. ### Method GET ### Endpoint /websites/zoho_mail360_help_api/templates ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **templates** (array) - A list of template objects, each containing details about a template. #### Response Example ```json { "templates": [ { "id": "template_123", "name": "Welcome Email", "subject": "Welcome to Zoho Mail360!", "body": "

Welcome!

Thank you for joining Zoho Mail360.

" }, { "id": "template_456", "name": "Password Reset", "subject": "Reset Your Password", "body": "

Click here to reset your password.

" } ] } ``` ``` -------------------------------- ### GET /api/accounts/{account_key}/folders Source: https://www.zoho.com/mail360/help/api/get-all-folders-api Fetches all the folders associated with a specific account key. This endpoint requires appropriate OAuth scopes and an authtoken for authorization. ```APIDOC ## GET /api/accounts/{account_key}/folders ### Description Fetches all the folders associated with a specific account key. This endpoint requires appropriate OAuth scopes and an authtoken for authorization. ### Method GET ### Endpoint https://mail360.zoho.com/api/accounts/{account_key}/folders ### Parameters #### Path Parameters - **account_key** (string) - Required - This key is used to identify the mailbox from which the data has to be fetched. It is generated during account addition. ### Request Example ```json { "example": "curl \"https://mail360.zoho.com/api/accounts/N7A**0CM/folders\" \ -X GET \ -H \"Accept: application/json\" \ -H \"Content-Type: application/json\" \ -H \"Authorization:Zoho-oauthtoken ***\"" } ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the response. - **code** (integer) - The HTTP status code. - **description** (string) - A brief description of the status. - **data** (array) - An array of folder objects. - **path** (string) - The path of the folder. - **isArchived** (integer) - Indicates if the folder is archived. - **folderName** (string) - The name of the folder. - **folderType** (string) - The type of the folder. - **folderId** (string) - The unique identifier for the folder. #### Response Example ```json { "status": { "code": 200, "description": "success" }, "data": [ { "path": "/Outbox", "isArchived": 0, "folderName": "Outbox", "folderType": "Outbox", "folderId": "2452000000002035" }, { "path": "/Drafts", "previousFolderId": "2452000000002051", "isArchived": 0, "folderName": "Drafts", "folderType": "Drafts", "folderId": "2452000000002037" } ] } ``` #### Failure Response (500) ```json { "status": { "code": 500, "description": "Oops! Something went wrong. Try again later" }, "data": {} } ``` ``` -------------------------------- ### Get All Accounts Source: https://www.zoho.com/mail360/help/api/get-all-accounts Retrieves a list of all accounts that have been added to Zoho Mail360. ```APIDOC ## GET /accounts ### Description This API is used to list all the accounts added in Mail360. ### Method GET ### Endpoint /accounts ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **accounts** (array) - A list of account objects. - **accountId** (string) - The unique identifier for the account. - **accountName** (string) - The name of the account. #### Response Example ```json { "accounts": [ { "accountId": "12345", "accountName": "Example Account 1" }, { "accountId": "67890", "accountName": "Example Account 2" } ] } ``` ``` -------------------------------- ### Fetch Labels using cURL Source: https://www.zoho.com/mail360/help/api/get-all-labels This snippet demonstrates how to fetch all labels for a given account using a cURL command. It requires an Authorization header with a Zoho OAuth token and specifies the request method as GET. The account_key is a path parameter identifying the specific mailbox. ```curl curl "https://mail360.zoho.com/api/accounts/x7k**EB00s/labels" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken 80243**b4ac3" \ ``` -------------------------------- ### Email Thread API Source: https://www.zoho.com/mail360/help/api/get-all-threads This section details the API endpoints for retrieving email threads and their associated messages. It includes examples of successful and failure responses. ```APIDOC ## GET /websites/zoho_mail360_help_api ### Description Retrieves a list of email threads and their associated messages. This endpoint can return a list of messages within a thread or a specific thread's details. ### Method GET ### Endpoint /websites/zoho_mail360_help_api ### Query Parameters - **folderId** (string) - Required - The ID of the folder to retrieve threads from. - **threadId** (string) - Optional - The ID of a specific thread to retrieve. ### Response #### Success Response (200) - **status** (object) - **code** (integer) - The HTTP status code. - **description** (string) - A description of the status. - **data** (array) - An array of email thread objects. - **fromAddress** (string) - The sender's email address. - **messageId** (string) - The unique identifier for the message. - **folderId** (string) - The ID of the folder the message belongs to. - **sender** (string) - The name of the sender. - **summary** (string) - A summary of the message content. - **status** (string) - The status of the message (e.g., '0' for read, '1' for unread). - **subject** (string) - The subject of the email. - **size** (integer) - The size of the message in bytes. - **hasAttachment** (integer) - Indicates if the message has an attachment (0 for no, 1 for yes). - **threadCount** (integer) - The number of messages in the thread. - **receivedTime** (string) - The timestamp when the message was received. - **toAddress** (string) - The recipient's email address. - **ccAddress** (string) - The CC recipient's email address. - **threadId** (string) - The identifier for the email thread. - **sentDateInGMT** (string) - The timestamp when the message was sent in GMT. - **flagid** (string) - The flag status of the message. #### Response Example (Success) ```json { "status": { "code": 200, "description": "success" }, "data": [ { "fromAddress": "rebecca@zylker.com", "messageId": "1676442580425110003", "folderId": "24803000000003009", "sender": "Rebecca", "summary": "4 From: Rebecca <rebecca@zylker.com> Sent: 07 February 2023 16:02 To: Rebecca <rebecca@zylker.com> Subject: Re: Threads 3 From: Rebecca <rebecca@zylker.com> Sent: 07 February 2023 16:02 To: Rebecca &l", "status": "0", "subject": "Re: Threads", "size": 3632, "hasAttachment": 0, "threadCount": 0, "receivedTime": "1675765984000", "toAddress": ""Rebecca"<rebecca@zylker.com>", "ccAddress": "Not Provided", "threadId": "1676442580425110003", "sentDateInGMT": "1675746184000", "flagid": "flag_not_set" } ] } ``` #### Error Response (500) - **status** (object) - **code** (integer) - The HTTP status code. - **description** (string) - A description of the error. - **data** (object) - **moreInfo** (string) - Additional information about the error. #### Response Example (Failure) ```json { "status": { "code": 500, "description": "Internal Error" }, "data": { "moreInfo": "Internal Error" } } ``` ``` -------------------------------- ### GET /api/accounts/{account_key}/labels Source: https://www.zoho.com/mail360/help/api/get-all-labels Fetches all labels (tags) associated with a specific mail account. ```APIDOC ## GET /api/accounts/{account_key}/labels ### Description Fetches all labels (tags) associated with a specific mail account. This endpoint requires an `account_key` to identify the target mailbox. ### Method GET ### Endpoint https://mail360.zoho.com/api/accounts/{account_key}/labels ### Parameters #### Path Parameters - **account_key** (string) - Required - The key used to identify the mailbox. This can be fetched from the Get all accounts API. #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "curl \"https://mail360.zoho.com/api/accounts/x7k**EB00s/labels\" \ -X GET \ -H \"Accept: application/json\" \ -H \"Content-Type: application/json\" \ -H \"Authorization:Zoho-oauthtoken 80243**b4ac3\" \ " } ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the response. - **code** (integer) - The HTTP status code. - **description** (string) - A brief description of the status. - **data** (array) - An array of label objects. - **labelId** (string) - The unique identifier for the label. - **displayName** (string) - The name of the label. - **color** (string) - The color associated with the label (hex format). - **sequence** (integer) - The display order of the label. #### Response Example ```json { "status": { "code": 200, "description": "success" }, "data": [ { "labelId": "27684000000021003", "displayName": "L1", "color": "#FFD700", "sequence": 1 }, { "labelId": "27684000000021006", "displayName": "L3", "color": "#0000FF", "sequence": 2 } ] } ``` ``` -------------------------------- ### OAuth Scope and Account Update API Source: https://www.zoho.com/mail360/help/api/update-sync-account This section details the required OAuth scopes for accessing Mail360 account functionalities and provides documentation for the endpoint used to update an account through OAuth. ```APIDOC ## OAuth Scope Use one of the following scopes: - `MailApps.accounts.ALL`: Provides full access to accounts. - `MailApps.accounts.UPDATE`: Allows updating an account through OAuth. Refer to the [documentation](link_to_authtoken_generation) for generating an AuthToken. ## PUT /api/accounts/{account_key}/oauth ### Description This endpoint is used to update an existing account's OAuth configuration in Mail360. It requires the account's unique key and a JSON request body containing updated account details and authentication information. ### Method PUT ### Endpoint `https://mail360.zoho.com/api/accounts/{account_key}/oauth` ### Parameters #### Path Parameters - **account_key*** (string) - Required - The unique key identifying the account, generated during account addition. #### Request Body - **hintEmail*** (string) - Required - The email ID of the account to be added as a sync account. - **displayName** (string) - Optional - A short name used to identify the account. - **mailProvider*** (string) - Required - The email provider name for which a connector is created (e.g., "gmail"). - **rUrl*** (string) - Required - The redirect URL after successful authentication. - **gmailTypeSync** (boolean) - Optional - Applicable for Gmail accounts, determines the type of sync. - `true`: sync based on labels. - `false`: sync not based on labels. - **syncFromDate** (string) - Optional - The timestamp from which emails should be synced. - **saveSentCopy** (integer) - Optional - Specifies if sent emails should be saved in Mail360 storage. - `0`: Do not save sent emails. - `1`: Save sent emails. ### Request Example ```json { "hintEmail": "rebecca@gmail.com", "mailProvider": "gmail", "rUrl": "https://mail360.zoho.com/api/connectors" } ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the response. - **code** (integer) - The HTTP status code (e.g., 200). - **description** (string) - A brief description of the status (e.g., "success"). - **data** (object) - Contains the result of the operation. - **success** (boolean) - Indicates if the operation was successful. - **url** (string) - An OAuth authorization URL if required for completing the process. #### Response Example ```json { "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" } } ``` ``` -------------------------------- ### Sample JSON Response for Get Draft Source: https://www.zoho.com/mail360/help/api/get-specific-draft This is a sample JSON response received after successfully retrieving a draft using the Zoho Mail360 API. It contains the status of the request and the detailed data of the draft, including sender, recipient, subject, and other relevant information. ```json { "status": { "code": 200, "description": "success" }, "data": { "fromAddress": "rebecca1@zylker.com", "toAddress": "", "ccAddress": "", "bccAddress": "", "draftId": "1674571936262110001", "folderId": "23450000000003003", "sender": "rebecca1@zylker.com", "summary": "", "status": "1", "subject": "new Mail testing", "size": "293", "receivedTime": "1674572433997", "sentDateInGMT": "1674552633000", "flagid": "flag_not_set", "hasAttachment": 0 } } ``` -------------------------------- ### Get Attachment Details - cURL Request Source: https://www.zoho.com/mail360/help/api/download-attachment-using-attachid Sample cURL command to fetch a specific attachment from Zoho Mail360. It includes the request URL with path parameters and necessary headers for authorization and content type. ```curl "https://mail360.zoho.com/api/accounts/x7**B00s/messages/16*0001/attachments/138**10" \ -X GET \ -H "Accept: application/octet-stream" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken 8**b64f" \ ``` -------------------------------- ### Retrieve Messages using cURL Source: https://www.zoho.com/mail360/help/api/list-emails-messages-api This cURL command demonstrates how to fetch messages from a Zoho Mail360 account. It utilizes GET method, specifies the account key, and includes query parameters for folder ID and authorization. The Authorization header requires a Zoho-oauthtoken. ```curl curl "https://mail360.zoho.com/api/accounts/Gcc**CM/messages?folderId=293**002014" \ -X GET \ -H "Accept: application/json" \ -H "Authorization:Zoho-oauthtoken ***" ``` -------------------------------- ### Set Message Flags using cURL Source: https://www.zoho.com/mail360/help/api/flag-emails Example cURL request to set flags on email messages using the Zoho Mail360 API. This demonstrates the PUT method, endpoint, headers, and JSON payload for specifying the mode, message IDs, and flag ID. ```bash curl "https://mail360.zoho.com/api/accounts/{account_key}/messages" \ -X PUT \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken " \ -d '{ "mode" :"setFlag", "messageId":[,], "flagid":"info" }' ``` -------------------------------- ### Create Folder API Source: https://www.zoho.com/mail360/help/api/create-a-folder-api This API is used to create a new folder in the mailbox. ```APIDOC ## POST /api/folders ### Description This API is used to create a new folder in the mailbox. ### Method POST ### Endpoint /api/folders ### Parameters #### Request Body - **folderName** (string) - Required - The name of the folder to be created. - **parentFolderId** (string) - Optional - The ID of the parent folder. If not provided, the folder will be created at the root level. ### Request Example ```json { "folderName": "New Support Folder", "parentFolderId": "12345abcde" } ``` ### Response #### Success Response (201 Created) - **folderId** (string) - The ID of the newly created folder. - **message** (string) - A confirmation message. #### Response Example ```json { "folderId": "67890fghij", "message": "Folder created successfully." } ``` #### Error Response (400 Bad Request) - **error** (string) - Description of the error. #### Error Response Example ```json { "error": "Folder name cannot be empty." } ``` ``` -------------------------------- ### GET /api/accounts/{account_key}/drafts Source: https://www.zoho.com/mail360/help/api/get-all-drafts Retrieves a list of drafts from a specified account. Supports pagination, sorting, and filtering. ```APIDOC ## GET /api/accounts/{account_key}/drafts ### Description Retrieves a list of drafts from a specified account. This endpoint allows for fetching drafts with options for pagination, sorting, and filtering. ### Method GET ### Endpoint https://mail360.zoho.com/api/accounts/{account_key}/drafts ### Parameters #### Path Parameters - **account_key** (string) - Required - A unique key identifying the account from which drafts will be retrieved. This key is generated during account addition and can be fetched using the Get All Accounts API. #### Query Parameters - **start** (int) - Optional - The starting sequence number of the drafts to be retrieved. Defaults to 0. - **limit** (int) - Optional - The number of drafts to retrieve from the specified start value. Must be between 1 and 100. Defaults to 25. - **sortorder** (boolean) - Optional - Specifies the sort order of the retrieved list. `true` for ascending, `false` for descending. Defaults to false. - **sortBy** (string) - Optional - Specifies the basis for sorting the list of emails. Possible values: `date`, `messageId`, `size`. Defaults to `date`. ### Request Example ```curl curl "https://mail360.zoho.com/api/accounts/N7A**0CM/drafts" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Zoho-oauthtoken ***" ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the response. - **code** (int) - The HTTP status code. - **description** (string) - A brief description of the status. - **data** (array) - An array of draft objects. - **fromAddress** (string) - The sender's email address. - **toAddress** (string) - The recipient's email address. - **ccAddress** (string) - The CC recipient's email address. - **bccAddress** (string) - The BCC recipient's email address. - **draftId** (string) - The unique identifier for the draft. - **folderId** (string) - The identifier for the folder containing the draft. - **sender** (string) - The name of the sender. - **summary** (string) - A summary of the draft content. - **status** (string) - The status of the draft. - **subject** (string) - The subject line of the draft. - **size** (string) - The size of the draft in bytes. - **receivedTime** (string) - The time the draft was received. - **sentDateInGMT** (string) - The sent date in GMT. - **flagid** (string) - The flag ID associated with the draft. - **hasAttachment** (integer) - Indicates if the draft has an attachment (0 for no, 1 for yes). #### Response Example ```json { "status": { "code": 200, "description": "success" }, "data": [ { "fromAddress": "rebecca1@zylker.com", "toAddress": "", "ccAddress": "", "bccAddress": "", "draftId": "1674571936262110001", "folderId": "23450000000003003", "sender": "rebecca1@zylker.com", "summary": "", "status": "1", "subject": "new Mail testing", "size": "293", "receivedTime": "1674572433997", "sentDateInGMT": "1674552633000", "flagid": "flag_not_set", "hasAttachment": 0 }, { "fromAddress": "rebecca1@zylker.com", "ccAddress": "Not Provided", "draftId": "1674561051116110001", "folderId": "23450000000003003", "sender": "rebecca1", "summary": "testing draft", "status": "1", "subject": "test", "size": "240", "receivedTime": "1657717062000", "sentDateInGMT": "1657697262000", "flagid": "flag_not_set", "hasAttachment": 0 } ] } ``` ``` -------------------------------- ### Enable Account Source: https://www.zoho.com/mail360/help/api/enable-account Enables an existing Zoho Mail360 account using its account key. ```APIDOC ## PUT /api/accounts/{account_key} ### Description This endpoint enables an existing Zoho Mail360 account. It requires the account's unique key and a request body specifying the operation mode. ### Method PUT ### Endpoint https://mail360.zoho.com/api/accounts/{account_key} ### Parameters #### Path Parameters - **account_key** (string) - Required - This key is used to identify the account. It is generated during account addition. #### Request Body - **mode** (string) - Required - This parameter represents the type of operation that is to be performed. Provide the value as "enableAccount". ### Request Example ```json { "mode": "enableAccount" } ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the operation. - **code** (integer) - The HTTP status code (e.g., 200). - **description** (string) - A brief description of the status (e.g., "success"). #### Response Example ```json { "status": { "code": 200, "description": "success" } } ``` ``` -------------------------------- ### GET /api/accounts/{account_key}/folders/{folderId} Source: https://www.zoho.com/mail360/help/api/get-specific-folder-api Retrieves details of a specific folder within a given account. Requires appropriate OAuth scope for folder access. ```APIDOC ## GET /api/accounts/{account_key}/folders/{folderId} ### Description Retrieves details of a specific folder within a given account. Requires appropriate OAuth scope for folder access. ### Method GET ### Endpoint https://mail360.zoho.com/api/accounts/{account_key}/folders/{folderId} ### Parameters #### Path Parameters - **account_key** (string) - Required - This key is used to identify the mailbox from which the data has to be fetched. It is generated during account addition. This parameter can be fetched from the Get all accounts API. - **folderId** (long) - Required - This parameter refers to the ID of the folder which needs to be retrieved. This parameter can be fetched from the Get all folders API. ### Request Example ```curl curl "https://mail360.zoho.com/api/accounts/N7***C0CM/folders/23567***005" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Zoho-oauthtoken ***" ``` ### Response #### Success Response (200) - **status** (object) - Contains the status code and description of the operation. - **code** (integer) - The HTTP status code. - **description** (string) - A brief description of the status. - **data** (object) - Contains the details of the retrieved folder. - **path** (string) - The hierarchical path of the folder. - **previousFolderId** (string) - The ID of the parent folder. - **folderName** (string) - The name of the folder. - **folderType** (string) - The type of the folder (e.g., Inbox, Sent). - **folderId** (string) - The unique identifier for the folder. #### Response Example ```json { "status": { "code": 200, "description": "success" }, "data": { "path": "/Label_3361509959031163224", "previousFolderId": "27684000000003001", "folderName": "Label_3361509959031163224", "folderType": "Inbox", "folderId": "27684000000003005" } } ``` ``` -------------------------------- ### Zoho Mail360 API: GET Request to Retrieve Threads (cURL) Source: https://www.zoho.com/mail360/help/api/get-threads This cURL command demonstrates how to make a GET request to the Zoho Mail360 API to retrieve email threads. It includes necessary headers like Authorization, Accept, and Content-Type. ```curl curl "https://mail360.zoho.com/api/accounts/N7A**0CM/threads/167594940852211****" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken ***" \ ``` -------------------------------- ### Create Label API Source: https://www.zoho.com/mail360/help/api/create-a-label This API is used to create a new label within the mailbox. ```APIDOC ## POST /api/labels ### Description This API is used to create a new label within the mailbox. ### Method POST ### Endpoint /api/labels ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the new label. ### Request Example { "name": "My New Label" } ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the newly created label. - **name** (string) - The name of the label. #### Response Example { "id": "label_12345", "name": "My New Label" } ``` -------------------------------- ### cURL Request to Get Draft Source: https://www.zoho.com/mail360/help/api/get-specific-draft This cURL command demonstrates how to make a GET request to retrieve a specific draft from Zoho Mail360. It includes necessary headers for authorization and content type. Ensure you replace placeholder values with your actual account key, draft ID, and authorization token. ```curl curl "https://mail360.zoho.com/api/accounts/N7A**0CM/drafts/167594940852211****" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken ***" \ ``` -------------------------------- ### OAuth Overview Source: https://www.zoho.com/mail360/help/api/oauth Explains the OAuth flow for accessing Mail360 data using access tokens obtained from refresh tokens. ```APIDOC ## OAuth Overview When using OAuth, the client can access the required data using access tokens, without using the user credentials directly. These tokens contain information about the scope of the access, duration of the access and so on. This token is issued by the authorization server after verifying that the request has been made by a legitimate party. The client can then use this token to access the data they need using APIs. ### Process: 1. The application owner signs up for a Mail360 account. 2. The owner generates Client ID and Client Secret. 3. The owner generates a refresh token for specific scopes. 4. Access tokens are generated in Mail360's REST API based on these Refresh tokens. 5. Access tokens have an expiry period and need to be regenerated. ``` -------------------------------- ### Fetch Mailbox Folders using cURL Source: https://www.zoho.com/mail360/help/api/get-all-folders-api This snippet demonstrates how to fetch mailbox folders using a cURL command. It includes the necessary authorization headers and specifies the GET request to the Mail360 API endpoint. Ensure you replace 'N7A**0CM' with a valid account key and '***' with a valid authorization token. ```bash curl "https://mail360.zoho.com/api/accounts/N7A**0CM/folders" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken ***" \ ``` -------------------------------- ### Fetch Folder Details using cURL Source: https://www.zoho.com/mail360/help/api/get-specific-folder-api This snippet demonstrates how to fetch details of a specific folder using a GET request with cURL. It requires authorization with a Zoho OAuth token and specifies the account and folder IDs as path parameters. The response includes the folder's status and data. ```curl curl "https://mail360.zoho.com/api/accounts/N7***C0CM/folders/23567***005" \ -X GET \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization:Zoho-oauthtoken ***" ``` -------------------------------- ### Zoho Mail360 API OAuth - Sample cURL Request Source: https://www.zoho.com/mail360/help/api/add-sync-account-api This cURL command demonstrates how to make a POST request to the Zoho Mail360 API for OAuth authentication. It includes essential headers like Accept, Content-Type, and Authorization, along with a sample JSON payload containing required parameters for adding a sync account. Ensure to replace '***' with your actual Zoho-oauthtoken. ```curl curl "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" }' ``` -------------------------------- ### Get a Specific Draft Source: https://www.zoho.com/mail360/help/api/get-specific-draft This API is used to retrieve a specific draft in the account using the draftId. ```APIDOC ## GET /websites/zoho_mail360_help_api/drafts/{draftId} ### Description Retrieves a specific email draft from the account using its unique identifier. ### Method GET ### Endpoint `/websites/zoho_mail360_help_api/drafts/{draftId}` ### Parameters #### Path Parameters - **draftId** (string) - Required - The unique identifier of the draft to retrieve. ### Response #### Success Response (200) - **draftId** (string) - The unique identifier of the draft. - **subject** (string) - The subject line of the draft email. - **body** (string) - The content of the draft email. - **recipients** (array) - A list of recipients for the email. #### Response Example ```json { "draftId": "12345abcd", "subject": "Meeting Reminder", "body": "Hi team, \nJust a reminder about our meeting tomorrow at 10 AM.\nBest regards, Admin", "recipients": [ "user1@example.com", "user2@example.com" ] } ``` ``` -------------------------------- ### Enable Account using cURL Source: https://www.zoho.com/mail360/help/api/enable-account This snippet demonstrates how to enable an existing account using the Zoho Mail360 API via a cURL command. It includes the necessary request method, headers, endpoint, and the JSON payload specifying the 'enableAccount' mode. Ensure you replace placeholders like 'N7A**C0CM' and '***' with your actual account key and OAuth token. ```curl curl "https://mail360.zoho.com/api/accounts/{account_key}" \ -X PUT \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Zoho-oauthtoken ***" \ -d '{ "mode":"enableAccount" }' ``` -------------------------------- ### Get Specific Account Source: https://www.zoho.com/mail360/help/api/get-specific-accounts Retrieves a specific account added in Mail360 using the account key. ```APIDOC ## GET /api/accounts/{accountKey} ### Description This API is used to retrieve a specific account added in Mail360 using the account key. ### Method GET ### Endpoint /api/accounts/{accountKey} ### Parameters #### Path Parameters - **accountKey** (string) - Required - The unique key of the account to retrieve. ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **accountDetails** (object) - Contains the details of the retrieved account. - **accountId** (string) - The unique identifier of the account. - **accountName** (string) - The name of the account. - **accountKey** (string) - The key of the account. - **creationDate** (string) - The date when the account was created. - **status** (string) - The current status of the account (e.g., 'active', 'inactive'). #### Response Example ```json { "accountDetails": { "accountId": "acc12345", "accountName": "Example Account", "accountKey": "examplekey987", "creationDate": "2023-10-27T10:00:00Z", "status": "active" } } ``` ``` -------------------------------- ### Get Specific Email Source: https://www.zoho.com/mail360/help/api/get-emails-using-messageid This API is used to retrieve a specific email using the message ID. ```APIDOC ## GET /websites/zoho_mail360_help_api/email ### Description This API is used to retrieve a specific email using the message ID. ### Method GET ### Endpoint /websites/zoho_mail360_help_api/email ### Parameters #### Query Parameters - **messageId** (string) - Required - The unique identifier of the email message to retrieve. ### Request Example ```json { "messageId": "" } ``` ### Response #### Success Response (200) - **emailContent** (string) - The full content of the retrieved email. - **subject** (string) - The subject line of the email. - **sender** (string) - The email address of the sender. - **recipients** (array of strings) - A list of email addresses of the recipients. - **timestamp** (string) - The date and time the email was sent. #### Response Example ```json { "emailContent": "

This is the content of the email.

", "subject": "Meeting Reminder", "sender": "sender@example.com", "recipients": ["recipient1@example.com", "recipient2@example.com"], "timestamp": "2023-10-27T10:00:00Z" } ``` ```