Gmail add-on: Use the API to define whether to save emails, attachments or both

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.
API_image01.png
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 
Use the API to identify the document class ID  

Access the API and configure a document class 

1. Follow one of these links to the AODocs API:

  • US instance:

https://apis-explorer.appspot.com/apis-explorer/?base=https://ao-docs.appspot.com/_ah/api#p/documentType/v1/documentType.documentType.patchClass

  • EU instance:

https://apis-explorer.appspot.com/apis-explorer/?base=https://aodocs-core-eu-1.ey.r.appspot.com/api#s/documentType/v1/documentType.documentType.patchClass

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.

image01.png

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.

image02.png


Use the API to identify the document class ID 

1. Follow one of these links to the AODocs API:

  • US instance:

https://apis-explorer.appspot.com/apis-explorer/?base=https://ao-docs.appspot.com/_ah/api#p/library/v1/library.library.getLibrary

  • EU instance:

https://apis-explorer.appspot.com/apis-explorer/?base=https://aodocs-core-eu-1.ey.r.appspot.com/api#s/library/v1/library.library.getLibrary

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.

image02.png

4. In the response, find the required document class and copy its ID. 

image03.png

Was this article helpful? 0 out of 0 found this helpful
If you didn’t find what you were looking for, don’t hesitate to leave a comment!
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.