This article is for developers with a full understanding of how to work with our API.
Important note about the API explorer:
When you follow the link we provide to the API explorer, you'll see a red warning.
The API itself is not deprecated. It's the Google API explorer that is deprecated. All the processes described in our API articles function correctly and safely if you use this Google API explorer.
The Gmail add-on is a tool that lets you save emails and their attachments to AODocs Document Management libraries.
Note: The Gmail add-on is available only in Document Management libraries. It isn't available in Team Folders or Secured Folders.
You can:
As standard, when you save emails to AODocs, the following attachments are added to your AODocs document:
- a PDF file containing the text of your email
- an EML file of your email
- at least one email attachment (if your email has attachments)
For a given document class, library administrators can use the API to define whether to save only emails, only attachments or both. This article describes how to do this.
![]() |
![]() |
Access the API and configure a document class
1. Follow one of these links to the AODocs API:
- US instance:
- EU instance:
Note: Dedicated instances have their own URLs. Learn more: What are AODocs instances?
2. In the libId field, enter the ID of the library you want to configure. Learn how to identify the library ID.
3. In the documentTypeId field, enter the ID of the document class you want to configure. Learn how to identify the document class ID.
4. Click in the Patch body field, then click the arrow in the top right corner and select Freeform editor.
5. Copy this text and paste it into the Patch body field:
Important: Overwrite the existing curly brackets.
{
"appMetadata": {
"GMAIL_ADDON": {
"kind": "aodocs#namespacedAppMetadata",
"appNamespaceId": "GMAIL_ADDON",
"tags": [
{
"kind": "aodocs#appMetadataTag",
"name": "exportAttachmentStrategy",
"stringValue": "EML"
}
]
}
}
}
5. Set the value of "stringValue"
(in bold in the code snippet above):
-
EML
: to add only an EML file of your email and a PDF file containing the text of your email to the AODocs document -
ATTACHMENTS
: to add only the email attachments to the AODocs document - users can select the attachments to save -
BOTH
(default): to activate both the above options
6. Click Authorize and execute. The response is displayed in the lower part of the screen.
Important: When you have applied an option, the user interface is adapted to offer only the choice you made. For example, if you selected EML, the button Choose attachments isn't displayed.
Use the API to identify the document class ID
1. Follow one of these links to the AODocs API:
- US instance:
- EU instance:
Note: Dedicated instances have their own URLs. Learn more: What are AODocs instances?
2. Enter the library ID. Learn how to identify the library ID.
3. Click Authorize and execute. The response is displayed in the lower part of the screen.
4. In the response, find the required document class and copy its ID.