# About API resources Source: https://api.aodocs.com/about-api-resources An AODocs object such as a document or a library is a logical grouping of metadata arranged to serve an organizational purpose. An AODocs resource is a schematic model of an AODocs object. It’s a map of how individual instances of the object are pieced together as fields and array fields of bits of data. AODocs adheres loosely to the Resource-oriented API designed [as defined by Google](https://cloud.google.com/apis/design/resources) , so you might find similarities in AODocs API resources and resources from the Drive API for example. In AODocs APIs, a particular instance of a resource has a JSON-formatted representation , which gets sent back and forth between the server and the client, and the server uses the representation to manipulate the resource itself. The fields of a representation include, but are not limited to the following: * Unique identifiers * Common global system fields like creation or modification date, name, last modifying user (these concepts are not necessarily named the same way) * Specific (custom) fields * References by ID to other resources (library ID in a document for example) * A listing of any subresources (if applicable) ## An example resource (library) ```json expandable theme={null} { "kind": "aodocs#library", "libraryId": "PHOv3s48xfbgjJa22iA", "name": "Corporate Files", "name_i18n": "Corporate Files", "domainName": "test.aodocs.com", "lastModified": "1556010506520", "lastConfigModified": "1556010506520", "createdAt": "1435948376818", "daysBeforeDelete": 30, "welcomeText": "

Hello world!

", "storageAdmin": "aodocs-aodocs@test.altirnao.com", "documentTypes": { "kind": "aodocs#classList", "items": [ { "kind": "aodocs#classId", "name": "Document", "name_i18n": "Document", "value": "PHOv3eF9uERXEP6NFb" } ] } } ``` ## Non-resources ### Subresources In AODocs APIs, a **subresource** is an **attribute** of a resource. It is resource-like only in that it has a schema and can be represented in JSON. However, no methods operate on it directly, and it cannot exist on its own, without its parent resource. `ApiPermission` and `ApiLibraryPermission` are good examples of subresources: you can alter them only as part of the resource they belong to. ### Collections An AODocs **collection** is a **list** of resources or subresources. It is not a resource by itself in the context of AODocs APIs. What makes a collection meaningful is what it lists. A list of documents (`ApiDocumentList`) is one example of a resource collection. A list of libraries (`ApiLibraryList`) is another. Meanwhile, `ApiLibraryPermissionList` is a **collection** of **subresources** (permissions for a specific library). **Note**: Requests for collections often return too many results and are best handled using [pagination](/best-practices/performance-considerations/). ## Collections vs. resources vs. subresources One way to explore what makes a collection different from a resource or a subresource is to use the example of permissions. Permissions are subresources that can be listed both as a collection or as part of a resource. Both the `ApiLibraryPermissionsList` and the `ApiLibrary` resource contain an array field of permissions: the former exclusively, the latter as part of its larger construct. You can get a library’s list of permissions in two ways: * `GET` an `ApiLibraryPermissionsList` (collection) for that specific library * `GET` that specific `ApiLibrary` (resource) and use the `fields` field to return only the list of permissions for that specific library The result looks the same in both cases: ```json expandable theme={null} { "kind": "aodocs#libraryPermissionList", "permissions": [ { "kind": "aodocs#libraryPermission", "type": "user", "role": "admin", "value": "martin@test.altirnao.com", "withLink": false, "name": "Martin", }, { "kind": "aodocs#libraryPermission", "type": "user", "role": "admin", "value": "aodocs.max@test.altirnao.com", "withLink": false, "name": "AODocs Files", }, { "kind": "aodocs#libraryPermission", "type": "user", "role": "admin", "value": "bob@altirnao.com", "withLink": false, "name": "Bob", } ] } ``` **Note**: By definition, a collection contains at least one **array field**. And, unlike subresources, it is used by at least one method. ## **How to interact with resources** An AODocs resource lives on the resource server. You interact with the resource by sending requests to the server to operate on it. The server performs the requested operation and sends back the result. Most of the time, you include in your request a subset of the resource: * When creating a resource (with a `PUT`) or updating it fully (with a `POST`), you are not required to send the complete resource, as most fields have a default value. * If you need to update a resource *partially* (with a `PATCH` request), send an abridged representation of the resource in question (such as `ApiDocument`) to the server, specifying just the parts you want altered. In all cases, the server parses your abridged *request resource*, maps your fields to the fields of its *resident resource*, possibly fills some fields with their default values, and reconciles the request and resident resources using the operation you specify. If successful, the complete resulting resource is sent back to you to consume. ## Common AODocs resources and collections # Attachment Source: https://api.aodocs.com/api-reference/attachment Lets you manage document attachments ## Download the OpenAPI specifications # Category Source: https://api.aodocs.com/api-reference/category Lets you manage (list, load, patch, update, add new, delete) categories and category values ## Download the OpenAPI specifications # Delete categoryv1libraries categories Source: https://api.aodocs.com/api-reference/category/delete-categoryv1libraries-categories /openapis/category.json delete /category/v1/libraries/{libraryId}/categories/{categoryId} Deletes a category from the library. # Delete categoryv1libraries categories values Source: https://api.aodocs.com/api-reference/category/delete-categoryv1libraries-categories-values /openapis/category.json delete /category/v1/libraries/{libraryId}/categories/{categoryId}/values/{categoryValueId} Deletes a category value of a category in a library. # Get categoryv1libraries Source: https://api.aodocs.com/api-reference/category/get-categoryv1libraries /openapis/category.json get /category/v1/libraries/{libraryId} Lists the categories available in a library. # Get categoryv1libraries categories Source: https://api.aodocs.com/api-reference/category/get-categoryv1libraries-categories /openapis/category.json get /category/v1/libraries/{libraryId}/categories/{categoryId} Gets the definition of a category in a library. # Get categoryv1libraries categories allvalueshierarchy Source: https://api.aodocs.com/api-reference/category/get-categoryv1libraries-categories-allvalueshierarchy /openapis/category.json get /category/v1/libraries/{libraryId}/categories/{categoryId}/allvalueshierarchy Lists all the values recursively of a category in a library. # Get categoryv1libraries categories values Source: https://api.aodocs.com/api-reference/category/get-categoryv1libraries-categories-values /openapis/category.json get /category/v1/libraries/{libraryId}/categories/{categoryId}/values Lists the children category values of a parent category value of a category in a library. # Get categoryv1libraries categories values 1 Source: https://api.aodocs.com/api-reference/category/get-categoryv1libraries-categories-values-1 /openapis/category.json get /category/v1/libraries/{libraryId}/categories/{categoryId}/values/{categoryValueId} Gets the category value of a category in a library. # Patch categoryv1 Source: https://api.aodocs.com/api-reference/category/patch-categoryv1 /openapis/category.json patch /category/v1 Updates a category in the library (keep existing values for not specified fields). # Patch categoryv1libraries categories values Source: https://api.aodocs.com/api-reference/category/patch-categoryv1libraries-categories-values /openapis/category.json patch /category/v1/libraries/{libraryId}/categories/{categoryId}/values Updates a category value of a category in a library. # Post categoryv1 Source: https://api.aodocs.com/api-reference/category/post-categoryv1 /openapis/category.json post /category/v1 Updates a category in the library (reset not specified fields). # Post categoryv1libraries categories :removeemptysublevels Source: https://api.aodocs.com/api-reference/category/post-categoryv1libraries-categories-:removeemptysublevels /openapis/category.json post /category/v1/libraries/{libraryId}/categories/{categoryId}:removeEmptySublevels Deletes all empty sublevels of a category. # Put categoryv1 Source: https://api.aodocs.com/api-reference/category/put-categoryv1 /openapis/category.json put /category/v1 Creates a category in the library. # Put categoryv1libraries categories values Source: https://api.aodocs.com/api-reference/category/put-categoryv1libraries-categories-values /openapis/category.json put /category/v1/libraries/{libraryId}/categories/{categoryId}/values Creates a category value of a category in a library. # Get viewv1crosslibrary Source: https://api.aodocs.com/api-reference/crosslibraryview/get-viewv1crosslibrary /openapis/domain.json get /view/v1/crossLibrary Gets the cross library view configuration. # Put viewv1crosslibrary Source: https://api.aodocs.com/api-reference/crosslibraryview/put-viewv1crosslibrary /openapis/domain.json put /view/v1/crossLibrary Updates the cross library view configuration (reset not specified fields). # Document Source: https://api.aodocs.com/api-reference/document Manage documents (beta version, subject to change) ## Download the OpenAPI specifications # Document Type Source: https://api.aodocs.com/api-reference/document-type Lets you manipulate existing document classes (beta version, subject to change) ## Download the OpenAPI specifications # Document View Config Source: https://api.aodocs.com/api-reference/document-view-config Lets you configure how documents are presented and edited ## Download the OpenAPI specifications # Get documentv2beta1documents states Source: https://api.aodocs.com/api-reference/document/get-documentv2beta1documents-states /openapis/document.json get /document/v2beta1/documents/{documentId}/states Lists the possible states for the document by the current user. # Get documentv2beta1documents transitions Source: https://api.aodocs.com/api-reference/document/get-documentv2beta1documents-transitions /openapis/document.json get /document/v2beta1/documents/{documentId}/transitions Lists transitions for the document where the current user is involved. # Get documentv2beta1documents transitions 1 Source: https://api.aodocs.com/api-reference/document/get-documentv2beta1documents-transitions-1 /openapis/document.json get /document/v2beta1/documents/{documentId}/transitions/{transitionId} Gets transition for the document where the current user is involved. # Get documentv2beta1documents transitionshistory Source: https://api.aodocs.com/api-reference/document/get-documentv2beta1documents-transitionshistory /openapis/document.json get /document/v2beta1/documents/{documentId}/transitions/history Lists the history of transitions for the document. # Document ID Source: https://api.aodocs.com/api-reference/documentid Lets you read and update document properties, create new documents, delete documents, manage document versions, ... (beta version, subject to change) ## Download the OpenAPI specifications # Delete documentv1 Source: https://api.aodocs.com/api-reference/documentid/delete-documentv1 /openapis/documentId.json delete /document/v1/{documentId} Deletes a document. # Delete documentv1 lock Source: https://api.aodocs.com/api-reference/documentid/delete-documentv1-lock /openapis/documentId.json delete /document/v1/{documentId}/lock Releases the lock put on a document. # Delete documentv1beta1 comments Source: https://api.aodocs.com/api-reference/documentid/delete-documentv1beta1-comments /openapis/documentId.json delete /document/v1beta1/{documentId}/comments/{commentId} Deletes a comment made outside a workflow context on a document # Get documentv1 Source: https://api.aodocs.com/api-reference/documentid/get-documentv1 /openapis/documentId.json get /document/v1 Creates a pre-filled unsaved document. # Get documentv1 1 Source: https://api.aodocs.com/api-reference/documentid/get-documentv1-1 /openapis/documentId.json get /document/v1/{documentId} Gets a document. # Get documentv1 version Source: https://api.aodocs.com/api-reference/documentid/get-documentv1-version /openapis/documentId.json get /document/v1/{documentId}/version Lists past versions of a document. # Get documentv1 version 1 Source: https://api.aodocs.com/api-reference/documentid/get-documentv1-version-1 /openapis/documentId.json get /document/v1/{documentId}/version/{versionId} Gets a past version of a document. # Get documentv1:listlocked Source: https://api.aodocs.com/api-reference/documentid/get-documentv1:listlocked /openapis/documentId.json get /document/v1:listLocked List all the active documents with lock in a library. # Get documentv1beta1 comments Source: https://api.aodocs.com/api-reference/documentid/get-documentv1beta1-comments /openapis/documentId.json get /document/v1beta1/{documentId}/comments Lists the comments put on the document. # Get documentv1beta1 vieweractions Source: https://api.aodocs.com/api-reference/documentid/get-documentv1beta1-vieweractions /openapis/documentId.json get /document/v1beta1/{documentId}/viewerActions Lists the viewer actions applicable to a document. # Get documentv1beta1activities Source: https://api.aodocs.com/api-reference/documentid/get-documentv1beta1activities /openapis/documentId.json get /document/v1beta1/activities Lists document activities. # Get documentv1beta1creation token Source: https://api.aodocs.com/api-reference/documentid/get-documentv1beta1creation-token /openapis/documentId.json get /document/v1beta1/creation-token # Get documentv1beta1generateids Source: https://api.aodocs.com/api-reference/documentid/get-documentv1beta1generateids /openapis/documentId.json get /document/v1beta1/generateIds Generates a set of document IDs which can be provided in insertDocument requests. # Patch documentv1 Source: https://api.aodocs.com/api-reference/documentid/patch-documentv1 /openapis/documentId.json patch /document/v1/{documentId} Updates a document (keep existing values for not specified fields). # Patch documentv1beta1 async Source: https://api.aodocs.com/api-reference/documentid/patch-documentv1beta1-async /openapis/documentId.json patch /document/v1beta1/{documentId}/async Updates a document asynchronously (keep existing values for not specified fields). # Patch documentv1beta1 internalmetadata Source: https://api.aodocs.com/api-reference/documentid/patch-documentv1beta1-internalmetadata /openapis/documentId.json patch /document/v1beta1/{documentId}/internalMetadata [Restricted] Updates a document, including its internalMetadata (keep existing values for not specified fields). The internalMetadata is merged per source key. # Patch documentv1beta1 version Source: https://api.aodocs.com/api-reference/documentid/patch-documentv1beta1-version /openapis/documentId.json patch /document/v1beta1/{documentId}/version/{versionId} [Restricted] Updates a previous version of a document (keep existing values for not specified fields) # Post documentv1 Source: https://api.aodocs.com/api-reference/documentid/post-documentv1 /openapis/documentId.json post /document/v1/{documentId} Updates a document (reset not specified fields). # Post documentv1 copy Source: https://api.aodocs.com/api-reference/documentid/post-documentv1-copy /openapis/documentId.json post /document/v1/{documentId}/copy Copies the given document via a job. The id of the new document created is returned immediately. # Post documentv1 exporttomydrive Source: https://api.aodocs.com/api-reference/documentid/post-documentv1-exporttomydrive /openapis/documentId.json post /document/v1/{documentId}/exportToMyDrive Exports attachment from a Document Management library to a user's My Drive. # Post documentv1 lock Source: https://api.aodocs.com/api-reference/documentid/post-documentv1-lock /openapis/documentId.json post /document/v1/{documentId}/lock Locks the document for edition by the current user. # Post documentv1 move Source: https://api.aodocs.com/api-reference/documentid/post-documentv1-move /openapis/documentId.json post /document/v1/{documentId}/move/{folderAodocsId} Moves a document in the folder tree. # Post documentv1 notifyusers Source: https://api.aodocs.com/api-reference/documentid/post-documentv1-notifyusers /openapis/documentId.json post /document/v1/{documentId}/notifyUsers Sends a formatted email from AODocs to specific users/groups with a subject and content. # Post documentv1 version Source: https://api.aodocs.com/api-reference/documentid/post-documentv1-version /openapis/documentId.json post /document/v1/{documentId}/version/{versionId} Restore a previous version of a document by creating a new version based on document content of the chosen past version. # Post documentv1beta1 attachments Source: https://api.aodocs.com/api-reference/documentid/post-documentv1beta1-attachments /openapis/documentId.json post /document/v1beta1/{documentId}/attachments/{attachmentDriveFileId} Updates the content of an attachment (in an AODocs document). The new content can come either from an already pushed revision of the Drive file (the latest) or from another file in Drive. When updating the content, the document may be versioned to keep reference to the previous content of the attachment. # Post documentv1beta1 comments Source: https://api.aodocs.com/api-reference/documentid/post-documentv1beta1-comments /openapis/documentId.json post /document/v1beta1/{documentId}/comments Creates a new comment on a document (outside workflow context) # Post documentv1beta1 vieweractionsvieweractions execute Source: https://api.aodocs.com/api-reference/documentid/post-documentv1beta1-vieweractionsvieweractions-execute /openapis/documentId.json post /document/v1beta1/{documentId}/viewerActions/viewerActions/{actionId}/execute Executes a viewer action applicable to a document. # Post documentv1beta1calculate Source: https://api.aodocs.com/api-reference/documentid/post-documentv1beta1calculate /openapis/documentId.json post /document/v1beta1/calculate Evaluate calculated properties (calculated properties, calculated title, ...) on the document # Post documentv1createdrivefile Source: https://api.aodocs.com/api-reference/documentid/post-documentv1createdrivefile /openapis/documentId.json post /document/v1/createdrivefile Creates a file in the Drive of the storage account of the given library. # Post documentv1newversionbyattachment Source: https://api.aodocs.com/api-reference/documentid/post-documentv1newversionbyattachment /openapis/documentId.json post /document/v1/newversionbyattachment/{driveId} Creates a new version of the AODocs document after uploading a new revision of an attachment (deprecated, use 'updateAttachment' instead). # Put documentv1 Source: https://api.aodocs.com/api-reference/documentid/put-documentv1 /openapis/documentId.json put /document/v1 Creates a new document of the given class in the given library. # Put documentv1 checkin Source: https://api.aodocs.com/api-reference/documentid/put-documentv1-checkin /openapis/documentId.json put /document/v1/{documentId}/checkin Checks in a document (commits the draft version's content as a new version of the document - at the end of the potential job). # Put documentv1 checkout Source: https://api.aodocs.com/api-reference/documentid/put-documentv1-checkout /openapis/documentId.json put /document/v1/{documentId}/checkout Checks out a document (creates a draft version of the document - at the end of the potential job). # Put documentv1 discardcheckout Source: https://api.aodocs.com/api-reference/documentid/put-documentv1-discardcheckout /openapis/documentId.json put /document/v1/{documentId}/discardcheckout Discards the check-out of a document (deletes the draft version to come back to the main version as current version). # Put documentv1 untrash Source: https://api.aodocs.com/api-reference/documentid/put-documentv1-untrash /openapis/documentId.json put /document/v1/{documentId}/untrash Restores a document from the trash. # Put documentv1 version Source: https://api.aodocs.com/api-reference/documentid/put-documentv1-version /openapis/documentId.json put /document/v1/{documentId}/version Creates a new version of a document. # Put documentv1beta1 Source: https://api.aodocs.com/api-reference/documentid/put-documentv1beta1 /openapis/documentId.json put /document/v1beta1 Creates a new document with versions. # Put documentv1beta1 publish Source: https://api.aodocs.com/api-reference/documentid/put-documentv1beta1-publish /openapis/documentId.json put /document/v1beta1/{documentId}/publish Publishes or unpublishes a document's attachments on Drive. # Put documentv1beta1async Source: https://api.aodocs.com/api-reference/documentid/put-documentv1beta1async /openapis/documentId.json put /document/v1beta1/async Creates a new document asynchronously (useful in case of numerous attachments) of the given class in the given library. # Put documentv1beta1asyncwithversions Source: https://api.aodocs.com/api-reference/documentid/put-documentv1beta1asyncwithversions /openapis/documentId.json put /document/v1beta1/asyncWithVersions Creates a new document with versions asynchronously (useful in case of numerous attachments). # Delete documenttypev1beta1libraries documenttypes templatedocuments Source: https://api.aodocs.com/api-reference/documenttype/delete-documenttypev1beta1libraries-documenttypes-templatedocuments /openapis/documentType.json delete /documentType/v1beta1/libraries/{libId}/documentTypes/{documentTypeId}/templateDocuments/{templateDocumentId} Deletes a document template. # Delete documenttypev1libraries documenttypes Source: https://api.aodocs.com/api-reference/documenttype/delete-documenttypev1libraries-documenttypes /openapis/documentType.json delete /documentType/v1/libraries/{libId}/documentTypes/{documentTypeId} Deletes a document class. # Get documenttypev1beta1libraries documenttypes templatedocuments Source: https://api.aodocs.com/api-reference/documenttype/get-documenttypev1beta1libraries-documenttypes-templatedocuments /openapis/documentType.json get /documentType/v1beta1/libraries/{libId}/documentTypes/{documentTypeId}/templateDocuments Lists the full content of the document templates of the given class in the library. # Get documenttypev1beta1libraries documenttypes templatedocuments 1 Source: https://api.aodocs.com/api-reference/documenttype/get-documenttypev1beta1libraries-documenttypes-templatedocuments-1 /openapis/documentType.json get /documentType/v1beta1/libraries/{libId}/documentTypes/{documentTypeId}/templateDocuments/{templateDocumentId} Gets the configuration of a document template. # Get documenttypev1libraries Source: https://api.aodocs.com/api-reference/documenttype/get-documenttypev1libraries /openapis/documentType.json get /documentType/v1/libraries/{libraryId} Lists the ID/name of the document classes in a library. # Get documenttypev1libraries documenttypes Source: https://api.aodocs.com/api-reference/documenttype/get-documenttypev1libraries-documenttypes /openapis/documentType.json get /documentType/v1/libraries/{libId}/documentTypes/{documentTypeId} Gets the configuration of a document class. # Patch documenttypev1beta1libraries documenttypes templatedocuments Source: https://api.aodocs.com/api-reference/documenttype/patch-documenttypev1beta1libraries-documenttypes-templatedocuments /openapis/documentType.json patch /documentType/v1beta1/libraries/{libId}/documentTypes/{documentTypeId}/templateDocuments/{templateDocumentId} Updates a document template configuration. # Patch documenttypev1libraries documenttypes Source: https://api.aodocs.com/api-reference/documenttype/patch-documenttypev1libraries-documenttypes /openapis/documentType.json patch /documentType/v1/libraries/{libId}/documentTypes/{documentTypeId} Updates a document class configuration (keep existing values for not specified fields). # Post documenttypev1libraries documenttypes Source: https://api.aodocs.com/api-reference/documenttype/post-documenttypev1libraries-documenttypes /openapis/documentType.json post /documentType/v1/libraries/{library}/documentTypes Creates a new document class in the library. # Put documenttypev1beta1libraries documenttypes templatedocuments Source: https://api.aodocs.com/api-reference/documenttype/put-documenttypev1beta1libraries-documenttypes-templatedocuments /openapis/documentType.json put /documentType/v1beta1/libraries/{libId}/documentTypes/{documentTypeId}/templateDocuments Creates a new document template of a class in the library. # Put documenttypev1libraries documenttypes Source: https://api.aodocs.com/api-reference/documenttype/put-documenttypev1libraries-documenttypes /openapis/documentType.json put /documentType/v1/libraries/{libId}/documentTypes/{documentTypeId} Updates a document class configuration (reset not specified fields). # Get documentviewconfigv1library documenttype Source: https://api.aodocs.com/api-reference/documentviewconfig/get-documentviewconfigv1library-documenttype /openapis/documentViewConfig.json get /documentViewConfig/v1/library/{libraryId}/documentType/{documentTypeId} Gets the document view configuration related to a document class. # Put documentviewconfigv1library documenttype Source: https://api.aodocs.com/api-reference/documentviewconfig/put-documentviewconfigv1library-documenttype /openapis/documentViewConfig.json put /documentViewConfig/v1/library/{libraryId}/documentType/{documentTypeId} Sets the document view configuration of a document class (orientation, sections displayed...). # Domain Source: https://api.aodocs.com/api-reference/domain Lets you manage (list, load, patch, update, add new, delete) domain settings (beta version, subject to change) ## Download the OpenAPI specifications # Delete domainv1beta1configuration Source: https://api.aodocs.com/api-reference/domain/delete-domainv1beta1configuration /openapis/domain.json delete /domain/v1beta1/configuration/{flagName} Deletes the specified custom configuration flag at domain level. # Delete domainv1beta1licensedusers Source: https://api.aodocs.com/api-reference/domain/delete-domainv1beta1licensedusers /openapis/domain.json delete /domain/v1beta1/licensedUsers/{userId} Deletes licensed user(s) from the domain. # Delete domainv1beta1roles Source: https://api.aodocs.com/api-reference/domain/delete-domainv1beta1roles /openapis/domain.json delete /domain/v1beta1/roles/{roleId} Deletes a domain role. # Delete domainv1beta1securitycodes Source: https://api.aodocs.com/api-reference/domain/delete-domainv1beta1securitycodes /openapis/domain.json delete /domain/v1beta1/securityCodes/{securityCode} Deletes a security code from the domain. # Delete domainv1beta1storageaccounts Source: https://api.aodocs.com/api-reference/domain/delete-domainv1beta1storageaccounts /openapis/domain.json delete /domain/v1beta1/storageAccounts/{storageAccount} Deletes a storage account from the domain. # Get domainv1auditlog Source: https://api.aodocs.com/api-reference/domain/get-domainv1auditlog /openapis/domain.json get /domain/v1/auditLog Lists the audit log events relative to specified filters. # Get domainv1beta1 Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1 /openapis/domain.json get /domain/v1beta1 Gets information about the domain. # Get domainv1beta1billingstatus Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1billingstatus /openapis/domain.json get /domain/v1beta1/billingStatus Gets billing status of the domain. # Get domainv1beta1configuration Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1configuration /openapis/domain.json get /domain/v1beta1/configuration Gets all custom domain configuration flags defined at domain level. # Get domainv1beta1configurationflags Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1configurationflags /openapis/domain.json get /domain/v1beta1/configurationFlags Gets the custom domain configurations with fallback on default value. # Get domainv1beta1expiredlicenseusers Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1expiredlicenseusers /openapis/domain.json get /domain/v1beta1/expiredLicenseUsers Lists the users of the domain, whose license expired. (DEPRECATED : Use licensedUsers with status=EXPIRED instead). # Get domainv1beta1licensedusers Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1licensedusers /openapis/domain.json get /domain/v1beta1/licensedUsers Lists the licensed users of the domain. # Get domainv1beta1licensedusers 1 Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1licensedusers-1 /openapis/domain.json get /domain/v1beta1/licensedUsers/{userId} Gets a licensed user of the domain by email. # Get domainv1beta1roles Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1roles /openapis/domain.json get /domain/v1beta1/roles Lists the domain roles. # Get domainv1beta1roles 1 Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1roles-1 /openapis/domain.json get /domain/v1beta1/roles/{roleId} Gets a domain role. # Get domainv1beta1securitycodes Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1securitycodes /openapis/domain.json get /domain/v1beta1/securityCodes Lists the security codes of the domain. # Get domainv1beta1standardactions Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1standardactions /openapis/domain.json get /domain/v1beta1/standardActions Gets the list of available standard actions for the current domain (Coming soon! This method isn't yet available. It will be made available in a future release). # Get domainv1beta1statistics Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1statistics /openapis/domain.json get /domain/v1beta1/statistics/{type} Lists statistics for a specified entity (domain, storage account or library). The pagination only works for the library statistics. # Get domainv1beta1statistics Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1statistics- /openapis/domain.json get /domain/v1beta1/statistics/{type}/{id} Gets statistics for a specified entity (domain, storage account or library). # Get domainv1beta1storageaccounts Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1storageaccounts /openapis/domain.json get /domain/v1beta1/storageAccounts Lists storage accounts. # Get domainv1beta1storageaccounts 1 Source: https://api.aodocs.com/api-reference/domain/get-domainv1beta1storageaccounts-1 /openapis/domain.json get /domain/v1beta1/storageAccounts/{storageAccount} Gets the storage account by email. # Get domainv1check Source: https://api.aodocs.com/api-reference/domain/get-domainv1check /openapis/domain.json get /domain/v1/check/{applicationId} Checks the status of the domain. # Get domainv1storageadmins Source: https://api.aodocs.com/api-reference/domain/get-domainv1storageadmins /openapis/domain.json get /domain/v1/storageadmins Lists the storage accounts of the domain. # Patch domainv1beta1 Source: https://api.aodocs.com/api-reference/domain/patch-domainv1beta1 /openapis/domain.json patch /domain/v1beta1 Updates domain configurations. # Patch domainv1beta1billingstatus Source: https://api.aodocs.com/api-reference/domain/patch-domainv1beta1billingstatus /openapis/domain.json patch /domain/v1beta1/billingStatus Updates billing status of the domain. # Patch domainv1beta1roles Source: https://api.aodocs.com/api-reference/domain/patch-domainv1beta1roles /openapis/domain.json patch /domain/v1beta1/roles/{roleId} Updates a domain role (keep existing values for not specified fields). # Patch domainv1beta1securitycodes Source: https://api.aodocs.com/api-reference/domain/patch-domainv1beta1securitycodes /openapis/domain.json patch /domain/v1beta1/securityCodes/{securityCode} Updates a security code on the domain. # Patch domainv1beta1storageaccounts Source: https://api.aodocs.com/api-reference/domain/patch-domainv1beta1storageaccounts /openapis/domain.json patch /domain/v1beta1/storageAccounts/{storageAccount} Updates a storage account on the domain. # Post domainv1beta1configuration Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1configuration /openapis/domain.json post /domain/v1beta1/configuration Updates values of domain level custom configuration flags. Unspecified flags previously defined at domain level will be deleted! # Post domainv1beta1configuration 1 Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1configuration-1 /openapis/domain.json post /domain/v1beta1/configuration/{flagName} Sets value for the specified custom configuration flag at domain level. # Post domainv1beta1image Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1image /openapis/domain.json post /domain/v1beta1/image Method to call before uploading an image to AODocs. The images are visible to the users who can access the library and if present the document. # Post domainv1beta1licensedusersbatchdelete Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1licensedusersbatchdelete /openapis/domain.json post /domain/v1beta1/licensedUsers/batchDelete Deletes licensed user(s) from the domain. # Post domainv1beta1roles Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1roles /openapis/domain.json post /domain/v1beta1/roles Creates a new domain role. # Post domainv1beta1securitycodes Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1securitycodes /openapis/domain.json post /domain/v1beta1/securityCodes Creates a security code on the domain. # Post domainv1beta1storageaccounts Source: https://api.aodocs.com/api-reference/domain/post-domainv1beta1storageaccounts /openapis/domain.json post /domain/v1beta1/storageAccounts Creates a storage account for the domain. # Put domainv1activate Source: https://api.aodocs.com/api-reference/domain/put-domainv1activate /openapis/domain.json put /domain/v1/activate Activates the domain on AODocs. # Put domainv1beta1licensedusers Source: https://api.aodocs.com/api-reference/domain/put-domainv1beta1licensedusers /openapis/domain.json put /domain/v1beta1/licensedUsers/{userId} Pre-allocates licenses to user # Put domainv1beta1licensedusersbatchallocate Source: https://api.aodocs.com/api-reference/domain/put-domainv1beta1licensedusersbatchallocate /openapis/domain.json put /domain/v1beta1/licensedUsers/batchAllocate Pre-allocates licenses to user # Put domainv1register Source: https://api.aodocs.com/api-reference/domain/put-domainv1register- /openapis/domain.json put /domain/v1/register/{applicationId}/{storageAdmin} Registers the domain on AODocs. # Get library classid documentid attachmentid checkxref Source: https://api.aodocs.com/api-reference/drawing/get-library-classid-documentid-attachmentid-checkxref /openapis/attachment.json get /library/{libraryId}/classId/{classId}/documentId/{documentId}/attachmentId/{attachmentId}/checkXref ################################### # Get library classid documentid attachmentid extension Source: https://api.aodocs.com/api-reference/drawing/get-library-classid-documentid-attachmentid-extension /openapis/attachment.json get /library/{libraryId}/classId/{classId}/documentId/{documentId}/attachmentId/{attachmentId}/extension/{extensionType} Returns the OSS extension data (e.g. ADXREF, ADATTR) stored alongside an attachment. # Drive Import Source: https://api.aodocs.com/api-reference/driveImport Lets you import files and manage imported files ## Download the OpenAPI specifications # Drive ID Source: https://api.aodocs.com/api-reference/driveid Lets you read and update document properties, create new documents, delete documents, manage document versions, ... (beta version, subject to change) ## Download the OpenAPI specifications # Delete documentv1drive Source: https://api.aodocs.com/api-reference/driveid/delete-documentv1drive /openapis/driveId.json delete /document/v1/drive/{driveId} Deletes a document AODocs via the Drive ID of one of its attachment. # Delete documentv1drive lock Source: https://api.aodocs.com/api-reference/driveid/delete-documentv1drive-lock /openapis/driveId.json delete /document/v1/drive/{driveId}/lock Releases the lock put on a document via the Drive ID of one of its attachment. # Get documentv1 Source: https://api.aodocs.com/api-reference/driveid/get-documentv1 /openapis/driveId.json get /document/v1 Creates a pre-filled unsaved document. # Get documentv1beta1drive revision revisionlink Source: https://api.aodocs.com/api-reference/driveid/get-documentv1beta1drive-revision-revisionlink /openapis/driveId.json get /document/v1beta1/drive/{fileId}/revision/{revisionId}/revisionlink Gets the url of a revision of a Drive file. # Get documentv1beta1drive revision storagelink Source: https://api.aodocs.com/api-reference/driveid/get-documentv1beta1drive-revision-storagelink /openapis/driveId.json get /document/v1beta1/drive/{fileId}/revision/{revisionId}/storagelink Gets the url of a revision of a Drive file. # Get documentv1drive Source: https://api.aodocs.com/api-reference/driveid/get-documentv1drive /openapis/driveId.json get /document/v1/drive/{driveId} Gets a document AODocs via the Drive ID of one of its attachment. # Get documentv1drive permission Source: https://api.aodocs.com/api-reference/driveid/get-documentv1drive-permission /openapis/driveId.json get /document/v1/drive/{driveId}/permission Lists the permissions applied on a Drive file. # Get documentv1drive version Source: https://api.aodocs.com/api-reference/driveid/get-documentv1drive-version /openapis/driveId.json get /document/v1/drive/{driveId}/version Lists past versions of a document via the Drive ID of one of its attachment. # Get documentv1drive version 1 Source: https://api.aodocs.com/api-reference/driveid/get-documentv1drive-version-1 /openapis/driveId.json get /document/v1/drive/{driveId}/version/{versionId} Gets a past version of a document via the Drive ID of one of its attachment. # Get documentv1drive webdav Source: https://api.aodocs.com/api-reference/driveid/get-documentv1drive-webdav /openapis/driveId.json get /document/v1/drive/{driveId}/webdav Gets the link to open the file with the Webdav. # Patch documentv1drive Source: https://api.aodocs.com/api-reference/driveid/patch-documentv1drive /openapis/driveId.json patch /document/v1/drive/{driveId} Updates a document AODocs via the Drive ID of one of its attachment (keep existing values for not specified fields). # Post documentv1createdrivefile Source: https://api.aodocs.com/api-reference/driveid/post-documentv1createdrivefile /openapis/driveId.json post /document/v1/createdrivefile Creates a file in the Drive of the storage account of the given library. # Post documentv1drive Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive /openapis/driveId.json post /document/v1/drive/{driveId} Updates a document AODocs via the Drive ID of one of its attachment (reset not specified fields). # Post documentv1drive check Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive-check /openapis/driveId.json post /document/v1/drive/{driveId}/check Checks if the Drive file is attached to a document AODocs. # Post documentv1drive copy Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive-copy /openapis/driveId.json post /document/v1/drive/{driveId}/copy Copies the given document (via the Drive ID of one of its attachment) via a job. The id of the new document created is returned immediately. # Post documentv1drive lock Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive-lock /openapis/driveId.json post /document/v1/drive/{driveId}/lock Locks the document (via the Drive ID of one of its attachment) for edition by the current user. # Post documentv1drive move Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive-move /openapis/driveId.json post /document/v1/drive/{driveId}/move/{parentId} Moves a document AODocs via the Drive ID of one of its attachment in the folder tree. # Post documentv1drive permission Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive-permission /openapis/driveId.json post /document/v1/drive/{driveId}/permission Updates the permissions applied on a Drive file. # Post documentv1drive version Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drive-version /openapis/driveId.json post /document/v1/drive/{driveId}/version/{versionId} Restore a previous version of a document (via the Drive ID of one of its attachment) by creating a new version based on document content of the chosen past version. # Post documentv1drivenative Source: https://api.aodocs.com/api-reference/driveid/post-documentv1drivenative /openapis/driveId.json post /document/v1/drive/native Creates a native file in the Drive of the storage account of the given library. # Post documentv1newversionbyattachment Source: https://api.aodocs.com/api-reference/driveid/post-documentv1newversionbyattachment /openapis/driveId.json post /document/v1/newversionbyattachment/{driveId} Creates a new version of the AODocs document after uploading a new revision of an attachment (deprecated, use 'updateAttachment' instead). # Put documentv1 Source: https://api.aodocs.com/api-reference/driveid/put-documentv1 /openapis/driveId.json put /document/v1 Creates a new document of the given class in the given library. # Put documentv1drive checkin Source: https://api.aodocs.com/api-reference/driveid/put-documentv1drive-checkin /openapis/driveId.json put /document/v1/drive/{driveId}/checkin Checks in a document via the Drive ID of one of its attachment (commits the draft version's content as a new version of the document - at the end of the potential job). # Put documentv1drive checkout Source: https://api.aodocs.com/api-reference/driveid/put-documentv1drive-checkout /openapis/driveId.json put /document/v1/drive/{driveId}/checkout Checks out a document via the Drive ID of one of its attachment (creates a draft version of the document - at the end of the potential job). # Put documentv1drive discardcheckout Source: https://api.aodocs.com/api-reference/driveid/put-documentv1drive-discardcheckout /openapis/driveId.json put /document/v1/drive/{driveId}/discardcheckout Discards the check-out of a document via the Drive ID of one of its attachment (deletes the draft version to come back to the main version as current version). # Put documentv1drive untrash Source: https://api.aodocs.com/api-reference/driveid/put-documentv1drive-untrash /openapis/driveId.json put /document/v1/drive/{driveId}/untrash Restores a document (via the Drive ID of one of its attachment) from the trash. # Put documentv1drive version Source: https://api.aodocs.com/api-reference/driveid/put-documentv1drive-version /openapis/driveId.json put /document/v1/drive/{driveId}/version Creates a new version of a document via the Drive ID of one of its attachment. # Get driveimportv1imports Source: https://api.aodocs.com/api-reference/driveimport/get-driveimportv1imports /openapis/driveImport.json get /driveImport/v1/imports Lists the high-level status of the import jobs on the domain. # Get driveimportv1imports 1 Source: https://api.aodocs.com/api-reference/driveimport/get-driveimportv1imports-1 /openapis/driveImport.json get /driveImport/v1/imports/{importId} Gets the details of an import job on the domain. # Get driveimportv1imports files Source: https://api.aodocs.com/api-reference/driveimport/get-driveimportv1imports-files /openapis/driveImport.json get /driveImport/v1/imports/{importId}/files Lists the details by file of an import job on the domain. # Post driveimportv1driveimportv1importsupload Source: https://api.aodocs.com/api-reference/driveimport/post-driveimportv1driveimportv1importsupload /openapis/driveImport.json post /driveImport/v1/driveImport/v1/imports/upload Returns a Drive file upload URL with a matching file id. # Put driveimportv1importsbatchfolders Source: https://api.aodocs.com/api-reference/driveimport/put-driveimportv1importsbatchfolders /openapis/driveImport.json put /driveImport/v1/imports/batch/folders/{parentFolderId} Imports several files in a folder managed by AODocs. # Put driveimportv1importsfolders Source: https://api.aodocs.com/api-reference/driveimport/put-driveimportv1importsfolders- /openapis/driveImport.json put /driveImport/v1/imports/folders/{parentFolderId}/{fileId} Imports a single file in a folder managed by AODocs. It's recommended to use importFileOrFolders instead (to follow-up the job). # Folder Source: https://api.aodocs.com/api-reference/folder Lets you list existing folders, update folders, create new folders, ... ## Download the OpenAPI specifications # Delete folderv1files Source: https://api.aodocs.com/api-reference/folder/delete-folderv1files /openapis/folder.json delete /folder/v1/files/{folderId} Removes folder with id folderId according to deleteMode # Delete folderv1libraries folders Source: https://api.aodocs.com/api-reference/folder/delete-folderv1libraries-folders /openapis/folder.json delete /folder/v1/libraries/{libraryId}/folders/{folderAodocsId} (Deprecated - use remove) Removes folder with id folderAodocsId in library libraryId according to deleteMode # Get folderv1files Source: https://api.aodocs.com/api-reference/folder/get-folderv1files /openapis/folder.json get /folder/v1/files/{folderId} Gets a folder # Get folderv1files children Source: https://api.aodocs.com/api-reference/folder/get-folderv1files-children /openapis/folder.json get /folder/v1/files/{folderId}/children List folders under folder with id folderId, possible loading only direct children # Get folderv1folders extendedpermissions Source: https://api.aodocs.com/api-reference/folder/get-folderv1folders-extendedpermissions /openapis/folder.json get /folder/v1/folders/{folderId}/extendedPermissions Loads folder permissions and related flags in Secured Folder and Document Management libraries # Get folderv1folders hierarchy Source: https://api.aodocs.com/api-reference/folder/get-folderv1folders-hierarchy /openapis/folder.json get /folder/v1/folders/{displayRootFolderId}/hierarchy Load necessary folders to display selectedFolder in the context of displayRootFolder # Get folderv1folders permissions Source: https://api.aodocs.com/api-reference/folder/get-folderv1folders-permissions /openapis/folder.json get /folder/v1/folders/{folderId}/permissions # Get folderv1foldertrees Source: https://api.aodocs.com/api-reference/folder/get-folderv1foldertrees /openapis/folder.json get /folder/v1/folderTrees/{rootFolderId} Load necessary folders as trees to display selectedFolder in the context of displayRootFolder applying filter from the view # Get folderv1libraries Source: https://api.aodocs.com/api-reference/folder/get-folderv1libraries /openapis/folder.json get /folder/v1/libraries/{libraryId} # Get folderv1libraries folders Source: https://api.aodocs.com/api-reference/folder/get-folderv1libraries-folders /openapis/folder.json get /folder/v1/libraries/{libraryId}/folders (DO NOT USE - use list/listFromDisplayRoot) Loads all folders in a library. WARNING! This method can be very inefficient, prefer listFolders/listFoldersFromDisplayRoot methods. # Get folderv1libraries folders 1 Source: https://api.aodocs.com/api-reference/folder/get-folderv1libraries-folders-1 /openapis/folder.json get /folder/v1/libraries/{libraryId}/folders/{folderAodocsId} (Deprecated - use get) Loads folder with id folderAodocsId in library libraryId # Get folderv1libraries foldersanddocuments Source: https://api.aodocs.com/api-reference/folder/get-folderv1libraries-foldersanddocuments /openapis/folder.json get /folder/v1/libraries/{libraryId}/foldersAndDocuments Loads trashed folders and documents in folder with id referenceFolderId # Get folderv1libraries folderschildren Source: https://api.aodocs.com/api-reference/folder/get-folderv1libraries-folderschildren /openapis/folder.json get /folder/v1/libraries/{libraryId}/folders/children (DO NOT USE - use list) List folders under folder with id folderAodocsId, possible loading only direct children # Patch folderv1 Source: https://api.aodocs.com/api-reference/folder/patch-folderv1 /openapis/folder.json patch /folder/v1 # Post folderv1 Source: https://api.aodocs.com/api-reference/folder/post-folderv1 /openapis/folder.json post /folder/v1 # Post folderv1duplicate Source: https://api.aodocs.com/api-reference/folder/post-folderv1duplicate- /openapis/folder.json post /folder/v1/duplicate/{sourceFolderId}/{destinationFolderId}/{folderName} # Post folderv1files Source: https://api.aodocs.com/api-reference/folder/post-folderv1files /openapis/folder.json post /folder/v1/files/{folderId} Renames a folder # Post folderv1folders applypermissionsrecursively Source: https://api.aodocs.com/api-reference/folder/post-folderv1folders-applypermissionsrecursively /openapis/folder.json post /folder/v1/folders/{folderId}/applypermissionsrecursively Applies the permissions of the provided folder to its content recursively # Post folderv1folders checkfolder Source: https://api.aodocs.com/api-reference/folder/post-folderv1folders-checkfolder /openapis/folder.json post /folder/v1/folders/{folderId}/checkfolder # Post folderv1folders extendedpermissions Source: https://api.aodocs.com/api-reference/folder/post-folderv1folders-extendedpermissions /openapis/folder.json post /folder/v1/folders/{folderId}/extendedPermissions Updates folder permissions and related flags in Secured Folder and Document Management libraries # Post folderv1folders move Source: https://api.aodocs.com/api-reference/folder/post-folderv1folders-move /openapis/folder.json post /folder/v1/folders/{folderId}/move/{parentFolderId} Moves folder with id folderId to folder parentId (must be in the same library) # Post folderv1folders permissions Source: https://api.aodocs.com/api-reference/folder/post-folderv1folders-permissions /openapis/folder.json post /folder/v1/folders/{folderId}/permissions # Post folderv1folders untrash Source: https://api.aodocs.com/api-reference/folder/post-folderv1folders-untrash /openapis/folder.json post /folder/v1/folders/{folderId}/untrash Restores folder with id folderId from trash into folder targetFolderId. # Post folderv1libraries folders Source: https://api.aodocs.com/api-reference/folder/post-folderv1libraries-folders /openapis/folder.json post /folder/v1/libraries/{libraryId}/folders/{folderAodocsId} (Deprecated - use rename) Renames folder with id folderAodocsId # Post folderv1libraries foldersanddocumentsmove Source: https://api.aodocs.com/api-reference/folder/post-folderv1libraries-foldersanddocumentsmove /openapis/folder.json post /folder/v1/libraries/{libraryId}/foldersAndDocuments/move Moves multiple folders and documents into the parent folder # Post folderv1libraries foldersanddocumentstrash Source: https://api.aodocs.com/api-reference/folder/post-folderv1libraries-foldersanddocumentstrash /openapis/folder.json post /folder/v1/libraries/{libraryId}/foldersAndDocuments/trash Removes multiple folders and documents according to deleteMode # Post folderv1libraries foldersanddocumentsuntrash Source: https://api.aodocs.com/api-reference/folder/post-folderv1libraries-foldersanddocumentsuntrash /openapis/folder.json post /folder/v1/libraries/{libraryId}/foldersAndDocuments/untrash Restores multiple folders and documents from trash into folder targetFolderId. # Put folderv1files Source: https://api.aodocs.com/api-reference/folder/put-folderv1files /openapis/folder.json put /folder/v1/files/{folderId} Creates a folder # Put folderv1libraries folders Source: https://api.aodocs.com/api-reference/folder/put-folderv1libraries-folders /openapis/folder.json put /folder/v1/libraries/{libraryId}/folders (Deprecated - use create) Creates a folder in library libraryId with parent parentFolderAodocsId # Introduction Source: https://api.aodocs.com/api-reference/introduction The AODocs REST API exposes most of the features of AODocs. It can be used to implement custom applications, third-party integration, bulk tools, or just to experiment with AODocs. ## AODocs REST API 69.13 ```text Base URL theme={null} aodocs.altirnao.com/api ``` # Job Source: https://api.aodocs.com/api-reference/job Lets you access information about jobs and cancel them. ## Download the OpenAPI specifications # Get jobv1 Source: https://api.aodocs.com/api-reference/job/get-jobv1 /openapis/job.json get /job/v1/{jobId} Gets job details # Get jobv1events Source: https://api.aodocs.com/api-reference/job/get-jobv1events /openapis/job.json get /job/v1/events/{jobId} Lists the events associated to a job # Get jobv1libraries Source: https://api.aodocs.com/api-reference/job/get-jobv1libraries /openapis/job.json get /job/v1/libraries/{libraryId} Lists jobs in the library matching some filter and sort criteria # Post jobv1 cancel Source: https://api.aodocs.com/api-reference/job/post-jobv1-cancel /openapis/job.json post /job/v1/{jobId}/cancel Cancels a job (only for library administrators) # Library Source: https://api.aodocs.com/api-reference/library Lets you list existing libraries, create new libraries, get storage account e-mail (beta version, subject to change) ## Download the OpenAPI specifications # Delete libraryv1 Source: https://api.aodocs.com/api-reference/library/delete-libraryv1 /openapis/library.json delete /library/v1/{libId} Deletes a library from the domain. # Delete libraryv1 categoryvaluemappings Source: https://api.aodocs.com/api-reference/library/delete-libraryv1-categoryvaluemappings /openapis/library.json delete /library/v1/{libId}/categoryValueMappings/{mappingId} Deletes a category value mapping. # Delete libraryv1beta1 configuration Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-configuration /openapis/library.json delete /library/v1beta1/{libId}/configuration/{flagName} Deletes the specified custom configuration flag at library level. # Delete libraryv1beta1 customscripts Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-customscripts /openapis/library.json delete /library/v1beta1/{libId}/customScripts/{customScriptId} Deletes a custom script. # Delete libraryv1beta1 customuiactions Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-customuiactions /openapis/library.json delete /library/v1beta1/{libId}/customuiactions/{customUIActionId} Deletes a custom ui action. # Delete libraryv1beta1 inboundemails Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-inboundemails /openapis/library.json delete /library/v1beta1/{libId}/inboundEmails/{inboundEmailId} Deletes an inbound address. # Delete libraryv1beta1 lock Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-lock /openapis/library.json delete /library/v1beta1/{libId}/lock [Restricted] Release library-level document lock of a library # Delete libraryv1beta1 roles Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-roles /openapis/library.json delete /library/v1beta1/{libId}/roles/{roleId} Deletes a role from the library. # Delete libraryv1beta1 workflowemails Source: https://api.aodocs.com/api-reference/library/delete-libraryv1beta1-workflowemails /openapis/library.json delete /library/v1beta1/{libId}/workflowEmails/{workflowEmailId} Deletes a workflow email. # Get libraryv1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1 /openapis/library.json get /library/v1/{libId} Gets a library. # Get libraryv1 categoryvaluemappings Source: https://api.aodocs.com/api-reference/library/get-libraryv1-categoryvaluemappings /openapis/library.json get /library/v1/{libId}/categoryValueMappings Lists all category value mappings in the library. # Get libraryv1 categoryvaluemappings 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1-categoryvaluemappings-1 /openapis/library.json get /library/v1/{libId}/categoryValueMappings/{mappingId} Gets a category value mapping by ID. # Get libraryv1 categoryvaluemappings targets Source: https://api.aodocs.com/api-reference/library/get-libraryv1-categoryvaluemappings-targets /openapis/library.json get /library/v1/{libId}/categoryValueMappings/{mappingId}/targets Returns the target category values mapped to a given source value. # Get libraryv1 permission Source: https://api.aodocs.com/api-reference/library/get-libraryv1-permission /openapis/library.json get /library/v1/{libraryId}/permission Lists library permissions. # Get libraryv1beta1 classesandtemplates Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-classesandtemplates /openapis/library.json get /library/v1beta1/{libId}/classesAndTemplates Lists the classes and templates the current user can create document from (in the library). # Get libraryv1beta1 configuration Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-configuration /openapis/library.json get /library/v1beta1/{libId}/configuration Gets all custom configuration flags activated at domain or library level. # Get libraryv1beta1 configurationflags Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-configurationflags /openapis/library.json get /library/v1beta1/{libId}/configurationFlags Gets the custom configurations of a library with fallback on default value. # Get libraryv1beta1 customscripts Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-customscripts /openapis/library.json get /library/v1beta1/{libId}/customScripts Lists all custom scripts. # Get libraryv1beta1 customscripts 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-customscripts-1 /openapis/library.json get /library/v1beta1/{libId}/customScripts/{customScriptId} Gets a custom script by id. # Get libraryv1beta1 customuiactions Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-customuiactions /openapis/library.json get /library/v1beta1/{libId}/customuiactions Lists all custom ui actions. # Get libraryv1beta1 customuiactions 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-customuiactions-1 /openapis/library.json get /library/v1beta1/{libId}/customuiactions/{customUIActionId} Gets a custom ui action by id. # Get libraryv1beta1 glossary Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-glossary /openapis/library.json get /library/v1beta1/{libId}/glossary Gets the glossary of a library. # Get libraryv1beta1 inboundemails Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-inboundemails /openapis/library.json get /library/v1beta1/{libId}/inboundEmails Lists all inbound emails in a library. # Get libraryv1beta1 inboundemails 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-inboundemails-1 /openapis/library.json get /library/v1beta1/{libId}/inboundEmails/{inboundEmailId} Gets an inbound email by id. # Get libraryv1beta1 personfields Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-personfields /openapis/library.json get /library/v1beta1/{libId}/personFields Lists the person fields information used in every document class in the library. If documentId is set, the response will contain person fields' values. # Get libraryv1beta1 roles Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-roles /openapis/library.json get /library/v1beta1/{libId}/roles Lists the roles of the library. # Get libraryv1beta1 roles 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-roles-1 /openapis/library.json get /library/v1beta1/{libId}/roles/{roleId} Gets a role of the library. # Get libraryv1beta1 standardactions Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-standardactions /openapis/library.json get /library/v1beta1/{libraryId}/standardActions List the standard actions. # Get libraryv1beta1 standardactions 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-standardactions-1 /openapis/library.json get /library/v1beta1/{libraryId}/standardActions/{standardActionId} Gets a standard action of the library by id. # Get libraryv1beta1 workflowemails Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-workflowemails /openapis/library.json get /library/v1beta1/{libId}/workflowEmails Lists all workflow emails in a library. # Get libraryv1beta1 workflowemails 1 Source: https://api.aodocs.com/api-reference/library/get-libraryv1beta1-workflowemails-1 /openapis/library.json get /library/v1beta1/{libId}/workflowEmails/{workflowEmailId} Gets a workflow email by id. # Get libraryv2beta1search Source: https://api.aodocs.com/api-reference/library/get-libraryv2beta1search /openapis/library.json get /library/v2beta1/search List and search libraries in the domain # Get libraryv2beta1searcharchived Source: https://api.aodocs.com/api-reference/library/get-libraryv2beta1searcharchived /openapis/library.json get /library/v2beta1/searchArchived List and search archive libraries in the domain # Get libraryv2beta1suggest Source: https://api.aodocs.com/api-reference/library/get-libraryv2beta1suggest /openapis/library.json get /library/v2beta1/suggest Suggest libraries from the domain # Patch libraryv1 Source: https://api.aodocs.com/api-reference/library/patch-libraryv1 /openapis/library.json patch /library/v1/{libId} Updates a library (keep existing values for not specified fields). # Patch libraryv1beta1 :privilegedupdate Source: https://api.aodocs.com/api-reference/library/patch-libraryv1beta1-:privilegedupdate /openapis/library.json patch /library/v1beta1/{libId}:privilegedUpdate [Restricted] Updates a library (keep existing values for not specified fields), including the object storage location and the attachment search engine. # Patch libraryv1beta1 customuiactions Source: https://api.aodocs.com/api-reference/library/patch-libraryv1beta1-customuiactions /openapis/library.json patch /library/v1beta1/{libId}/customuiactions/{customUIActionId} Patches an existing custom ui action. # Patch libraryv1beta1 inboundemails Source: https://api.aodocs.com/api-reference/library/patch-libraryv1beta1-inboundemails /openapis/library.json patch /library/v1beta1/{libId}/inboundEmails/{inboundEmailId} Updates an inbound address with patch semantics. # Patch libraryv1beta1 roles Source: https://api.aodocs.com/api-reference/library/patch-libraryv1beta1-roles /openapis/library.json patch /library/v1beta1/{libId}/roles/{roleId} Updates a role of the library (keep existing values for not specified fields). # Patch libraryv1beta1 standardactions Source: https://api.aodocs.com/api-reference/library/patch-libraryv1beta1-standardactions /openapis/library.json patch /library/v1beta1/{libraryId}/standardActions/{standardActionId} Updates a standard action (keeps existing values for not specified fields). # Patch libraryv1beta1 workflowemails Source: https://api.aodocs.com/api-reference/library/patch-libraryv1beta1-workflowemails /openapis/library.json patch /library/v1beta1/{libId}/workflowEmails/{workflowEmailId} Updates a workflow email with patch semantics. # Post libraryv1 categoryvaluemappings Source: https://api.aodocs.com/api-reference/library/post-libraryv1-categoryvaluemappings /openapis/library.json post /library/v1/{libId}/categoryValueMappings Creates a new category value mapping between two category definitions in the library. # Post libraryv1 permission Source: https://api.aodocs.com/api-reference/library/post-libraryv1-permission /openapis/library.json post /library/v1/{libraryId}/permission Updates library permissions. # Post libraryv1beta1 :exportdocumentsandfolders Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-:exportdocumentsandfolders /openapis/library.json post /library/v1beta1/{libId}:exportDocumentsAndFolders Exports documents and/or folders from the library. # Post libraryv1beta1 changeattachmentmode Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-changeattachmentmode /openapis/library.json post /library/v1beta1/{libId}/changeAttachmentMode [Restricted] Modifies the attachment mode of a library. It can only be from a Team Folder or a Secured Folder to a Document Management Library. # Post libraryv1beta1 configuration Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-configuration /openapis/library.json post /library/v1beta1/{libId}/configuration Updates values of library level custom configuration flags. Unspecified flags previously defined at library level will be deleted! # Post libraryv1beta1 configuration 1 Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-configuration-1 /openapis/library.json post /library/v1beta1/{libId}/configuration/{flagName} Sets value for the specified custom configuration flag at library level. # Post libraryv1beta1 customscripts Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-customscripts /openapis/library.json post /library/v1beta1/{libId}/customScripts Creates a new custom script. # Post libraryv1beta1 customscripts:compile Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-customscripts:compile /openapis/library.json post /library/v1beta1/{libId}/customScripts:compile Compiles a custom script and returns with its outcome. # Post libraryv1beta1 customuiactions Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-customuiactions /openapis/library.json post /library/v1beta1/{libId}/customuiactions Creates a new custom ui action. # Post libraryv1beta1 exportdocumentsandfolders Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-exportdocumentsandfolders /openapis/library.json post /library/v1beta1/{libId}/exportDocumentsAndFolders Exports documents and/or folders from the library. # Post libraryv1beta1 glossary Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-glossary /openapis/library.json post /library/v1beta1/{libId}/glossary Sets the new glossary of a library. # Post libraryv1beta1 inboundemails Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-inboundemails /openapis/library.json post /library/v1beta1/{libId}/inboundEmails Creates an inbound address for a library. # Post libraryv1beta1 lock Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-lock /openapis/library.json post /library/v1beta1/{libId}/lock [Restricted] Create library-level document lock on a library, automatic operations are suspended # Post libraryv1beta1 roles Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-roles /openapis/library.json post /library/v1beta1/{libId}/roles Creates a new role in the library. # Post libraryv1beta1 workflowemails Source: https://api.aodocs.com/api-reference/library/post-libraryv1beta1-workflowemails /openapis/library.json post /library/v1beta1/{libId}/workflowEmails Creates a workflow email for a library. # Post libraryv1library Source: https://api.aodocs.com/api-reference/library/post-libraryv1library /openapis/library.json post /library/v1/library [Restricted] Creates a library on the domain. # Post libraryv1library 1 Source: https://api.aodocs.com/api-reference/library/post-libraryv1library-1 /openapis/library.json post /library/v1/library/{libraryName} Creates a library on the domain. # Put libraryv1 Source: https://api.aodocs.com/api-reference/library/put-libraryv1 /openapis/library.json put /library/v1 Lists libraries of the domain. # Put libraryv1 1 Source: https://api.aodocs.com/api-reference/library/put-libraryv1-1 /openapis/library.json put /library/v1/{libId} Updates a library (reset not specified fields). # Put libraryv1 categoryvaluemappings Source: https://api.aodocs.com/api-reference/library/put-libraryv1-categoryvaluemappings /openapis/library.json put /library/v1/{libId}/categoryValueMappings/{mappingId} Updates the display name and entries of a category value mapping. Other fields are read-only. # Put libraryv1beta1 customscripts Source: https://api.aodocs.com/api-reference/library/put-libraryv1beta1-customscripts /openapis/library.json put /library/v1beta1/{libId}/customScripts/{customScriptId} Updates an existing custom script. # Put libraryv1plain Source: https://api.aodocs.com/api-reference/library/put-libraryv1plain /openapis/library.json put /library/v1/plain Lists libraries of the domain (only ID-name pairs). # Reference Catalog Source: https://api.aodocs.com/api-reference/reference-catalog Lets you manage reference catalogs ## Download the OpenAPI specifications # Delete referencecatalogv1 Source: https://api.aodocs.com/api-reference/referencecatalog/delete-referencecatalogv1 /openapis/referenceCatalog.json delete /referenceCatalog/v1/{catalogId} Deletes a reference catalog in the domain. # Delete referencecatalogv1 items Source: https://api.aodocs.com/api-reference/referencecatalog/delete-referencecatalogv1-items /openapis/referenceCatalog.json delete /referenceCatalog/v1/{catalogId}/items/{referenceCatalogValueId} Permanently deletes a value of a reference catalog in the domain. # Get referencecatalogv1 Source: https://api.aodocs.com/api-reference/referencecatalog/get-referencecatalogv1 /openapis/referenceCatalog.json get /referenceCatalog/v1 Lists the reference catalogs available in the domain. # Get referencecatalogv1 1 Source: https://api.aodocs.com/api-reference/referencecatalog/get-referencecatalogv1-1 /openapis/referenceCatalog.json get /referenceCatalog/v1/{catalogId} Gets a reference catalog in the domain. # Get referencecatalogv1 items Source: https://api.aodocs.com/api-reference/referencecatalog/get-referencecatalogv1-items /openapis/referenceCatalog.json get /referenceCatalog/v1/{catalogId}/items Lists the values of a reference catalog in the domain. # Get referencecatalogv1 items 1 Source: https://api.aodocs.com/api-reference/referencecatalog/get-referencecatalogv1-items-1 /openapis/referenceCatalog.json get /referenceCatalog/v1/{catalogId}/items/{referenceCatalogValueId} Gets a value of a reference catalog in the domain. # Get referencecatalogv1 suggest Source: https://api.aodocs.com/api-reference/referencecatalog/get-referencecatalogv1-suggest /openapis/referenceCatalog.json get /referenceCatalog/v1/{catalogId}/suggest Lists suggested matching values of a reference catalog in the domain. # Post referencecatalogv1 Source: https://api.aodocs.com/api-reference/referencecatalog/post-referencecatalogv1 /openapis/referenceCatalog.json post /referenceCatalog/v1 Updates a reference catalog in the domain. # Post referencecatalogv1 items Source: https://api.aodocs.com/api-reference/referencecatalog/post-referencecatalogv1-items /openapis/referenceCatalog.json post /referenceCatalog/v1/{catalogId}/items Creates, updates or marked 'deleted' a list of values of a reference catalog in the domain. # Put referencecatalogv1 Source: https://api.aodocs.com/api-reference/referencecatalog/put-referencecatalogv1 /openapis/referenceCatalog.json put /referenceCatalog/v1 Creates a reference catalog in the domain. # Relation Source: https://api.aodocs.com/api-reference/relation Lets you list AODocs document relations ## Download the OpenAPI specifications # Delete relationv1beta1relationdefinitions Source: https://api.aodocs.com/api-reference/relation/delete-relationv1beta1relationdefinitions /openapis/relation.json delete /relation/v1beta1/relationDefinitions/{relationDefinitionId} Deletes a relation definition by id. # Get relationv1beta1document relation Source: https://api.aodocs.com/api-reference/relation/get-relationv1beta1document-relation /openapis/relation.json get /relation/v1beta1/document/{documentId}/relation/{relationId} Lists all related documents for a document. # Get relationv1beta1relationdefinitions Source: https://api.aodocs.com/api-reference/relation/get-relationv1beta1relationdefinitions /openapis/relation.json get /relation/v1beta1/relationDefinitions Lists relation definitions for a library or a document class. # Get relationv1beta1relationdefinitions 1 Source: https://api.aodocs.com/api-reference/relation/get-relationv1beta1relationdefinitions-1 /openapis/relation.json get /relation/v1beta1/relationDefinitions/{relationDefinitionId} Gets a relation definition by id. # Get relationv1document Source: https://api.aodocs.com/api-reference/relation/get-relationv1document /openapis/relation.json get /relation/v1/document/{documentId} Lists all related documents for a document. # Get relationv1libraries relations documents Source: https://api.aodocs.com/api-reference/relation/get-relationv1libraries-relations-documents /openapis/relation.json get /relation/v1/libraries/{libraryId}/relations/{relationId}/documents/{documentId} Lists all related documents for a document and a relation. # Get relationv1relations side documents Source: https://api.aodocs.com/api-reference/relation/get-relationv1relations-side-documents /openapis/relation.json get /relation/v1/relations/{relationId}/side/{side}/documents Lists all documents that can be linked for a relation. # Get relationv1relations side documents 1 Source: https://api.aodocs.com/api-reference/relation/get-relationv1relations-side-documents-1 /openapis/relation.json get /relation/v1/relations/{relationId}/side/{side}/documents/{documentId} Lists all documents that can be linked to a document for a relation. # Get relationv1relations side templates Source: https://api.aodocs.com/api-reference/relation/get-relationv1relations-side-templates /openapis/relation.json get /relation/v1/relations/{relationId}/side/{side}/templates/{templateId} Lists all documents that can be added to a template's relation configuration for a given relation/side. # Patch relationv1beta1relationdefinitions Source: https://api.aodocs.com/api-reference/relation/patch-relationv1beta1relationdefinitions /openapis/relation.json patch /relation/v1beta1/relationDefinitions/{relationDefinitionId} Updates a relation definition with patch semantics. # Post relationv1beta1relationdefinitions Source: https://api.aodocs.com/api-reference/relation/post-relationv1beta1relationdefinitions /openapis/relation.json post /relation/v1beta1/relationDefinitions Creates a relation definition. # Post relationv1document Source: https://api.aodocs.com/api-reference/relation/post-relationv1document /openapis/relation.json post /relation/v1/document/{documentId} Updates related documents for a document. # Search Source: https://api.aodocs.com/api-reference/search Lets you search and count documents ## Download the OpenAPI specifications # Post searchv1document Source: https://api.aodocs.com/api-reference/search/post-searchv1document /openapis/search.json post /search/v1/document Searches documents in the whole domain matching the provided query. # Post searchv1domain Source: https://api.aodocs.com/api-reference/search/post-searchv1domain /openapis/search.json post /search/v1/domain Searches documents in the domain with attachments matching the search query. The document metadata will not be searched using this method. # Post searchv1filterableproperties Source: https://api.aodocs.com/api-reference/search/post-searchv1filterableproperties /openapis/search.json post /search/v1/filterableproperties Lists all filterable properties available in the domain for document search. # Post searchv1libraries count Source: https://api.aodocs.com/api-reference/search/post-searchv1libraries-count /openapis/search.json post /search/v1/libraries/{libraryId}/count Counts documents of a document class. Only accessible to library administrators. # Post searchv1libraries list Source: https://api.aodocs.com/api-reference/search/post-searchv1libraries-list /openapis/search.json post /search/v1/libraries/{libraryId}/list Lists all documents of a document class. Only accessible to library administrators. # Post searchv1libraries search Source: https://api.aodocs.com/api-reference/search/post-searchv1libraries-search /openapis/search.json post /search/v1/libraries/{libraryId}/search Searches documents of a class matching the provided query. Might become very slow or timeout when iterating over many results pages. If the result set contains more than 10k documents, it's highly likely some results will be missing. You should always check if precision=INCOMPLETE_RESULT in the response. # Post searchv1libraries searchdrive Source: https://api.aodocs.com/api-reference/search/post-searchv1libraries-searchdrive /openapis/search.json post /search/v1/libraries/{libraryId}/search/drive Starts to cache search results asynchronously in a job. Returns the jobId. # Post searchv1libraries views Source: https://api.aodocs.com/api-reference/search/post-searchv1libraries-views /openapis/search.json post /search/v1/libraries/{libraryId}/views/{viewId} Searches documents in a view matching the provided query. Might become very slow or timeout when iterating over many results pages. If the result set contains more than 10k documents, it's highly likely some results will be missing. You should always check if precision=INCOMPLETE_RESULT in the response. # Post searchv2alphalibraries search Source: https://api.aodocs.com/api-reference/search/post-searchv2alphalibraries-search /openapis/search.json post /search/v2alpha/libraries/{libraryId}/search Searches documents in a view or a class matching the provided query. If the result set contains more than 10k documents, it's highly likely some results will be missing. You should always check if precision=INCOMPLETE_RESULT in the response. # Templating Source: https://api.aodocs.com/api-reference/templating Lets you execute file templating on a file ## Download the OpenAPI specifications # Post templatingv1 Source: https://api.aodocs.com/api-reference/templating/post-templatingv1 /openapis/templating.json post /templating/v1 Execute file templating on the file. # User Source: https://api.aodocs.com/api-reference/user Lets you get information about users and groups (beta version, subject to change) ## Download the OpenAPI specifications # Delete userv1 starred Source: https://api.aodocs.com/api-reference/user/delete-userv1-starred- /openapis/user.json delete /user/v1/{user}/starred/{type}/{objectId} Unstars a entity based on its type and ID for the given user. # Get userv1 Source: https://api.aodocs.com/api-reference/user/get-userv1 /openapis/user.json get /user/v1/{userId} Gets user information for the given user. # Get userv1 starred Source: https://api.aodocs.com/api-reference/user/get-userv1-starred /openapis/user.json get /user/v1/{user}/starred/{type} Lists starred entities based on its type for the given user. # Get userv1beta1emailqualification Source: https://api.aodocs.com/api-reference/user/get-userv1beta1emailqualification /openapis/user.json get /user/v1beta1/emailQualification/{email} Gets information about an email address (Google user, member of the domain, allowlisted...). # Get userv1beta1meroles Source: https://api.aodocs.com/api-reference/user/get-userv1beta1meroles /openapis/user.json get /user/v1beta1/me/roles Lists domain role information for the current user of the given domain. # Get userv1beta1meroles 1 Source: https://api.aodocs.com/api-reference/user/get-userv1beta1meroles-1 /openapis/user.json get /user/v1beta1/me/roles/{libraryId} Lists role information for the current user of the given library. # Get userv1combinedsuggest Source: https://api.aodocs.com/api-reference/user/get-userv1combinedsuggest /openapis/user.json get /user/v1/combinedSuggest Lists the users, groups and roles of the library matching a pattern. # Get userv1group members Source: https://api.aodocs.com/api-reference/user/get-userv1group-members /openapis/user.json get /user/v1/group/{groupEmail}/members Lists the users and groups which are members of the given Google group. # Get userv1groupsuggest Source: https://api.aodocs.com/api-reference/user/get-userv1groupsuggest /openapis/user.json get /user/v1/groupSuggest Lists the groups either in library role, in a group or in a document's permissions matching a pattern. # Get userv1licenseusersuggest Source: https://api.aodocs.com/api-reference/user/get-userv1licenseusersuggest /openapis/user.json get /user/v1/licenseUserSuggest Lists the licensed users matching the query # Get userv1me Source: https://api.aodocs.com/api-reference/user/get-userv1me /openapis/user.json get /user/v1/me Gets user information for the current user. # Get userv1storageaccounts Source: https://api.aodocs.com/api-reference/user/get-userv1storageaccounts /openapis/user.json get /user/v1/storageAccounts Lists storage accounts a user can use to create a library on a domain # Get userv1userandgroupsuggest Source: https://api.aodocs.com/api-reference/user/get-userv1userandgroupsuggest /openapis/user.json get /user/v1/userAndGroupSuggest Lists the users and groups either in library role, in a group or in a document's permissions matching a pattern. # Get userv1usersuggest Source: https://api.aodocs.com/api-reference/user/get-userv1usersuggest /openapis/user.json get /user/v1/userSuggest Lists the users either in library role, in a group or in a document's permissions matching a pattern. # Get userv1workflowtasks Source: https://api.aodocs.com/api-reference/user/get-userv1workflowtasks /openapis/user.json get /user/v1/workflowTasks Counts the number of documents that require a workflow transition by the given user, grouped by library, workflow, state (up to 1000 tasks). # Patch userv1me Source: https://api.aodocs.com/api-reference/user/patch-userv1me /openapis/user.json patch /user/v1/me Updates user preferences partially (all non-specified field values will remain unchanged) - only works with editable properties. # Post userv1 starred Source: https://api.aodocs.com/api-reference/user/post-userv1-starred- /openapis/user.json post /user/v1/{user}/starred/{type}/{objectId} Stars a entity based on its type and ID for the given user. # Post userv1group refresh Source: https://api.aodocs.com/api-reference/user/post-userv1group-refresh /openapis/user.json post /user/v1/group/{groupEmail}/refresh Schedules a refresh of the group's member cache. Only available for domain super administrators. # View Source: https://api.aodocs.com/api-reference/view Lets you list existing views, update views, create new views ## Download the OpenAPI specifications # Delete viewv1libraries views Source: https://api.aodocs.com/api-reference/view/delete-viewv1libraries-views /openapis/view.json delete /view/v1/libraries/{libraryId}/views/{viewId} Deletes a view. # Get viewv1libraries Source: https://api.aodocs.com/api-reference/view/get-viewv1libraries /openapis/view.json get /view/v1/libraries/{libraryId} Lists the ID/names of the views available in the library. # Get viewv1libraries views Source: https://api.aodocs.com/api-reference/view/get-viewv1libraries-views /openapis/view.json get /view/v1/libraries/{libraryId}/views/{viewId} Gets a view. # Patch viewv1 Source: https://api.aodocs.com/api-reference/view/patch-viewv1 /openapis/view.json patch /view/v1 Updates a view (keep existing values for not specified fields). # Post viewv1 Source: https://api.aodocs.com/api-reference/view/post-viewv1 /openapis/view.json post /view/v1 Updates a view configuration (reset not specified fields). # Put viewv1 Source: https://api.aodocs.com/api-reference/view/put-viewv1 /openapis/view.json put /view/v1 Creates a new view in the library. # Workflow Source: https://api.aodocs.com/api-reference/workflow Lets you perform workflow actions and access workflow configuration (beta version, subject to change) ## Download the OpenAPI specifications # Delete workflowv1beta1humanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/delete-workflowv1beta1humanworkflowactions /openapis/workflow.json delete /workflow/v1beta1/humanWorkflowActions/{humanWorkflowActionId} Deletes a human workflow action. # Delete workflowv2beta1workflows Source: https://api.aodocs.com/api-reference/workflow/delete-workflowv2beta1workflows /openapis/workflow.json delete /workflow/v2beta1/workflows/{workflowId} Deletes a workflow. # Delete workflowv2beta1workflows states Source: https://api.aodocs.com/api-reference/workflow/delete-workflowv2beta1workflows-states /openapis/workflow.json delete /workflow/v2beta1/workflows/{workflowId}/states Deletes a workflow state. # Delete workflowv2beta1workflows states transitions Source: https://api.aodocs.com/api-reference/workflow/delete-workflowv2beta1workflows-states-transitions /openapis/workflow.json delete /workflow/v2beta1/workflows/{workflowId}/states/{stateId}/transitions/{transitionId} Deletes a workflow transition by workflow, state and transition ID. # Delete workflowv2beta1workflowshumanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/delete-workflowv2beta1workflowshumanworkflowactions /openapis/workflow.json delete /workflow/v2beta1/workflows/humanWorkflowActions/{humanWorkflowActionId} Deletes a human workflow action. # Get workflowv1beta1humanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1beta1humanworkflowactions /openapis/workflow.json get /workflow/v1beta1/humanWorkflowActions Lists the human workflow actions available in the library. # Get workflowv1beta1humanworkflowactions 1 Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1beta1humanworkflowactions-1 /openapis/workflow.json get /workflow/v1beta1/humanWorkflowActions/{humanWorkflowActionId} Gets a human workflow action by ID. # Get workflowv1beta1libraries workbasketcount Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1beta1libraries-workbasketcount /openapis/workflow.json get /workflow/v1beta1/libraries/{libraryId}/workbasket/count Counts the documents on which the user can trigger a workflow transition. # Get workflowv1documents transitions Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1documents-transitions /openapis/workflow.json get /workflow/v1/documents/{documentId}/transitions Lists the transitions available for a document. (Deprecated) Use document API v2 document.documents.listTransitions instead. # Get workflowv1libraries Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1libraries /openapis/workflow.json get /workflow/v1/libraries/{libraryId} Lists the workflows defined in the library. (Deprecated) Use workflow API v2 workflow.workflows.list instead. # Get workflowv1libraries workbasket Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1libraries-workbasket /openapis/workflow.json get /workflow/v1/libraries/{libraryId}/workbasket Lists the documents on which the user can trigger a workflow transition. # Get workflowv1libraries workflows Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1libraries-workflows /openapis/workflow.json get /workflow/v1/libraries/{libraryId}/workflows/{workflowId} Gets a workflow by ID. (Deprecated) Use workflow API v2 workflow.workflows.get instead. # Get workflowv1libraries workflows states Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1libraries-workflows-states /openapis/workflow.json get /workflow/v1/libraries/{libraryId}/workflows/{workflowId}/states Lists the workflow states of a workflow in the library. (Deprecated) Use workflow API v2 workflow.workflows.get instead. # Get workflowv1workflows transitions fields Source: https://api.aodocs.com/api-reference/workflow/get-workflowv1workflows-transitions-fields /openapis/workflow.json get /workflow/v1/workflows/{workflowId}/transitions/{transitionId}/fields Gets the Person fields of the document involved in any transitions of the workflow. # Get workflowv2beta1workflows Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflows /openapis/workflow.json get /workflow/v2beta1/workflows Lists the workflows available for a library and potentially a document class. # Get workflowv2beta1workflows 1 Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflows-1 /openapis/workflow.json get /workflow/v2beta1/workflows/{workflowId} Gets a workflow by ID. # Get workflowv2beta1workflows states Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflows-states /openapis/workflow.json get /workflow/v2beta1/workflows/{workflowId}/states Lists the workflow states belonging to a workflow. # Get workflowv2beta1workflows states 1 Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflows-states-1 /openapis/workflow.json get /workflow/v2beta1/workflows/{workflowId}/states/{stateId} Gets a workflow state by workflow and state ID. # Get workflowv2beta1workflows states transitions Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflows-states-transitions /openapis/workflow.json get /workflow/v2beta1/workflows/{workflowId}/states/{stateId}/transitions Lists the workflow transitions of a workflow state by workflow and state ID. # Get workflowv2beta1workflows states transitions 1 Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflows-states-transitions-1 /openapis/workflow.json get /workflow/v2beta1/workflows/{workflowId}/states/{stateId}/transitions/{transitionId} Gets a workflow transition by workflow, state and transition ID. # Get workflowv2beta1workflowshumanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflowshumanworkflowactions /openapis/workflow.json get /workflow/v2beta1/workflows/humanWorkflowActions Lists the human workflow actions available in the library. # Get workflowv2beta1workflowshumanworkflowactions 1 Source: https://api.aodocs.com/api-reference/workflow/get-workflowv2beta1workflowshumanworkflowactions-1 /openapis/workflow.json get /workflow/v2beta1/workflows/humanWorkflowActions/{humanWorkflowActionId} Gets a human workflow action by ID. # Patch workflowv1beta1humanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/patch-workflowv1beta1humanworkflowactions /openapis/workflow.json patch /workflow/v1beta1/humanWorkflowActions/{humanWorkflowActionId} Updates partially a human workflow action (all non-specified field values will remain unchanged). # Patch workflowv2beta1workflows Source: https://api.aodocs.com/api-reference/workflow/patch-workflowv2beta1workflows /openapis/workflow.json patch /workflow/v2beta1/workflows/{workflowId} Updates partially a workflow configuration (all non-specified field values will remain unchanged). # Patch workflowv2beta1workflows states Source: https://api.aodocs.com/api-reference/workflow/patch-workflowv2beta1workflows-states /openapis/workflow.json patch /workflow/v2beta1/workflows/{workflowId}/states/{stateId} Updates partially a workflow state configuration (all non-specified field values will remain unchanged). # Patch workflowv2beta1workflows states transitions Source: https://api.aodocs.com/api-reference/workflow/patch-workflowv2beta1workflows-states-transitions /openapis/workflow.json patch /workflow/v2beta1/workflows/{workflowId}/states/{stateId}/transitions/{transitionId} Updates partially a workflow transition (all non-specified field values will remain unchanged). # Patch workflowv2beta1workflowshumanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/patch-workflowv2beta1workflowshumanworkflowactions /openapis/workflow.json patch /workflow/v2beta1/workflows/humanWorkflowActions/{humanWorkflowActionId} Updates partially a human workflow action (all non-specified field values will remain unchanged). # Post workflowv1beta1humanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/post-workflowv1beta1humanworkflowactions /openapis/workflow.json post /workflow/v1beta1/humanWorkflowActions Creates a new human workflow action in the library. # Post workflowv1documents states Source: https://api.aodocs.com/api-reference/workflow/post-workflowv1documents-states /openapis/workflow.json post /workflow/v1/documents/{documentId}/states/{stateId} Changes the workflow state of a document (as administrator). # Post workflowv1documents states message Source: https://api.aodocs.com/api-reference/workflow/post-workflowv1documents-states-message /openapis/workflow.json post /workflow/v1/documents/{documentId}/states/{stateId}/message/{message} Changes the workflow state of a document (as administrator). # Post workflowv1documents transitions Source: https://api.aodocs.com/api-reference/workflow/post-workflowv1documents-transitions /openapis/workflow.json post /workflow/v1/documents/{documentId}/transitions/{transitionId} Executes a workflow transition for a document. # Post workflowv1documents transitions message Source: https://api.aodocs.com/api-reference/workflow/post-workflowv1documents-transitions-message /openapis/workflow.json post /workflow/v1/documents/{documentId}/transitions/{transitionId}/message/{message} Executes a workflow transition for a document. # Post workflowv2beta1workflows Source: https://api.aodocs.com/api-reference/workflow/post-workflowv2beta1workflows /openapis/workflow.json post /workflow/v2beta1/workflows Creates a new workflow in the library for the given document class. # Post workflowv2beta1workflows states Source: https://api.aodocs.com/api-reference/workflow/post-workflowv2beta1workflows-states /openapis/workflow.json post /workflow/v2beta1/workflows/{workflowId}/states Creates a new workflow state for the given workflow. # Post workflowv2beta1workflows states transitions Source: https://api.aodocs.com/api-reference/workflow/post-workflowv2beta1workflows-states-transitions /openapis/workflow.json post /workflow/v2beta1/workflows/{workflowId}/states/{stateId}/transitions Create a new workflow transition for the workflow and workflow state. # Post workflowv2beta1workflowshumanworkflowactions Source: https://api.aodocs.com/api-reference/workflow/post-workflowv2beta1workflowshumanworkflowactions /openapis/workflow.json post /workflow/v2beta1/workflows/humanWorkflowActions Creates a new human workflow action in the library. # Authentication Source: https://api.aodocs.com/authentication Every request sent to the AODocs **API** must include some method of authentication to verify the identity of a **user with access to AODocs** (via a Google Workspace or Microsoft Entra account), and to authorize any activity done on their behalf. This is required regardless of whether the **API requestor** is a person manually interacting with the API portal; or a client app interacting on their behalf. API authentication model ## Available authentication mechanisms You can gain credentials to be authenticated with AODocs APIs in two ways, depending on your circumstances and needs: * AODocs security code (quickest for internal testing, but least secure) that is a mechanism specific to the AODocs API * Bearer tokens (in OAuth 2.0 or JWT format) that are issued by Google or Microsoft and can be used to authenticate with the AODocs API (Google-issued tokens can additionally be used for any other Google-compatible API) ### Security code This is the custom system created by AODocs for the purposes of quick internal testing and similar use-cases behind your firewall. If you don’t need access to Google Drive APIs, this is the quickest way to get started. Read more about how to [access APIs with AODocs security code](/authentication/access-apis-with-security-codes/). ### Bearer tokens (access or ID tokens) Access or ID tokens sent in the request header are the robust, secure mechanism to authenticate with AODocs APIs and consequently gain access to both AODocs and Google Drive APIs. Obtaining **access tokens** takes more work with more server calls, but they can also have authorization scopes, like access to Drive or Gmail APIs; meanwhile, **ID tokens** are self-contained and can be verified in place, but they only convey the identity of the user it was issued for. AODocs also accepts **Microsoft Entra ID tokens** (v1.0 and v2.0). Like Google ID tokens, they grant access to AODocs APIs only — they cannot be used to call Google Drive APIs. **Note**: Unlike the plug-and-play functionality of the AODocs security code, bearer tokens require pre-registration with AODocs — GCP client IDs for Google tokens, and Microsoft tenants/applications for Microsoft tokens. Read more about how to [access AODocs APIs with access and ID tokens](/authentication/access-apis-with-bearer-tokens/). ## What to use when There are several distinct use cases for authenticating and authorizing API access with AODocs, each with its own requirements and approaches. The **quickest** way to get started is with the **security code** method, but it can be used only on **AODocs APIs**, not Google Drive APIs. If you need to interact with the **Google Drive API** as well as the **AODocs API**, you have to use an access token that authorizes access via [at least one Drive scope](https://developers.google.com/drive/api/v2/about-auth) . The AODocs API only requires the identity scope “[https://www.googleapis.com/auth/userinfo.email](https://www.googleapis.com/auth/userinfo.email) ” in access tokens. Finally, if you need robust and secure access to **AODocs APIs-only** (without being able to access Drive APIs), you have the option of ID tokens. If your users authenticate against **Microsoft Entra** instead of Google Workspace, use a Microsoft ID token. This covers AODocs APIs (and the AODocs object-storage service) but not Google Drive. ## General principles Make sure you provide to your users a level of API access that is functional but **least-elevated possible**, raising their level temporarily only when necessary. **Note**: Because of risk-benefit ratios, giving users more permissions than they actually need is rarely recommended. Therefore, for security reasons, we strongly encourage the use of the lowest possible levels of access, in this case user-level. Read more about the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege) . # Access APIs with Bearer tokens Source: https://api.aodocs.com/authentication/access-apis-with-bearer-tokens **Note**: Unlike the out of the box security code solution, access and ID tokens require setting up an allow-list on AODocs: GCP client IDs for Google tokens, and Microsoft tenants/applications for Microsoft tokens. This is not currently possible out of the box — contact AODocs support to register them. In general, a Bearer token is a piece of data that acts as a permit to operate on resources, passed in the Authorization header of requests. Two main types of Bearer tokens exist: * **JWT ID Tokens**: these tokens only convey the identity of the user, and are encoded strings in the JWT format * **OAuth 2.0 Access Token**: these tokens have authorization scopes associated with them, and can provide access to Google API resources, like Drive, Gmail, etc. A user who has access to resources on a resource server tells the authorization server it’s OK for the client app to have the same access. The client app then gets a permit (token) it can present to the resource server with each request. The main reason to use access or ID tokens (instead of security code) is to provide the client app with secure delegated access to server resources on your behalf. It allows authorizing a client app to access and manipulate server resources within a specific scope/time, and without exposing the user’s credentials to the app. ## Google OAuth 2.0 flow When a client app gets the user to authenticate, Google can generate two types of tokens: * an ID token (JWT) without any authorization scope (conveys only identity); * an access token with a set of scopes (AODocs requires at least the email address visibility scope — [https://www.googleapis.com/auth/userinfo.email](https://www.googleapis.com/auth/userinfo.email) — to authorize a user to perform any operation) Both types of tokens can be generated in a single authentication request, but only one of them is usually necessary. After this step, the AODocs authentication flow is similar, but with some key differences. Each request to AODocs APIs must satisfy two requirements: identify the user, and certify that the provided token was generated by Google. Either of the tokens issued by Google is capable of providing this proof, so the client app can choose which token serves its purposes better. **Tip:** The ID token is sufficient to perform AODocs-only actions. Meanwhile, the access token has the same capability, but additionally allows AODocs to impersonate the user to get access to the Drive scopes required to call Drive APIs. ## Get a Google access or ID token There are many ways of obtaining an OAuth 2.0 token. Describing all the use cases is beyond the scope of this article. You can read more about Google’s approach on the following Google documentation pages: * [Setting up OAuth 2.0 - API Console Help](https://support.google.com/googleapi/answer/6158849?hl=en) * [Using OAuth 2.0 to Access Google APIs | Google Identity Platform](https://developers.google.com/identity/protocols/OAuth2) * [OAuth 2.0 for Client-side Web Applications | Google Identity Platform](https://developers.google.com/identity/protocols/OAuth2UserAgent) * [Using OAuth 2.0 for Web Server Applications | Google Identity Platform](https://developers.google.com/identity/protocols/OAuth2WebServer) ## Use a Google access or ID token When you receive tokens from Google, they should look something along the lines of the following. ### Sample tokens from Google ```json theme={null} { "access_token": "ya29.Il-3B5J8...Fhl3a-yRjpg", "id_token": "eyJhbGc8i...AaNVQ" "expires_in": 3600, "token_type": "Bearer", "scope": "openid https://www.googleapis.com/auth/userinfo.email", "refresh_token": "1//04c68...AGAQSNwF-L9Ir2s...M9yc8AqB-u04JncA...68nWovE" } ``` **Note**: Access tokens usually start with the string `ya29.`, and because they’re opaque (not actual data but pointers to data elsewhere), they’re usually shorter than ID tokens. The latter are longer because they contain actual data, encoded into three pieces: header, claims, and signature. Once you have obtained a token, you select which token is more appropriate for your use case: * access token for AODocs *and* Drive * ID token for just AODocs You can access AODocs APIs by including one of the tokens as an `Authorization` HTTP header’s `Bearer` value: ```yaml theme={null} Authorization: Bearer < access_token | id_token > ``` ### Example request with token as header parameter ```yaml theme={null} GET https://aodocs.altirnao.com/api/document/v1 HTTP/1.1 Authorization: Bearer [YOUR_TOKEN] \ Accept: application/json \ Content-Type: application/json \ ``` ```json theme={null} { "libraryId": "Rngc1ug8K6WmL3IjZ8" } ``` ## Microsoft OAuth 2.0 ID tokens AODocs accepts **Microsoft Entra ID tokens** (v1.0 and v2.0) issued for an allow-listed tenant and application. Only ID tokens are supported — Microsoft access tokens are not accepted. A Microsoft token grants AODocs-only access; it cannot be used to reach Google Drive scopes. **Note**: Your Microsoft tenant (and the application issuing the ID tokens) must be registered with AODocs support before tokens will be accepted. ### Obtain a Microsoft ID token The token must be a JWT `id_token` issued by Microsoft Entra. Access tokens are not accepted. Refer to Microsoft's official documentation for the supported acquisition flows: * [Microsoft identity platform overview](https://learn.microsoft.com/entra/identity-platform/) * [Microsoft identity platform ID tokens](https://learn.microsoft.com/entra/identity-platform/id-tokens) AODocs requires the client app to request the following OAuth scopes when signing the user in with Microsoft Entra: ```text theme={null} openid profile email ``` `openid` is mandatory to receive an ID token at all; `profile` and `email` ensure the identity claims AODocs needs (notably `oid` and `upn`) are populated in the token. ### Required claims AODocs validates and uses the following claims from the Microsoft ID token: | Claim | Required | Used for | | ----- | -------- | ---------------------------------------------------------------------------------- | | `iss` | yes | Must start with `https://login.microsoftonline.com/` or `https://sts.windows.net/` | | `tid` | yes | Validated against the allow-listed tenant | | `ver` | yes | Must be `1.0` or `2.0` | | `oid` | yes | Mapped to the AODocs user identifier | | `upn` | yes | Mapped to the AODocs user email — must be non-empty and match a known AODocs user | The `email` claim is ignored for identity purposes (Microsoft does not guarantee its verification); identity is taken from `upn`. ### Use a Microsoft ID token Pass the Microsoft ID token in the `Authorization` header with the `Bearer` scheme, exactly as for Google tokens: ```yaml theme={null} Authorization: Bearer ``` #### Example request with a Microsoft ID token ```yaml theme={null} GET https://aodocs.altirnao.com/api/document/v1 HTTP/1.1 Authorization: Bearer [YOUR_MICROSOFT_ID_TOKEN] \ Accept: application/json \ Content-Type: application/json \ ``` ```json theme={null} { "libraryId": "Rngc1ug8K6WmL3IjZ8" } ``` **Tip:** The same Microsoft ID token is also accepted by the AODocs object-storage service API (alongside Google tokens). Contact AODocs support for the base URL applicable to your deployment. ## Token expiration All Bearer tokens have a built-in expiration. For Google access tokens, if you requested offline access to token scopes, you can [refresh](https://developers.google.com/identity/protocols/OAuth2InstalledApp#offline) tokens as necessary without having to prompt the user for permission. Microsoft ID tokens (typically valid for one hour) cannot be refreshed by AODocs — the client must obtain a new token from Microsoft Entra when the previous one expires. ## Authentication errors with access/ID tokens Token errors occur only when the token is: * missing * incorrect * expired All of these result in status code `401: Unauthorized` as listed in [HTTP status codes and error scenarios](/best-practices/http-status-codes-and-error-handling/). To create, manage, and troubleshoot your tokens, see the [Google Developers OAuth 2.0 Playground](https://developers.google.com/oauthplayground/) . # Access APIs with security codes Source: https://api.aodocs.com/authentication/access-apis-with-security-codes Security codes are the quickest way to authenticate with AODocs APIs. You create the security code in the AODocs Domain administration page, then you pass it along with each request as a **header parameter** to identify yourself. Using security codes for authentication is inherently less secure than the OAuth 2.0 mechanism, and they do not allow any access to Google Drive APIs. However, for testing purposes and other simple internal use-cases, security codes are the quickest way to get started with AODocs APIs. ## Get a security code You can generate a security code with an expiry date by following the [Manage security codes](https://support.aodocs.com/hc/en-us/articles/205650054-Manage-security-codes) article in the AODocs Knowledge Base. ### Select the correct security code type Security codes can be generated for two levels of AODocs authorization: * User-level (strongly encouraged) * Domain administrator **Note**: Because of risk-benefit ratios, giving users more permissions than they actually need is rarely recommended. Therefore, for security reasons, we strongly encourage the use of the lowest possible levels of access, in this case user-level. Read more about the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege) . ### Use case: Library isolation It is not possible to restrict a security code to access only a specific library (but not other libraries). To get around this limitation, you should restrict access at the user level: that is, create a technical *user* in GSuite that has access only to the needed libraries and not to restricted ones. Create a user-level security code for this user in order to access the API. The user’s access is already determined by this point, and the security code does not have to take care of any authorization nuances.. In effect, what you end up with is a user who has access to just one library. This is a good pattern to use if you have an integration that needs access to a specific resource or collection. It also minimizes pressure to reuse security codes that have scope that is broader than necessary. ### Use case: Domain-wide access In general, we recommend using levels of access that are as low as possible. However, in certain cases, it makes sense to create a security code with **domain-admin levels of access**. For example, you might have an auditing tool that needs to fetch all the audits for all the libraries. Or you might have a dedicated integration between AODocs and an internal CRM, and you want to update some AODocs documents whenever something happens in the CRM. Or any other **carefully designed and secured integration**. Additionally, some **support/troubleshooting** scenarios also require domain-admin privileges, but **only with an explicit expiration date**. Whatever the exception, make sure that the choice is made deliberately, with thorough consideration of the risks involved. ## Use the security code When you’re playing with the API Explorer, it sends the security code you provide as a ***query parameter***. However, when you start coding to communicate directly with the API, we recommend you send it as a ***header parameter***. ### Send the security code as a header parameter (recommended) **Note**: We strongly recommend this method because query parameters get captured by web server logs, whereas headers do not. Send the security code in the header as follows: ```yaml theme={null} Authorization: securityCode [YOUR SECURITY CODE] ``` #### Example request with security code as header parameter ```yaml theme={null} GET https://aodocs.altirnao.com/api/document/v1/ \ HTTP/1.1 Authorization: securityCode [YOUR_SECURITY_CODE] \ Content-Type: application/json \ ``` ```json theme={null} { "libraryId": "Rngc1ug8K6WmL3IjZ8" } ``` If you’ve started working with the API client factory which we provide with the Java API client, [you can use this feature out of the box](https://github.com/AODocs-Dev/aodocs-api-java-clients/blob/master/aodocs-api-client-factory/src/main/java/com/altirnao/aodocs/api/client/AODocsApiClientFactory.java#L88) . ### Not recommended: Sending the security code as a query parameter **Note**: Unless you are protected by a sandbox (such as the API Explorer), we recommend that you do not send your security code as a query parameter. Query parameters tend to get recorded and become exposed in web server logs, ultimately presenting a security risk. To send the security code as a query parameter, append the security code to the query as follows: ```yaml theme={null} securityCode=[YOUR SECURITY CODE] ``` #### Example request with security code as query parameter ```yaml theme={null} GET https://aodocs.altirnao.com/api/document/v1/Rn5...aBvSQ?securityCode=12345likemyluggage ``` ### Authentication errors with security codes Security code errors occur only when the security code is: * missing * incorrect * expired To create, manage, and troubleshoot your security codes, see the aforementioned [Manage security codes](https://support.aodocs.com/hc/en-us/articles/205650054-Manage-security-codes) article in the AODocs Knowledge Base. # In-depth: OAuth implementation RFCs and BCPs Source: https://api.aodocs.com/authentication/auth-appendix ## Client implementations ## Server implementations # Authentication use case examples/options/flows Source: https://api.aodocs.com/authentication/sample-use-cases To access AODocs APIs via OAuth 2.0, you need to provide an access token with each request. There are various flows to get an access token. If you’re implementing an application that requires a user’s consent to connect to AODocs and securely perform operations on AODocs documents, and/or you wish to send requests to AODocs as a user of your domain without asking for authorization, here are some use cases that use different authentication methods, so you can apply the right tool to the right job. * refresh tokens generating access tokens * whitelisting API users via Google Groups * others # Best practices Source: https://api.aodocs.com/best-practices In this section, we explore some of the advanced usage of AODocs APIs, including the following: # HTTP status codes and error handling Source: https://api.aodocs.com/best-practices/http-status-codes-and-error-handling The HTTP status code that comes back along with the response indicates whether your request **succeeded**, **failed**, or **something else happened**. Generally the **200-series codes** indicate some degree of **success**., with **200** and **201 and 204** being the usual ones, because the server not only **understood** and **accepted** the request, but also was **completely successful in executing the operation**. The **400-series codes** indicate the server understood your request correctly, but could fulfil it for some reason which resulted in a failure. This kind of failure should usually not be retried, except in specific cases (se below). The **500-series codes** indicate an unexpected failure on the server, that might be temporary or not. This kind of failure should usually be retried. When a request **succeeds** it normally returns a JSON-formatted **representation of the requested resource**. When it **fails**, the response is instead a JSON-formatted **error message** for troubleshooting purposes. The appropriate HTTP status code is always part of the response. For example, if you try to **identify** yourself to AODocs with **incorrect security code**, you will receive a reply that the request was disallowed, with a status code of **403 Forbidden**, with an elaboration in the form of a `message` field meant only for humans: ```json theme={null} 403 { "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Invalid security code." } ], "code": 403, "message": "Invalid security code." } } ``` **Note**: The status code is the only truly reliable, machine-readable indication of what happened to the request. The `reason` and `message` fields are provided to help troubleshoot what happened. They are both human-readable elaborations on the status code. The `reason` field is concise and generally has a default value that maps to its associated status code. However, it can also be overridden by AODocs APIs to provide a more precise reason than its default, generic phrase. The `reason` field also aims to be stable enough (part of the API “contract”) to be machine-readable for error analysis, but might get amended between major AODocs versions (usually to make it more precise). The `message` field is verbose and human-readable but not machine-usable in any stable or meaningful way. It can change without warning (including without major version release) and applications should not depend on its content. ## Common status codes in the AODocs API | Code | Message | Description | Recommended action | | ---- | --------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | 200 | OK | Everything worked out great. | Nothing to do. | | 204 | No content | We did what you asked but there is no response. Usually used for resource deletion. | Double-check the effects of your action. | | 400 | Bad Request | You provided something wrong in the input — something in the query is missing or not valid. | Look at the error message to see what's wrong, but it's usually your parameters. | | 401 | Unauthorized | Authentication has failed or has not been provided. | Check if you included your credentials, and if they are correct. | | 403 | Forbidden | Your credentials are valid and accepted by the server, but the action is still not authorized. | Check if you have access to the resource / action you’re trying to access / perform | | 404 | Not Found | The resource you are looking for does not exist here at this location. | The resource was either moved to a different location or deleted. You might also have an invalid request URL. | | 409 | Conflict | Concurrent modification is not allowed at the moment, resulting in a conflict condition. | **This is the only 400-series condition you should ever retry.** | | 412 | Precondition failed | The current status of the resource does not allow the requested operation | Check error message for information on the invalid status | | 500 | Internal Server Error | Something is wrong on our end but we have no explanation. | **Retry** with exponential backoff | ## Error response format AODocs APIs return two kinds of error information: * HTTP error codes (with some information in the header) * A response-body JSON object with additional details to help you determine how to handle the error (specifically `reason` and `message` fields) AODocs APIs report errors in the standard HTTP way with JSON-formatted response bodies that look like the following (not including the header information): ```yaml theme={null} [HTTP STATUS CODE (400-599)] [DEFAULT HTTP STATUS MESSAGE] ``` ```json theme={null} { "error": { "errors": [ { "domain": "[domain]", "reason": "[CONCISE DEFAULT OR CUSTOMIZED HTTP STATUS REASON]", "message": "[VERBOSE CUSTOM MESSAGE]" } ], "code": [HTTPS STATUS CODE (same as above)], "message": "[VERBOSE CUSTOM MESSAGE (same as above)]" } } ``` It is the client app’s responsibility to catch and handle all standard errors encountered when using the REST API. The following list guides you toward that end. ## Retry basics Some error conditions are temporary and the request can be retried later. Depending on the nature of the request and the perceived circumstance of the user, you can let them know something is wrong after any number of retries that makes sense from a UX perspective (including zero, straight away). Usually, 4xx errors should not be retried, while 5xx should. The only exception in the 4xx range is the 409 error, that indicates that a resource is being worked on by another user while trying to edit it. It should sometimes be retried. To confirm that this is the case, AODocs provides an additional hint, through a response header called “X-aodocs-retryable”: if the value of this error is “true”, then the error is expected to be transient, and the request should be retried until it succeeds. For example, if your resource is not currently in a state to allow concurrent edits from more than one party, then you could employ [exponential backoff](https://developers.google.com/drive/api/v3/handle-errors#exponential-backoff) and retry several times, letting the user know that their request is being worked on, and asking them to hang on. ## Resolve a 400 error: Bad Request This error means the input is incorrect — something in the query is missing or not valid. Some examples of 400 errors include: * Using mutually exclusive parameters at the same time: * ““Parameters libraryTemplateId, sourceLibraryId and driveFolderId are mutually exclusive” * Trying to violate the one-attachement restriction of TF/SF libraries: * “In the google libraries the documents should always have exactly one attachment.” * Trying to attach a Drive file without specifying its ID: * “The file id is mandatory in attachments” * Using a method on a library type that does not permit the method: * “This method cannot be used in a Document Management library” * Invalid or missing or conflicting parameter or resource field values or formats: * “The libraryId can’t be null or empty” * “Display name can’t be null” * “The managed permission source can’t be null” * “The classes with Folder acl source must contain a security category.” * “The name of the class must be unique in the library” **Note**: This is not a complete list: 400 errors are a broad category encompassing all kinds of incorrect requests. Here is an example of a 400 error, this one resulting from providing more than one mutually exclusive parameter: ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "badRequest", "message": "Parameters libraryTemplateId, sourceLibraryId and driveFolderId are \ mutually exclusive" } ], "code": 400, "message": "Parameters libraryTemplateId, sourceLibraryId and driveFolderId are \ mutually exclusive" } } ``` To fix this specific error, provide only one of the indicated mutually exclusive parameters. When encountering a 400 error in general, follow the hint provided in the `message` field. ## Resolve a 401 error: Unauthorized This error means credentials were missing or invalid (expired or unauthorized access token). ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "required", "message": "You must use oauth 2 to authenticate" } ], "code": 401, "message": "You must use oauth 2 to authenticate" } } ``` To fix this error, check whether you’ve provided credentials, and if you have, whether they’re correct. Furthermore, check the expiry date of your token and authorization levels of your credentials. ## Resolve a 403 error: Forbidden This error can occur for the following reasons: * Invalid security code * Insufficient access to a resource * No read access to the resource * Insufficient permission to perform a specification modification on the resource ### Invalid security code ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Invalid security code" } ], "code": 403, "message": "Invalid security code" } } ``` To fix this error, make sure your security code is correct. The request should not be repeated with the same credentials, but may be re-sent with a new or different security code. ### Unauthorized access to a resource #### Insufficient permissions This means the client app does not have the correct permission levels to access the resource. ##### Sample response message 1 ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Access denied to library with id: 'OtbBk6G8Am0ATUEy8P8' Required permission \ level: 'CONTRIBUTOR'" } ], "code": 403, "message": "Access denied to library with id: 'OtbBk6G8Am0ATUEy8P8' Required permission \ level: 'CONTRIBUTOR'" } } ``` ##### Sample response message 2 ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "File '1OHbt3F8VOc2Wh68K8iqX2R4RWnP4_N4xkRGFXX3qVMnQ' cannot be attached \ to the document: not owned by you or the library storage admin" } ], "code": 403, "message": "File '1OHbt3F8VOc2Wh68K8iqX2R4RWnP4_N4xkRGFXX3qVMnQ' cannot be attached \ to the document: not owned by you or the library storage admin" } } ``` To fix this error check your permission levels or whether you own the target resource. ## Resolve a 404 error: Not Found This error can occur because of any of the following: * Missing or incorrect resource-ID (*“There is no library with id: ‘OtbBk6G8Am0ATEy8P8’”*) * Resource doesn’t exist (*“No entity was found matching the key: !altirnao.com:Document("RwMUllP8yrBZFx9BWlN")”*) ### Incorrect resource ID parameter For example, if the `libraryId` parameter is incorrect (not existing or misspelled), you get the following error: ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Library with id 'OtbBk68GAm0ATEy8P8' does not exist" } ], "code": 404, "message": "Library with id 'OtbBk68G8Am0ATEy8P8' does not exist" } } ``` To fix this error, check the `message` field for the “incorrect” parameter in question (in this case *“Library with id \`‘OtbBk68GAm0ATEy8P8’”*), and verify its ID is correct. ### Resource not found If your mandatory parameter is correct, but the resource doesn’t exist, you might get the following error: ```json theme={null} { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "No entity was found matching the key: !altirnao.com:Document(\"RwMUllP8yrBZFx9BWlN\")" } ], "code": 404, "message": "No entity was found matching the key: !altirnao.com:Document(\"RwMUllP8yrBZFx9BWlN\")" } } ``` ### **Resolve a 409 error: Conflict (retry)** This error can occur because the resource is being accessed by more than one caller at the same time. The best strategy is to retry. **Note**: Of all 400-series errors, this is the only one that should be retried. ### **Resolve a 500 error: Internal server error (retry)** This error occurs because of some unforeseen condition on the server. The best strategy is to retry. # Performance considerations Source: https://api.aodocs.com/best-practices/performance-considerations There are several ways that you can improve the performance of your interactions with AODocs APIs. They include the following: * Requesting that the results that come back be filtered down to a manageable subset * Grouping the results into pages of specific length ## Filtering API results The `fields` query parameter is identical in design to [Google's design for JSON resource filtering](https://developers.google.com/drive/api/v3/fields-parameter) . You can filter the results by populating the `fields` query parameter with just the fields you want to come back in the response resource. As an arbitrary example, let’s say you were interested in only the following fields: * `defaultClass` * `fields(id,readOnly)` * `id` * `kind` * `libraryId` * `name` * `permissions(role,type,value)` * `sections(fields/id,id)` * `value` You can tell the server to return your requested resource with just those fields and omit all others. Populate the `fields` query parameter of your request with the preceding list as follows: ```yaml theme={null} defaultClass,fields(id,readOnly),id,kind,libraryId,name,permissions(role,type,value),sections(fields/id,id),value ``` The value should be URL-encoded when passed as the query parameter (comma should be replaced by `%2C`). ### Example request For example, if you were adding a new class and wanted the response resource to contain the fields above, the request might look like this: ```yaml theme={null} POST https://aodocs.altirnao.com/api/documentType/v1/libraries/Rrisfh406YlzF1PZqg/documentTypes?fields=defaultClass%2Cfields(id%2CreadOnly)%2Cid%2Ckind%2ClibraryId%2Cname%2Cpermissions(role%2Ctype%2Cvalue)%2Csections(fields%2Fid%2Cid)%2Cvalue ``` ```json theme={null} { "displayName": "my-new-class-002", "managedPermissionSource": "FOLDER" } ``` ### Example response Here is what the response to that request looks like, filtered with your list: ```yaml theme={null} 200 ``` ```json expandable theme={null} { "kind": "aodocs#documentType", "id": "RxT56Tp8z7Yvkjj1VU1", "libraryId": "Rrisfh4806YlzF1PZqg", "fields": [ { "id": "RxT56WG8FCtarmOAAW", "readOnly": false } ], "permissions": [ { "type": "ROLE", "role": "WRITER", "value": "DOCUMENT_CREATOR" } ], "sections": [ { "id": "defaultSectionId", "fields": [ { "id": "RxT56WG8FCtarmOAAW" } ] } ], "defaultClass": false, "name": "my-new-class-002", "value": "RxT56Tp8z7Yvkjj1VU1" } ``` ## Paginating resource collection responses For API methods that return a collection of resources, there’s usually the need to be able to paginate the results, as there might be too many of them to fit in a single response. The API methods that support pagination usually have two parameters: * A `limit` parameter (also named `pageSize` or `maxResults` in some methods) to indicate the maximum number of results to return in a single page * A `pageToken` parameter, used to get subsequent result pages A successful response on these methods will return a collection of resources, and IF (and only if) there are more results matching the user’s query / criteria, a `nextPageToken` field. To get the next page of results, you have to take this `nextPageToken` from the response and pass it as the `pageToken` query parameter in the next request (with the other parameters unchanged) to get to the next page. **Note**: For performance reasons, we recommend adjusting the number of requested results to the needs of the user. The more results are requested, the larger the latency. # Getting started Source: https://api.aodocs.com/getting-started ## Before you begin You should have access to an AODocs instance and understand some [AODocs fundamentals](/key-concepts/basics-of-aodocs/), as well as some basic concepts underlying [AODocs APIs](/key-concepts/basics-of-aodocs-apis/) (and RESTful APIs in general). ## Using the API To ease into the world of API calls and responses, you can spend some time playing around with the [API Explorer](/api-reference/introduction). To make it even easier, you can try it using the individual methods in the [Manage AODocs documents](/manage-aodocs-documents/) section. They are arranged in a specific sequence to get you comfortable with manipulating AODocs resources. Or you can dive right into the methods and schemas in the [Reference](/api-reference/introduction). To flesh out the succinct reference documentation, you can read more about AODocs resources and APIs of note in their respective sections. Additionally, you can explore the [Best practices](/best-practices/) sections to get a better understanding of what’s around the edges of the mainstream use cases. But the easiest way to start is to use the API Explorer to follow the sequence of methods in the Manage AODocs data section. Here’s to learning new and useful things! **Note**: These pages are an ongoing project to describe a system of ever-changing features and functionalities. Insomuch as the documentation effort aims for stability and robustness, it can never be considered 100% complete, let alone immutable. If you find something incorrect, please let us know and we’ll be happy to fix it. # AODocs REST API documentation Source: https://api.aodocs.com/index The AODocs REST API exposes most of the features of AODocs. It can be used to implement custom applications, third-party integration, bulk tools, or just to experiment with AODocs. Explore the API surface via its resources, or use the left-side navigation to browse the API by path. Follow these quick instructions to get set up for calling this API. # Key concepts Source: https://api.aodocs.com/key-concepts AODocs APIs let you *programmatically* access, manage, and configure AODocs objects and their associated metadata, including libraries, classes, documents, attachments, and properties. Most of the features available to users accessing the AODocs UI through a web browser are also available with the AODocs API. The APIs also let you interact indirectly with some AODocs-related [Google Drive API](https://developers.google.com/drive/api/v3/about-sdk) functionality, including some mediated access to files and folders in Drive. The following diagram shows the interactions between the major components: AODocs architecture diagram The following terms define key components shown in Figure 1: ***Google Drive*** Google’s cloud file storage service that provides users with a personal storage space, called *My Drive*, and the option to access collaborative shared folders, called *shared drives*. ***Google Drive API*** The REST API that allows you to leverage Google Drive storage from within your app. ***AODocs API*** The REST API that allows you to leverage AODocs functionality from within your app. ***Third-party app*** An app that leverages AODocs APIs (and, indirectly, Google Drive APIs) as its document management and file storage solution. ***AODocs Web UI*** The AODocs user interface used by an end-user to manage AODocs documents and Google Drive files attached to them. ***Google Drive Customer Files*** A Google Drive storage location that a specific user owns. Ownership of the content of the files stored on Google Drive remains specific to an individual user, unless the file gets attached to an AODocs document, at which point the ownership is transferred to the corporate account. ***OAuth 2.0*** The protocol that Google Drive API requires to authenticate your app users. If your application uses [Google Sign-in](https://developers.google.com/identity/sign-in/web/sign-in) , it handles the OAuth 2.0 flow and application access tokens. ## Next steps In the *Key concepts* section you can read more about [AODocs basics](/key-concepts/basics-of-aodocs/), as well as about leveraging [concepts and components of AODocs APIs](/key-concepts/basics-of-aodocs-apis/) to accomplish your goals. # Basics of AODocs Source: https://api.aodocs.com/key-concepts/basics-of-aodocs ## Prerequisites To proceed, you need to have an AODocs licence, have access to an AODocs domain, and be familiar with the basics of interacting with AODocs through the [AODocs user interface](https://aodocs.altirnao.com/) (UI). Most of the tasks we explain here that a client app can do with the API can also be done by a user in the user interface as explained in the [AODocs Knowledge Base](https://support.aodocs.com/hc/en-us) . ## AODocs and Google Drive AODocs is an enterprise document management system that exists as a layer on top of Google Drive to enable the management of Drive files. [Google Drive remains the file storage solution](https://support.aodocs.com/hc/en-us/articles/217739043-Switch-between-the-AODocs-interface-and-Google-Drive) , but AODocs enables additional search, security, control, customizability features on top of Drive files and folders. It also provides [advanced workflow capabilities](https://support.aodocs.com/hc/en-us/articles/205749346-What-are-workflows-) . This is done via the concept of an AODocs document, which is a grouping of metadata that acts as a fine-grained wrapper for Drive files. Furthermore, concepts like [library, folder, and class](https://support.aodocs.com/hc/en-us/articles/115005405943-AODocs-basic-terms) play a supporting role to documents within the AODocs ecosystem. ## AODocs hierarchy and key concepts AODocs documents exist in the following hierarchy: * **domain** * **library** (three available types: [Team Folder/Secured Folder/DMS](https://support.aodocs.com/hc/en-us/articles/206115120) ) * folder (mandatory or optional depending on type of library) * document class/documentType (two names, UI and API, for the same concept) * **document** (of a specific type and library) * System properties * Sections (containers for custom properties) * Custom properties * Rich text / description * **Attachments** (a reference to a Drive file) * Related documents * Versions A **domain** contains **libraries** (of 3 types) that contain **documents** (of different types) that have zero, one, or more **attachments** (references to managed **Drive files**) depending on the library type. Read more about [Recommended limits in AODocs](https://support.aodocs.com/hc/en-us/articles/115005944243) . ### Library types and attachment limits An AODocs **domain** contains libraries of **three types**: * **Team Folders (TF)**: each document must have one and only one attachment * **Secured Folders (SF)**: same as TF — one and only one attachment * **Document Management libraries (DMS)**: a document can have **any number of attachments**: zero, one, or more **Libraries** contain **documents** of unlimited types called **classes** (or `documentType` in the API). An AODocs document is not the colloquial sense of the word “document”. Instead, it is a versioned collection of predefined, structured metadata divided into logical groupings like System and Custom properties, along with a rich-text description, a list of related documents, as well as **attachments** (references to managed Drive files). The **number of Drive files** you can **attach to a document** in a specific type of library is a **critical concept in AODocs**. In **TF/SF**, each document *must* have **one and only one attachment**. In **DMS** libraries, each document *can* have **any number of attachments**: zero, one, or more. ### Attachment ownership transfer When you attach a Drive file to an AODocs document, you create a reference to the file inside the document. The file remains in Drive, but the ownership of the file transfers from you to the **AODocs storage account**, which in turn shares the file to you with specific permissions. An AODocs storage account is a Google account belonging to your GSuite domain. The company owns the file, but it allows AODocs to manage and organize your Drive files in a predefined way. **A Drive file can be attached to one and only one AODocs document** (trying to attach it to another document will fail). **Note**: Each library is associated with a specific storage account, and that storage account can be associated with multiple libraries. Read more about the storage account in the Knowledge Base: [What is the AODocs storage account?](https://support.aodocs.com/hc/en-us/articles/205648334-What-is-the-AODocs-storage-account-) ### Versions Every time a version of a document is created, AODocs saves a version of the document metadata and its attachments that can be restored later as a new version. Meanwhile, attachments themselves are versioned using the built-in file revision capabilities of Drive. ### Folders Structurally, a **library** is like a folder in the sense that it is the top-level (root) container of various types of **documents**. This is organized into a hierarchy of zero or more “subfolder” containers. A folder hierarchy is mandatory in TF/SF: the library mirrors the structure of what’s inside your corresponding Drive folder. In DMS, however, folders are optional: the functionality can be turned on or off depending on whether you need to put in place a folder-like hierarchy. You can toggle this in each class’s [Advanced settings](https://support.aodocs.com/hc/en-us/articles/360030865991) . ### Default library class A library’s whole purpose is to contain documents. In order to do so, it has to declare the types (classes) of documents that can be created within it. One of those types is the **default class**: if you ask for a document to be created in a specific library but don’t provide a class, that library’s default class gets used as the source class for the new document. ### Default document title For any newly created document, if you don’t specify a **title** then the system assigns to it the default title of “**Untitled**”. # Basics of AODocs APIs Source: https://api.aodocs.com/key-concepts/basics-of-aodocs-apis AODocs APIs are the HTTP endpoints which let you issue direct requests to the resource server to perform many of the manual tasks done in the AODocs UI: * search for and list resources such as libraries, classes, or documents * create, modify, and remove (trash or delete) documents, their properties, and their attachments * configure AODocs folders, roles, versions, and permissions Most of the tasks (and more) that can be achieved from the AODocs UI can also be performed using the API. ## When to use Drive APIs vs. AODocs APIs The purpose of **Drive** APIs is to upload, read, alter, copy, and download **Drive** files and their content — use them to put into place and manage Drive files before and after attaching them to AODocs documents. Only **[Drive APIs](https://developers.google.com/drive/api/v3/)** can be used for this purpose, and the AODocs API does not provide any way to interact with the content of the Drive files directly. **Note**: You can use any available version of Google Drive APIs (v2 or v3). To **attach Drive files to AODocs documents** in SF and DMS libraries you have to use both **Drive and AODocs** APIs together because they need to work in tandem to connect the two worlds. **Note**: Files created in a TF library’s folder will create AODocs documents automatically. Once attached, you can do most things you need with only AODocs APIs: you will still use Drive APIs to perform any tasks related to the content of the attachments like reading, copying, and downloading Drive files; but you will use **AODocs APIs exclusively** for all tasks related to the **AODocs documents** wrapped around the Drive files, such as managing and configuring AODocs metadata, roles, and workflows. Some of the concrete tasks you can perform with the AODocs APIs: * List libraries * List classes * Create a document of a specific class inside a specific library * Patch a document * Delete a document To **manage folders** and **edit permissions**, you have to use either **Drive or AODocs** APIs, depending on the library type and which storage account owns the resource: Drive APIs for TF; AODocs APIs for DMS and SF. To manage and configure **AODocs documents**, you can use only **AODocs APIs**. ## Interacting with APIs AODocs APIs are designed around [principles of REST](https://cloud.google.com/apis/design/resources) : to interact with them, you ask the server to use HTTP operations to perform read and write actions on a specified resource, as well as by providing certain parameters to configure the request. You then parse the responses that come back. You can do this using the following methods: * in person, manually, using the interactive [API Explorer](/api-reference/introduction) * using a third-party service provider like [Postman](https://learning.postman.com/docs/postman/launching-postman/introduction/) * programmatically, using code to automate request/response interactions The AODocs API shares a lot of similarities in its design with the Google APIs, so if you’re familiar with the various G Suite APIs (Drive, Calendar, GMail) you should be able to understand the AODocs API principles very quickly. On a high level, the interaction consists of three stages: 1. request to perform an operation on a resource sent to the server 2. operation performed server-side 3. response sent from the resource server ### Step 1: Client sends request to the server #### API Request structure You send a request containing the following information to the API server: * URL of the API **endpoint** (mandatory) * **Type of HTTP request** to be performed (mandatory) * Parameters (not all mandatory, and not all the time) * Headers * Authentication and authorization info * Request content type * other * Path parameters (before the `?` in the URL, mandatory) * target API * name/ID of **resources** and subresources to operate on * Query parameters (after the `?` in the URL, usually optional) * **securityCode** * search filters * other * JSON request body containing specific **target resource fields** you want populated (sometimes mandatory depending on operation and resource) #### Base API endpoint URL To access AODocs APIs, you must use the following base URL: ```yaml theme={null} https://aodocs.altirnao.com/api/ ``` **Note**: This URL is used to build interactions with AODocs API resources but yields no useful results on its own. #### Types of parameters Different parts of the request naturally lend themselves to carrying certain kinds of parameters, or at least are used that way customarily. There are generally three ways you can send parameters inside a request: * as a **path** parameter (`GET /library/v1/abcd12345?include=NONE`) * as a **query** parameter (`GET /library/v1?documentId=abcd12345`) * as one of the JSON-formatted resource fields inside the **request body** (**`{“documentId”: “abcd12345”}`**) * inside the header (**`Authorization: Bearer `**) Specific variable parts of the endpoint URL (like AODocs `/documentType/v1/**typeId**` or `/library/v1/libraryId` APIs) are considered **path parameters**. These parameters get provided in the part of the URL after the host name and before the `?`, and this is where the server expects to find them. Search filters, security codes, and other **query parameters** are commonly strung into a key-value list in the part of the URL after the `?`. The resource server has built-in mechanisms to parse this information. **Tip**: The following query parameters exist globally across AODocs APIs: * domain * security code (authentication mechanism) * fields query parameter (to filter results and improve performance) #### API resources REST-oriented APIs such as AODocs model their objects (such as documents, classes, or libraries) as a hierarchy of directly addressable *resources*, or addressable collections of information or metadata. A resource type (such as [ApiDocument](/api-reference/documentid)) is the schema that outlines how a resource can be represented. A representation of a resource is the (in our case JSON-formatted) instance of the schema above. This JSON-formatted instance is a *representation* of a resource, but is often simply called *resource*. You send the (usually partial) resource to the server as a request body, along with a request to perform an HTTP-verb operation like `GET` or `PATCH`. Once the server performs the requested operation, it sends back the (usually complete) resource to the client as a response body. API resources (like a Document or Library) that you want to create or update *must* be sent as part of the request resource, in the **request body.** They are returned as **the response body** when a request is successful. Usually, the format of an API resource is the same in the request body and the response body. **Note**: You can get a partial resource back if you filter the response fields using the `fields` parameter. Read more about [AODocs resources](/about-api-resources/). #### Creating a document ```yaml theme={null} PUT https://aodocs.altirnao.com/api/document/v1 Authorization: Bearer [YOUR_ACCESS_TOKEN] ``` ```json theme={null} { "libraryId":"RnTG8PD8u8ZqTuDVHcv", "classId":"RnTf1mx835gaTJLzoFp", "title":"My Important AODocs Document" } ``` ### Step 2: Server performs operation on the requested resource The resource server hosts and performs operations on a requested resource (such as a library), subresources (such as a library’s permissions), or a collection of resources (such as a list of libraries). If the resource server accepts your request, it then does the following: * performs requested operation on target resource (library, etc.) or subresource (permissions, etc.) * sends back response containing: * HTTP status code outlining what kind of outcome occurred (success/fail/other) * the targeted resource (usually; one exception is after `DELETE`) For example, the server might apply a `GET` request to an `ApiLibraryList` resource/collection and return the resource/collection to the requesting party. ### Step 3: Server sends a response The server either succeeds in fulfilling the request, or something goes wrong. The latter case is uncommon, but when it does occur, many things can be the culprit. #### Server succeeded If the server succeeds in fulfilling the request, it responds with a 200-series status code (usually `200 OK`) and a response body which is a full or filtered JSON representation of the resource the server operated on. Each resource type returned as part of a successful response has a different structure (“schema”): you can look up the schema for each such resource type in the reference, such as [ApiDocument](/api-reference/documentid). **Note**: If the requested operation is `DELETE`, the server sends back `204 OK` and `null` instead of a representation of a resource, regardless if the resource was sent to Trash (retrievable) or deleted permanently. If you delete the document permanently, the `documentId` stops being recognized from that point on. If you send the document to Trash, the document ID persists. #### Server did not succeed If there was something wrong with the request or with the server’s ability to perform the operation, the response comes back as a status code and JSON-formatted error message to help guide your next steps. ## Error handling and troubleshooting The response provides a standard HTTP status code to indicate success (**2xx**), failure (**4xx**), or some other condition (**5xx**); as well as an error message to guide the next steps. Read more in [HTTP status codes in AODocs APIs](/best-practices/http-status-codes-and-error-handling/) to determine the type of issue and how to resolve it. ## Pagination Pagination comes into play when dealing with resource collections, since the results are often longer than a single page. Read more on the [Performance considerations](/best-practices/performance-considerations/) page. ## Beta vs. non-beta versions Any version marked `beta` indicates that the version of this API method is not final, and might be subject to sudden deprecation and removal from the API, with a better alternative provided as a replacement. However, as long as the method is live, we’ll try to ensure backward compatibility as much as possible. APIs not marked as `beta` are considered “stable”: they have permanence and retain backward compatibility, unless they suffer from low usage. ## Next steps Here is how you can get started working with AODocs APIs: * Try following the sequence of methods in the [Manage AODocs documents](/manage-aodocs-documents/) section. * Use the [interactive API Explorer](/api-reference/documentid) to build requests and queries for the APIs and to see the responses. * Review and select the appropriate mechanism for [gaining authenticated access to AODocs APIs](/authentication/). * Check the [AODocs Reference](/api-reference/introduction) for all the resources available through the APIs. * Read the [Best practices](/best-practices/) section. # Manage AODocs documents Source: https://api.aodocs.com/manage-aodocs-documents We put some of the most useful data-handling API methods together into a loose sequence you can follow in the [API portal](/api-reference/introduction). Or you can pick and choose the parts that help you accomplish your immediate goals with AODocs. **Note**: You can perform most of the tasks in this tutorial either using the API or on your homepage in the AODocs user interface (UI). Use the one that suits your needs, or you can do them both to understand how they map to each other. ## Before you begin If you haven’t yet, make sure you familiarize yourself with the [key concepts of the AODocs universe](https://support.aodocs.com/hc/en-us/articles/115005405943-AODocs-basic-terms) . Also, if you don’t follow this section in sequence, one page is devoted to help you [create some test files and folders](/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-test-drive-files-and-folders/) to work with in your Google Drive: the files are going to become attachments to the AODocs documents you’re about to create. ## What you’ll do If you follow the sequence in this section, you’ll port some Drive files to become attached to AODocs **documents** inside some AODocs **libraries**. Once attached, you’ll create/add/patch/update/delete **documents**, **attachments**, **properties**, and **metadata**. Whenever appropriate, for each task, you’ll get a link to the specific part of the API portal needed to accomplish the task. **Note**: We recommend following the sequence as some steps depend on previous steps. The list of steps is as follows: * Get library and class info * [Libraries](/manage-aodocs-documents/get-library-and-class-info/get-library-info/) * List all available AODocs libraries (full) * List all available AODocs libraries (plain) * Get a specific library by ID * [Classes](/manage-aodocs-documents/get-library-and-class-info/get-document-class-info/) * List classes (to find target classes for your documents) * Get a specific class by ID * Create, modify, delete documents * Creating new documents with attachments * [Create test Drive folder and some files to work with as attachments](/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-test-drive-files-and-folders/) * [Create a new document and attach a Drive file](/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-new-document-and-attach-drive-file/) * [Modify a document’s system and custom properties](/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties/) * [Modify a document’s attachments](/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments/) * [List, search, and count documents](/manage-aodocs-documents/create-modify-delete-documents/list-search-and-count-documents/) * [Delete document](/manage-aodocs-documents/create-modify-delete-documents/delete-document/) Let’s [get started](/manage-aodocs-documents/get-library-and-class-info/get-library-info/)! # Create, modify, delete documents Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents In this section we explore three common use cases: # Count documents of a library Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/count-documents-of-a-library POST https://aodocs.altirnao.com/api/search/v1/libraries/{libraryId}/count You can count the number of documents associated with a particular library (and optionally class) as follows. **Note:** This is available only to library administrators. ## **Method and API** Play with the API Explorer: ## **Usage/notes/guidelines** ### **Request** `libraryId` is a path parameter. It is the only mandatory parameter. However, using the `classId` helps narrow the response to documents of a specific class you want. ```yaml Sample request theme={null} POST https://aodocs.altirnao.com/api/search/v1/libraries/RrVcEFb8wtDeNAnlmNN/count?classId=RrVcdN280MKJwPyE7sh ``` ## Response The response returns an [ApiDocumentCount](/api-reference/search) resource, giving a count of all documents associated with the specified library (and class if you specified the `classId`). ```json Sample Response theme={null} { "kind": "aodocs#documentCount", "count": 12 } ``` # Creating new AODocs documents Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments In AODocs, you can create new documents with either just a single attachment (TF/SF/DMS), or any number of attachments including zero (DMS-only). To create AODocs documents with and without attachments, follow these steps: You can also [Create AODocs documents in the UI](https://support.aodocs.com/hc/en-us/articles/115005892403-Create-AODocs-documents) . # Create new document and attach Drive file Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-new-document PUT https://aodocs.altirnao.com/api/document/v1 ## **Method and API** Play with the API Explorer: ## Guidelines ### Prerequisites Before you create a new empty document with one attachment, you must know the `libraryId` of the library you'll be creating the document in. For a single attachment, any library type works: TF, SF, or DMS — but you still have to know the ID of the specific target library. You also need the `fileId` of any Drive file that you want to attach to your document. Read more about how to [obtain the file ID in the AODocs UI](/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-test-drive-files-and-folders). **Note**: In the API Explorer's "Request body" window, `fileId` is part of the `attachments` array field; alternatively, if you need to attach by explicitly making a copy of the original file, it is found under `attachmentsToCopy` . Optionally, it's good to know your target class (what type of document this will be), but if you don't specify it, the document will automatically become of the same type as your target library's current default class. Lastly, you should give a title to your new document. If you don't, it'll get called "Untitled", which can get confusing. You might also want to provide the ID of a specific target AODocs folder for your new document to live in. You can do this by specifying the Drive folder ID (`folders[].fileId` field in the document resource). If you don't know this ID, you can open up your target folder in the UI and retrieve the ID from the URL between the surrounding `%2522` strings: ```yaml theme={null} %2522𝗳𝗼𝗹𝗱𝗲𝗿%2522:%2522𝗔𝗷𝗮𝗣𝘃𝟬𝟮𝟴𝗶_𝗺𝗿𝗢𝘆𝗸𝗜𝟲𝟬𝗞𝗮𝘃𝗪𝗶𝗯𝟮𝗟𝗧𝘇𝗦𝘂𝗬𝗪𝗿𝟴%2522 ``` The preceding is simply a URL-encoded version of this `folder:folderId` pair: ```json theme={null} "folder":"AjaPv028i_mrOykI60KavWib2LTzSuYWr8" ``` **Note**: If you need to attach files from a Google account outside the target domain, the following prerequisites have to be met: * You have to have ownership of each such file. * You or your domain has to be whitelisted in the target domain. * You have to have access to the target library. If the file is not yet owned by an AODocs storage account, you have to call the AODocs API using an OAuth2 access token that grants the `https://www.googleapis.com/auth/drive` scope to the user. In an out-of-domain case such as this, the file itself gets automatically duplicated and it is this new duplicate that becomes the attachment to your target document, not the original. ### Request Pass the mandatory parameters of `attachments[].fileId` (for any Drive file to be attached) and `libraryId` in the request body, not in the query string. Same thing for the optional `classId`, `title`, and the `folders[].fileId` (desired target Drive folder ID). Provide the `fileId` inside one of the two array fields (or both) in the request body: * `attachments` * `attachmentsToCopy` If you attach a Drive file using `attachments`, and then edit that attachment's content, the edits happen in the original Drive file because the attachment is a direct link to that file. **Note**: Once attached to a DMS document, the source Drive file no longer has a visible parent folder in Google Drive. It's still accessible via search and via the "Shared with me" shortcut/folder, but it no longer appears inside its original folder hierarchy (if any). However, if you attach a Drive file using `attachmentsToCopy`, that attachment is no longer the original file: it is a copy of it created during the attachment process. All these fields correspond to fields in the [ApiDocument](/api-reference/document) resource: the fields of the request resource map directly to the fields of the server resource which gets altered by the `PUT` operation before being sent back as a response resource. ### Sample request ```yaml theme={null} PUT https://aodocs.altirnao.com/api/document/v1 ``` ```json theme={null} { "attachments": [ { "fileId": "1wwO-7T8e_doTw3rK3_wqvyh5zEWL5IKDh" } ], "folders": [ { "fileId": "1BaNSFx8JYE04gHoH_H1sqPzyJVwr1cqma" "folderAodocsId": "1BaNSFx8JYE04gHoH_H1sqPzyJVwr1cqma" } ], "libraryId": "RnTG8PD8u8ZqTuDVHcv", "classId": "RnTf1mx835gaTJLzoFp", "title": "my-dms-doc-002" } ``` **Note**: In the preceding sample request, note the `attachments` part in bold (or `attachmentsToCopy` if that’s what you’re using instead). If you’re attaching one or more Drive files, include this part, and list your attachments by `fileId`. If you’re not attaching anything, remove this part altogether. ## Responses If the request succeeds, the response returns a `200 OK` status code and a JSON-formatted representation of an [ApiDocument](/api-reference/document) resource. The JSON object includes metadata describing details and attributes of the newly created document inside the specified library. The document’s ID is listed as `id`, and its `classId` is what you specified in the request, else of the library’s default type. ## Sample response **Note**: If attaching a Drive file requires making a copy of it instead of directly linking to the original, the file ID in the response ends up being different from the file ID sent in the request. The request identifies the original, the response identifies the copy. ```json Sample Response theme={null} { "kind": "aodocs#document", "libraryName": "my-dms-by-alt-on-test-001", "className": "my-dms-by-alt-on-test-001-class-001", "className_i18n": "my-dms-by-alt-on-test-001-class-001", "libraryId": "RrVcEFb8wtDeNAnlmNN", "classId": "RrVcdN280MKJwPyE7sh", "id": "RrVsvlY80jV2N7NcCIy", // <— documentId "title": "my-important-document-with-spreadsheet-attachment", "richText": "", ... "attachments": [ { "fileId": "1wwO-7T8e_doTw3rK3_wqvyh5zEWL5IKDh", // ⇐ same as in the request, unlike with the \`\`\`attachmentsToCopy\`\`\` parameter "name": "my-important-spreadsheet", "mimeType": "application/vnd.google-apps.spreadsheet", "link": "https://docs.google.com/spreadsheets/d/108JuZK8TqnjYI3YND_GmiIc-tfoZVJ7IJzQrD8lfjNJc/edit?usp=drivesdk", ... } ], "folders": [ { // library root folder "kind": "aodocs#folder", "libraryId": "Rs4xtue86axGNklquDP", "libraryName": "my-sf-prod-001", "folderAodocsId": "0", // ⇐ "0" means root folder "fileId": "1Q4_rHI8Xzebc7PEOCH9-IjAAmTYvXXBBu", // ⇐ root folder Drive ID "name": "my-sf-prod-001", "parentFolderIsRoot": false, "folderIsRoot": true, ... }, { // actual folder the document is in "kind": "aodocs#folder", "libraryId": "Rs4xtue86axGNklquDP", "libraryName": "my-sf-prod-001", ... "folderAodocsId": "1BaNSFx8JYE04gHoH_H1sqPzyJVwr1cqma", "parentFolderAodocsId": "0", // ⇐ we are one level below root "parentFolderDriveId": "1Q4_rHI8Xzebc7PEOCH9-IjAAmTYvXXBBu", "fileId": "1BaNSFx8JYE04gHoH_H1sqPzyJVwr1cqma", // ⇐ subfolder Drive ID "name": "test-sf-prod-001-subfolder1", "parentFolderIsRoot": true, // ⇐ we are one level below root "folderIsRoot": false, ... } ], "numberOfAttachments": 1, } ``` # Create new document and attach Drive file Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-new-document-and-attach-drive-file When you create a TF/SF document, you must attach one and only one attachment (using a Drive file’s fileId ). You create a DMS document the same way, but you can do it with any number of attachments (including zero). For example, you might have a spreadsheet in Google Drive that you want to manage with AODocs. Wrapping a new AODocs document around your spreadsheet allows you to use all the AODocs document management features and properties like custom properties and workflows. In DMS, you can also create a new document with no attachments. An example could be an expense-report document that needs to be delivered before the expenses are ready to be attached. You can create the document first, and then attach the receipts whenever appropriate. To get familiar with document creation, try to [create AODocs documents in the UI](https://support.aodocs.com/hc/en-us/articles/115005892403-Create-AODocs-documents) . To create a new document with AODocs APIs, send a request to the server with an `ApiDocument` resource, listing: * mandatory resource fields required by the server (like target library ID) * optional but useful fields (like document title, class ID, and folder ID) * any Drive IDs of files to attach — zero or more for DMS libraries; and a mandatory single one for TF/SF # Before creating AODocs documents: Create test Drive folder and files Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-test-drive-files-and-folders In order to have some test files and folders to work with, open up your [Google Drive](https://drive.google.com/) and create a Drive folder. Upload or create some files beside it as well as inside it. Here’s an example of what that might look like: Drive new folder
Drive new file ## Folder ID In Drive, files and folders are identified by their individual IDs. When the URL says something like `/drive/folders/**1HczxnMexotWE3H9z8aebZepvkla60UEzz**`, the long string of numbers and letters refers to the current Drive **folder ID**: Folder ID in URL 1
Folder ID in URL 2 Make note of the **Drive folder ID** in the URL for later. ## File ID To get the URL to display the **file** ID of the **file** that’s currently open, click on the More options" menu (**⁝**), then on “Open in new window”: File ID open in new window menu Now the URL lists the Drive **file** ID (as opposed to **folder** ID): File ID in UI **Note**: Certain Drive files such as Google Forms require an additional step of clicking on `Edit` (pencil icon usually in the bottom right of the page) and open the file in yet another view. Only then does the URL display the proper file ID. Make note of the **Drive file ID**: it and the **AODocs document ID** are the two most critical and commonly used pieces of identifying information in the **AODocs API**. **Note**: If you’re familiar with the Drive API, the file ID is the ID of the [File](https://developers.google.com/drive/api/v3/reference/files/get) resource. ## Next steps Use a Drive file to [create a new AODocs document with an attachment](/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-new-document-and-attach-drive-file/). # Delete a specific document by ID Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/delete-document DELETE https://aodocs.altirnao.com/api/document/v1/{documentId} You can delete a specific document if you have its documentId. You can either delete it permanently, or just send it to Trash. You can retrieve it from the Trash, or leave it there and it will get deleted after some designated amount of time. ## Method and API Play with the API Explorer: ## Guidelines ### Request Only `documentId` is mandatory, and it must be an AODocs `documentId` not a Drive `fileId`. **Note:** To get an AODocs document (including its `documentId`) by the Drive ID of one of its attachments, use the `GET /document/v1/drive/{driveId}` method. ### Sample request ```yaml Sample request theme={null} DELETE https://aodocs.altirnao.com/api/document/v1/RssP0ol81I2JjwfFgxk?deleteMode=TRASH ``` ## Responses Because this is a deletion of a resource, there is no resource to return in the response. The response returns an HTTP code of 204 `(No Content)` ```yaml 204 theme={null} 204 ``` # Get specific document by ID Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/get-specific-document-by-id GET https://aodocs.altirnao.com/api/document/v1/{documentId} You can retrieve (the configuration of) a specific document to parse something from its metadata (or just confirm it exists) if you have its `documentId`. **Note:** As always, you can look for the file in the UI as well. If for whatever reason it does not appear there after you've created a new document, it might be because of the way your Views are set up. Go to your Library administration page, go to Views, and select the checkbox called "View documents from other classes". ## Method and API Play with the API Explorer: ## Guidelines ### Request Only `documentId` is mandatory, and it must be an AODocs `documentId` not a Drive `fileId`. ### Sample request (asking for a full resource) If you need only some of the fields of the extensive ApiDocument resource to come back, you can specify them in the `fields` array field of the request and sending this list as a query parameter. For example, you might want to request only the library name, class name, library ID, class ID, document ID, title, and the document description. ### Sample request (partial resource) ```yaml Sample request (asking for a full resource) theme={null} GET https://aodocs.altirnao.com/api/document/v1/RnTzVT28x5Sb48h3vSQ ``` ```yaml Sample request (partial resource) theme={null} GET https://aodocs.altirnao.com/api/document/v1/RnTzVT28x5Sb48h3vSQ?fields=libraryName%2CclassName%2ClibraryId%2CclassId%2Cid%2Ctitle%2CrichText ``` **Note** To get an AODocs document (including its `documentId`) by the Drive ID of one of its attachments, use the `GET /document/v1/drive/{driveId}` method. ## Response The response returns an [ApiDocument](/api-reference/document) resource, listing the document associated with the provided document ID. The document’s ID is `id`, and its class is what you specified in the request, else of the library’s default type. ```json Sample Response theme={null} { "kind": "aodocs#document", "libraryName": "my-DMS-lib-001", "className": "my-dms-class-002", "libraryId": "RnTG8PDu8ZqTuDVHcv", "classId": "RnTf1mx35gaTJLzoFp", "id": "RnTzVT28x5Sb48h3vSQ", <— documentId "title": "my-dms-doc-002", "richText": "", ... } ``` # List documents of a library Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/list-documents-of-a-library POST https://aodocs.altirnao.com/api/search/v1/libraries/{libraryId}/list You can list documents associated with a particular library as follows. **Note:** This is available only to library administrators. ## Method and API Play with the API Explorer: ## Usage/notes/guidelines ### Request `libraryId` is a path parameter. It is the only mandatory parameter. ```yaml Sample request theme={null} POST https://aodocs.altirnao.com/api/search/v1/libraries/Rs511XR8xAxGXu7nZYj/list ``` ## Responses The response returns an [ApiDocumentList](/api-reference/documentid) resource, listing all documents associated with the specified library ```json Sample Response theme={null} { "kind": "aodocs#documentList", "documentList": [ { "kind": "aodocs#document", "libraryName": "my-DMS-lib-001", "className": "my-dms-class-002", "libraryId": "RnTG8PDu8ZqTuDVHcv", "classId": "RnTf1mx35gaTJLzoFp", "id": "RnTzVT28x5Sb48h3vSQ", <— documentId "title": "my-dms-doc-002", "richText": "", ... } ... { "kind": "aodocs#document", ... } ] } ``` # List and search documents Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/list-search-and-count-documents In this section, we explore the following: * Get document by ID * List documents in a library * Count documents in a library * Search documents from a specific class # Modify document attachments Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachment PATCH https://aodocs.altirnao.com/api/document/v1/{documentId} ## Method and API Play with the API Explorer: ## Guidelines ### Prerequisites Because this is an overwrite operation, you have to know which pieces you want to replace with your new changes, including overwriting with nothing (deleting). And you have to be aware of the power of this operation to make changes that are somewhat complicated to undo. ### Request Only `documentId` is mandatory (to identify which document's metadata to alter). However, including only the `documentId` parameter is the degenerate case: if that's all you specify, and specify no changes, then the `modificationDate` and `updateAuthor` of the document get reset, but otherwise no changes take place. For this method to do anything, you must specify the parts you want changed, and you must send them as request-body parameters (not as query parameters). #### Attachment array fields Attachments are represented in the `ApiDocument` resource as an array field (see preceding warning under “Modifying array fields”). As with any other field, when the field is sent to the server, its contents will \`\`\`PATCH\`\` (overwrite) the contents of the corresponding field on the target resource residing on the server. To alter what files are currently attached to your document, use the array field called `attachments` in the body of the request. This array field holds the file ID(s) of Drive files you want to become the current attachments to your document. **TF/SF** In the case of TF/SF documents, this is relatively foolproof since you are limited to a single attachment. There is only one action that carries any risk, and that’s replacing the attachment with another one by accidentally sending a non-empty attachments array field. See the following “Sample request body (`attachments` non-empty)”. **DMS** On the other hand, when dealing with DMS-document attachments, you must proceed more cautiously because DMS documents have no attachment restrictions, and you must thus consider multiple potential outcomes depending on how you phrase `attachments`. If you are using the `attachments` array field in your request and you happen to be dealing with a DMS document, then you must exercise caution: whatever you include in the array (including *nothing*) becomes your new list of attachments, in the order you provide. **Sending array field with data vs. empty** This means that if you are actually including the `attachments` array field in your request, then you must explicitly specify what you want to keep each time; and if you send it to the server empty, the server will empty the target document of all its attachments. For example, if you have an existing DMS document with one attachment, but want to add another attachment to it, you must specify both attachments (the existing *and* the new), and in the correct order. If you only specify the new attachment, the original attachment will get detached, and your new attachment will get attached in its place, replacing the original. Result: a single attachment (the new one). Therefore, if you do not need to change anything to do with attachments, do not send the `attachments` array field at all. This ensures that the `attachments` array field in the resource on the server remains unmodified, keeping your attachments as they are. **Tip**: You can avoid some of the pitfalls of array fields by sampling the contents of the array field from the previous `PATCH` operation which returns the `ApiDocument` resource in full (or partial if you used the `fields` field to [filter the response](/best-practices/performance-considerations/). This is the same result as sending a `GET` request to get a document. This way you always have an up-to-date listing of what the target resource looks like on the server. Read the array field(s) you need, and feed the fields into your next request. **Note**: Notwithstanding attachment-restriction differences between DMS documents and TF/SF ones, the preceding guidelines for using the `attachments` array fields are generalizable to other array fields. #### Sample request body (`attachments` non-empty) When you send the `attachments` array field filled out with file ID(s), you are saying to the server that you want these files in this specific order to be the attachments from now on, regardless of what used to be attached up until now. In the case of TF/SF, you are restricted to exactly one file ID inside the `attachments` array field. In the case of DMS, this restriction does not exist. To keep any current attachments in your DMS document, you must explicitly state them here. Also, if you want to keep their existing ordering, then you also must specify them in that order. ```yaml theme={null} PATCH https://aodocs.altirnao.com/api/document/v1/RsjbYc788vqY6WDeUnM ``` ```json theme={null} { "attachments": // ⇐ removes all current links to Drive files and replaces them with whatever is specified in the square brackets that follow [ { "fileId": "1s1uFfW8GHPZ0fUpvwdT-oCsrY7G9QndAU" }, { "fileId": "1QvvRHb8XmLYlB66ZZf-fzoTVVDYfrNxO0" } ] } ``` #### Sample request body (DMS-only, with `attachments` array field empty) In DMS, this is how you detach (“delete”) attachments all at once. The (ex-)attachments are still owned by the storage account. With no parent document, however, no reference to them exists in either AODocs libraries or in Drive (except in logs). To regain access to them you need the intervention of a domain administrator. ```yaml theme={null} PATCH https://aodocs.altirnao.com/api/document/v1/RsjbYc788vqY6WDeUnM ``` ```json theme={null} { "attachments": [] // ⇐ removes all current links to Drive files and replaces them with whatever is specified in the square brackets (empty square brackets means all attachments get detached!) } ``` #### Sample request body (with `attachments` array field not included) ```yaml theme={null} PATCH https://aodocs.altirnao.com/api/document/v1/RsjbYc788vqY6WDeUnM ``` ```json theme={null} { } // not including the attachments array field in the body keeps attachments as they are, unmodified ``` ## Responses The response returns an [ApiDocument](/api-reference/documentid) resource, listing the freshly modified document with the overwritten fields and everything else unmodified). If you included the `attachments` array field in your request, the response includes the new content. ```json theme={null} { "kind": "aodocs#document", "libraryName": "my-DMS-lib-001", "className": "my-dms-class-002", "className_i18n": "my-dms-class-002", "libraryId": "RnTG8PDu8ZqTuDVHcv", "classId": "RnTf1mx35gaTJLzoFp", "id": "RnTzVT2x5Sb48h3vSQ", "title": "Hello-world-doc-001", // ⇐ new, overwrote the old "richText": "This is my Hello world! document." // ⇐ new, overwrote the old ... } ``` # Modify document attachments Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments Using AODocs APIs, you can modify the document resource using the `PATCH` operation. You can modify attachments as well as [system and custom fields](/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties/). To modify the list of document attachments (i.e. references to Drive files), use `PATCH` to replace/overwrite the `attachments[]` array field of the target resource. In general, modifying is perfectly benign. However, things carry extra risk with any parts of the resource arranged in arrays. Using the `attachments` array field in DMS documents, is one example; however, the caution extends to any request containing array fields. There are two cases to consider: * array field not included in request: corresponding target array does not get modified on the server * array field included in request (including empty!): completely overwrites target array field with whatever is in the square brackets in the order provided: * object specified in array position *n*: object placed in target array at position *n* * object not specified: object is removed from target array **Warning/Alert**: The list of objects you specify in your array field in the order you specify completely replaces whatever currently exists in the corresponding resource array on the server. If you include an empty array field in your payload (without specifying any objects), you are saying to the server “I want this complete array field to be(come) empty.” For example, if you use the `attachments` array field with DMS documents, the result is a target DMS document with no attachments. (The one-attachment restriction in TF/SF prevents this possibility; however this still applies for other types of array field.) Additionally, if you want any of the current objects to remain in the array field (as you alter it), you have to specify them each time inside the array field in your request, including their current position). For example, if you use the `attachments` array field with DMS documents, then you have to deliberately send the complete list of what you want the array to contain from then on, **in the order you want**. (Missteps such as accidental detaching or re-ordering of attachments are not possible with TF/SF documents because you only ever modify the one attachment.) # Modify field values of document properties Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties AODocs documents are composed of metadata, including (but not limited to) system and custom properties defined as part of a specific document type (also known as class). System properties are pieces of metadata defined at the document level, found in every document. Most of them are set by the system and are read-only. Some of them can be modified. Custom properties are document metadata defined by an administrator during the creation of a class. Once defined, each document that belongs to the class takes on all the properties defined in its class. **Note**: Properties can be added and deleted after class creation. Read more about [managing custom fields in the UI](https://support.aodocs.com/hc/en-us/articles/115000051523#h_76055d8f-c7aa-4eaa-b9d7-68aaea6a170b) . ## Limits Documents have a 1MB size limit, so any otherwise unlimited field like `richText` or custom fields of type `TEXT` must fit inside this restriction. Additionally, the `title` system field, as well as any other `STRING` fields have a 1500 byte limit. ## Setting system and custom fields To set any fields in AODocs, you have to pass the correct JSON-formatted field-value pair as part of the request body along with the desired type of HTTP request: `PUT` to create a document; and `PATCH` to modify it. ### Setting system fields In a document resource, system fields are top-level fields (not nested), and you can address them by name directly in your request. #### Sample request ```yaml theme={null} PUT https://aodocs.altirnao.com/api/document/v1 ``` ```json theme={null} { "title": "my-new-doc-023", "richText": "my-new-doc-023-richText", "creationDate": "123456789000", "initialAuthor": "account1@gmail.com", "updateAuthor": "account2@gmail.com", "modificationDate": "987654321000", "setModifiedDate": true, "libraryId": "RsjaTyH8w59078Zx7Dk" } ``` #### Updatability of system fields In AODocs APIs, you can define system field values for a document when it is either created or updated. Some of these fields can be created or modified only if you set the `setModifiedDate` boolean flag to `true`. The following table outlines allowances and requirements for each system field (`sMD` means `setModifiedDate`): | **Are the following fields modifiable?** | **At creation (sMD=false)** | **At creation (sMD=true)** | **At modification (sMD=false)** | **At modification (sMD=true)** | | :--------------------------------------- | :-------------------------- | :------------------------- | :------------------------------ | :----------------------------- | | initialAuthor | Yes | Yes | No | No | | creationDate | Yes | Yes | No | No | | updateAuthor | No, current user | Yes | No, current user | Yes | | modificationDate | No, current date | Yes | No, current date | Yes | | title | Yes¹ | Yes | Yes | Yes | | richText | Yes | Yes | Yes | Yes | ¹ `title` is automatically populated as “Untitled” if left unspecified #### Use case: setModifiedDate flag When you update a document with the API, whether it’s creation or modification, the document gets updated with your changes and there is an implicit update to two system fields: `modifiedDate` and `updateAuthor`, that will get the current date and current user value regardless of the field values you put in the request. This flag allows write access to these two fields: it exists so that tools like a bulk updater can edit fields or other information in the document without the modification date and the modification author getting set to the latest system values. For actions that have the requirement of preserving the `modifiedDate` and `updateAuthor` fields as is, explicitly pass their previous values along with your document changes and the `setModifiedDate` flag set to `true`. #### Sample request ```yaml theme={null} PUT https://aodocs.altirnao.com/api/document/v1 ``` ```json theme={null} { "title": "my new AODocs document", "richText": "Hello, world!", "creationDate": "123456789000", "initialAuthor": "mypersonalemail@gmail.com", "updateAuthor": "mypersonal@gmail.com", "setModifiedDate": true, "modificationDate": "987654321000", "libraryId": "RsjaTyH8w59078Zx7Dk", } ``` #### Expected formats for system fields | **TYPE OF SYSTEM FIELD** | **EXPECTED API FORMAT** | | :------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------ | | TEXT (like `title`) | Text with no HTML parsing; you can add line breaks | | RICH TEXT (like `richText` AKA "Description" in the UI) | Text that is rendered as HTML | | DATETIME (like `creationDate` and `modificationDate` ) | Unix timestamp in milliseconds since the beginning of 1 January 1970, as a JSON string (will not accept integers) | | PERSON (like `initialAuthor` and `updateAuthor`) | Any string value; we recommend valid Google account email addresses to benefit from the workflow features on these fields | ### Setting custom fields In a document resource, custom fields are found inside the `fields` array. **Warning/Alert**: The list of objects you specify in your array field in the order you specify completely replaces whatever currently exists in the corresponding resource array on the server, in the order you provide. Read about it in more detail on the [Modify document attachments](/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments/) page. Custom fields are defined in the document’s class when it’s created; and you or a client app populate their values when creating or modifying a document. In order to populate custom fields, you must know the `fieldId` of the particular property of your target class (that each document in that class has). You then use it to tell the server which values of this particular property should be set. To do this, populate `fields[].fieldId` with your target class’s `fieldId`. **Note**: Alternatively, you can populate `fields[].fieldName` with the target class’s `fieldName`. However, this is **not recommended**, as the name of a field can change. Once the target class is identified, populate `fields[].values[]` with the values you want. #### Sample request ```yaml theme={null} PUT https://aodocs.altirnao.com/api/document/v1 ``` ```json theme={null} { "title": "my-new-doc-024", "libraryId": "RsjaTyH8w59078Zx7Dk", "fields": [ { "fieldId": "RxUjYCe8AAx2YAju5NW", "values": [ "a@a.com", "b@b.com" ] } ] } ``` #### Expected API formats for custom fields | **TYPE OF CUSTOM FIELD** | **EXPECTED JSON FORMAT** | **CAN BE MULTIVALUE?** | | :----------------------- | :---------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | | STRING | A JSON string of alphanumeric and special characters; 400-character limit | Yes | | TEXT | A JSON string with no HTML parsing; you can add line breaks + no limit | Yes | | PERSON | A JSON string representing a user or group email address | Yes (only accepts groups when multivalued, as groups are considered “multiple persons”) | | DATETIME | Unix timestamp in milliseconds since the beginning of 1 January 1970, as a JSON string (will not accept integers) | No | | INTEGER | JSON integer values (0, 1, 2, -1,.. limited to +/- 2,147,483,647) | No | | DECIMAL | JSON decimal values (0.1, -5.1, 1.655,..) with maximum 3 decimal digits | No | | BOOLEAN | `true` or `false` | No | # Search documents of a class Source: https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/search-documents-of-a-class POST https://aodocs.altirnao.com/api/search/v1/libraries/{libraryId}/search You can search for documents associated with a particular library and a particular class as follows. ## Method and API Play with the API Explorer: ## Usage/notes/guidelines This method searches documents of a class matching the provided query. It might become very slow or time out when iterating over many pages of results. If the result set contains more than 10,000 documents, it's highly likely the response will get truncated and some results will be missing. You should always check if `precision=INCOMPLETE_RESULT` in the response. **Note:** By default, the method includes attachments in the search. You can exclude searching in attachments by setting the `searchInAttachments` parameter to `false`. ### Request `libraryId` is a path parameter and `classId` is a query parameter. These are the only mandatory arguments. However, the `searchQuery` query parameter is what ultimately determines what results come back, filtering them on a text string. **Note:** If you want to search for a specific phrase as a singular whole, put double quotes around the phrase being passed as a `searchQuery` query parameter. For example, if your document is called "big blue document", then sending "big blue" or "blue document" (with the double quotes) as the `searchQuery` query parameter finds it, but "big document" does not. ```yaml Sample request theme={null} POST https://aodocs.altirnao.com/api/search/v1/libraries/RrVWqiT8059P4t8aVYI/search?classId=RrVWtjs801GlsyxIDJe&searchQuery=%22blue%20document%22 ``` ## Response The response returns an [ApiDocumentList](/api-reference/documentid) resource, listing all documents associated with the specified library and class. ```json theme={null} { "kind": "aodocs#documentList", "documentList": [ { "kind": "aodocs#document", "libraryName": "my-DMS-lib-001", "className": "my-dms-class-002", "libraryId": "RrVWqiT8059P4t8aVYI", "classId": "RrVWtjs801GlsyxIDJe", "id": "RnTzVT28x5Sb48h3vSQ", <— documentId "title": "big blue document", ... } ... ] } ``` # Get library and class info Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info Get all the IDs you need by getting or listing your resources as follows: * List all available AODocs libraries (full) * List all available AODocs libraries (plain) * Get a specific library by ID * List classes (to find target classes for your documents) * Get a specific class by ID # Get a specific class by ID Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/get-a-specific-class-by-id GET https://aodocs.altirnao.com/api/documentType/v1/libraries/{libId}/documentTypes/{documentTypeId} You can retrieve (the configuration of) a specific class/documentType to confirm it exists or to parse something from its metadata if you have its `documentTypeId` (class ID). ## Method and API Play with the API Explorer: ## [GET /documentType/v1/libraries/\{libId}/documentTypes/\{documentTypeId}](/api-reference/document-type) In the command above: * `documentType` is the API * `v1` is the API version * `libraries` is the top-level resource * `documentTypes` or class is the nested resource ## Guidelines ### Request Pass the mandatory class ID (`documentTypeId`) and the library ID (`libId`) of the library the class resides in — both as ***path* parameters** (not in the query string). ```yaml Sample request theme={null} GET https://aodocs.altirnao.com/api/_ah/api/documentType/v1/libraries/Rs4xtue86axGNklquDP/documentTypes/Rs4xuIg86e45fvAsn9L ``` ## Response The response returns an [ApiDocumentType](/api-reference/document-type) resource, listing the specified class. **Response fields of note:** * `id` (of the class) * `displayName` (of the class) * `libraryId` (of the library you searched) * `defaultClass` (whether or not this is the library's default class) ```json Sample response theme={null} { "kind": "aodocs#documentType", "id": "RnTbOft44KfZYkfBpV", "displayName": "my-dms-class-001-not-default", "libraryId": "RnTG8PDu8ZqTuDVHcv", "defaultClass": true } ``` # Get a specific library by ID Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/get-a-specific-library-by-id GET https://aodocs.altirnao.com/api/library/{libId} You can retrieve to parse something from its metadata (or to confirm it exists) if you have its `libraryId`. ## Method and API Play with the API Explorer: ### [GET /library/\{libId}](/api-reference/library) ## Usage/notes/guidelines ### Request To get your desired library back in the response you have to provide the library ID. This is the only mandatory field. If you want the response to come back with only a core set of metadata for your library, set the `include` parameter to `NONE`. ```yaml Sample request theme={null} GET https://aodocs.altirnao.com/api/library/v1/RrVcEFb8wtDeNAnlmNN ``` ## Responses The response returns an [ApiLibrary](/api-reference/library) resource, listing the library associated with the provided library ID. **Response fields of Info:** * `libraryId` * `name` / homeUrl * `rootFolderId` (the ID of the topmost level of the library's hierarchy) * `defaultDocumentType` (the library's default class ID) * `favorited` (whether or not the library is starred as a favorite) * any other fields of interest ```json Sample response (include=NONE) theme={null} { "kind": "aodocs#library", "libraryId": "RnTG8PD8u8ZqTuDVHcv", "name": "my-DMS-lib-001", "homeUrl": "my-dms-lib-001", "daysBeforeDelete": 30, "welcomeText": "

Welcome to your new Document Management library: my-DMS-lib-001


To get started...

", "storageAdmin": "storage.account@test.aodocs.com", "pushToMyDrive": false, "onlyAdminsCanManageFolders": false, "onlyAdminsCanEditRootFolder": false, "defaultDocumentType": "RnTbOft844KfZYkfBpV", "rootFolderId": "1S7ayhti78VtuNl-SebgGTu_wliznnR47", "defaultView": "RnTbOoS8wQ32JuKPEi1", "favorited": true ... } ```
# Get document class info Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/get-document-class-info Libraries contain documents of various types. These document types, defined ahead of time, are called [classes](https://support.aodocs.com/hc/en-us/articles/205655634) . When a library is first created, it automatically gets outfitted with a default document type, or class. Other classes in your target library might already have been created for you. These methods are useful when working with classes: What follows is an el aboration on each of these methods. # Get library info Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/get-library-info AODocs content is contained in libraries. Your libraries should already exist; if they don’t, a library administrator needs to [create them first](https://support.aodocs.com/hc/en-us/articles/115002366923-Create-a-library-from-scratch). AODocs content is contained in libraries. Your libraries should already exist; if they don’t, a library administrator needs to [create them first](https://support.aodocs.com/hc/en-us/articles/115002366923-Create-a-library-from-scratch). Once your libraries exist, you can list them to get an idea of where to place your content. The most useful methods to list and get libraries are the following: What follows are elaborations on these methods. # List and search libraries (v2beta1) Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/list-and-search-libraries GET https://aodocs.altirnao.com/api/search/v2beta1/search This method allows you to search for target libraries on your domain with string queries (including quoted phrases) as well as several parameters to help narrow the scope. Without them, what comes back in the response is the full list of libraries available to you. ### Method and API Play with the API Explorer: #### [GET /search/v2beta1/search](/api-reference/library) ### Usage/notes/guidelines The search can be conducted without any parameters, returning all libraries that you are authorized to access, in an undefined order. #### Request Several useful parameters are available to help narrow the search. #### Request parameters of note The `query` query parameter is what ultimately determines what results come back, filtering them on a text string. You can search for the following: * a word (like *blue*) * several words in any order (*document big blue*) * an exact phrase (*“big blue document”* — two or more words in exact order in double quotes) * an inexact phrase (*\~“big blue document”* — exact phrase but allowing for common variants of its constituent words, like *bigger*, *blues*, and *documenting*) * a substring of characters in a word (only at the prefix position, e.g. *docu*) * a library ID (equivalent of get library) **Note:** The double quotes return only adjacent words in a phrase. For example, if your document is called *big blue document*, then sending *"big blue"* or *"blue document"* (with the double quotes) as a phrase in the `query` query parameter finds *big blue document*, but sending *"big document"* as a phrase does not. By default, you receive a response containing no more information than you need. If you are a domain administrator (superadmin), you can change the `userSuperAdminAccess`’s default value of `false` to `true` to elevate your privileges to return libraries accessible to all domain administrators. Use this flag if you want to have access to libraries you are at least an `ADMIN` of. For example, if you want to know which libraries you’re authorized to import content into, then you don’t want to consider libraries you only have `READER` privileges for (since you can’t import at that level). You can specify which of the three types of libraries you get in the response in any combination. Specifying none is the same as specifying all. You can either request results from all storage accounts available to you, or you can specify one storage account at a time. When you list all libraries in the UI, you can see a list of labels in the left panel ordered alphabetically. With this parameter, you can request libraries by label, including several at a time. If set to `true`, returns just this user’s favorite libraries. You can either get your results ordered arbitrarily, or you can use this parameter to sort your results by one and only one of the following: * `NAME` (ascending) * `LAST_ACCESSED` (descending) * `TASK_COUNT` (descending) * `FAVORITE_FIRST` **Note:** The `orderBy` parameter bears a performance penalty and has a limit of 10,000 results. Check the `incompleteResults` flag in the response. (default: `20`) You can choose an arbitrary number of results to display, up to 1000. (default: `false`) If you don’t specify this parameter, the result will contain a `totalResultCount` field that is an estimate of the total number of results matching your query (not only for the current page). The `estimatedResultCount` field in the response will be set to `true`. This is the default behavior: the query is usually much faster when all it has to do is estimate the total number of results (instead of counting). The downside is that it’s just an estimate — within about an order of magnitude — so the higher the values, the more significant the divergence. If `requirePreciseResults` is set to `true`, then up to 25,000 results, the response’s `totalResultCount` will contain the exact number of results that match your initial request, and beyond that, it’ll contain an estimate. The `estimatedResultCount` will be set to `true` in either case. (default: `nothing`) If you want information in addition to the default `nothing` setting, change the `include` parameter to one of the following: * `STATISTICS` (only for domain administrators) * `LABELS` * `IS_FAVORITE` * `LAST_ACCESSED` * `TASK_COUNT` **Note:** There are some performance costs associated with each of these values, and the more of them are included, the more the performance degrades. This parameter is used for [pagination](/best-practices/performance-considerations) purposes. If you need to request the next page of results, populate this parameter with the value of the `nextPageToken` from the last response (keeping all other parameter values exactly the same). #### Sample request (no parameters: list all) ```yaml theme={null} GET https://aodocs.altirnao.com/api/library/v2beta1/search ``` Alternatively use the [List plain libraries](/api-reference/library) method (see below) to get just the key-value pairs of `name` and `id`. #### Sample request (specific search) ```yaml theme={null} GET https://aodocs.altirnao.com/api/library/v2beta1/search?query=001&minimumCurrentUserRole=WRITER&libTypes=TF&favorite=true&orderBy=LAST_ACCESSED&limit=3&requirePreciseResults=true&facets=true&include=LAST_ACCESSED HTTP/1.1 ``` ## Responses The response returns an [ApiLibrarySearchResultList](/api-reference/library) resource, listing all libraries which are accessible to you on the domain and which match the specified query (no query means “all”). Take note of the `libraryId` of your target library. The library ID is one of the most commonly used identifiers in the AODocs APIs. Additional fields to note: * `name` (of the library) * `defaultDocumentType` (the library’s default class ID) * `rootFolderId` (the ID of the topmost level of the library’s hierarchy) * `favorited` (whether or not the library is starred as a favorite) * any other fields of interest ```json Sample response theme={null} { "kind": "aodocs#librarySearchResultList", "libraries": [ { "id": "R6l0hkc80sxwUgY987R", "name": "my TF library 001", "libraryType": "TF", "storageAccount": "storage-account@test.altirnao.com", "rootFolderId": "1Rxi3ir8tGD1ektc6M5NnEP8Lz2NVNen9A", "folderVisibility": "PUBLICLY_EDITABLE", "onlyAdminsCanManageFolders": false, "currentUserRole": "ADMIN", "kind": "aodocs#librarySearchResult", "lastAccessed": null }, ... ], "nextPageToken": "eyJpbk18lbW9yeSI6Z...c0Mn0=", "totalResultCount": 51, "estimatedResultCount": false, "incompleteResults": false } ``` ### List libraries and find `libraryId` in UI You can also locate the `libraryId` of your target library inside the AODocs UI. Go to your homepage > My libraries by clicking on the “My libraries” link in the upper left corner of most pages: libraryid-in-ui.png Open the desired target library, and note the library ID in the URL. It’s the long string of numbers and letters after `LibraryId_` (up to and *excluding* the next slash): `/LibraryId_` #### Example `/LibraryId_RnTG8PD8u8ZqTuDVHcv` Learn more about [navigating homepages](https://support.aodocs.com/hc/en-us/articles/208769506-What-is-the-AODocs-homepage-#h_594b6e3a-aebb-4b71-8d8e-a4c8aad7cc51) inside your AODocs and specific libraries. # List classes (to find target classes for your documents) Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/list-classes PUT https://aodocs.altirnao.com/api/documentType/v1/libraries/{libraryId} You can list available target classes for your documents as follows: ### Method and API Play with the API Explorer: ### [PUT /documentType/v1/libraries/\{libraryId}](/api-reference/document-type) ### Guidelines ### Request Only `libraryId` is mandatory. #### Sample request ```yaml Sample request theme={null} GET https://aodocs.altirnao.com/api/documentType/v1/libraries/RrVcEFb8wtDeNAnlmNN ``` To return just the bare minimum of class ID and displayName in the response, you can filter the results by populating the `fields` query parameter with `items(displayName,id,kind),kind` with `%2C` in place of each comma as follows: ```yaml theme={null} ?fields=items(displayName%2Cid%2Ckind)%2Ckind ``` ## Responses The response returns an [ApiDocumentTypeList](/api-reference/document-type) resource, listing all document classes available as part of the specified library. **Response fields of note:** * `id` (of the class) * `displayName`(of the class) * `libraryId` (of the library we searched) * `defaultClass` (whether or not this is the library's default class) * any other fields of interest ```json Samplefull response theme={null} { "kind": "aodocs#classList", "items": [ { "kind": "aodocs#classId", "id": "RnTbOft44KfZYkfBpV", "displayName": "my-dms-class-001-default", "libraryId": "RnTG8PDu8ZqTuDVHcv", "defaultClass": true, }, { "kind": "aodocs#classId", "id": "RnTf1mx35gaTJLzoFp", "displayName": "my-dms-class-002-not-default", "libraryId": "RnTG8PDu8ZqTuDVHcv", "defaultClass": false, } ] } ``` ```json Sample filtered response theme={null} { "kind": "aodocs#classList", "items": [ { "kind": "aodocs#classId", "id": "Rmk8LOJ1y0Jlwq8cxz", "displayName": "testClassInsideDMS" }, { "kind": "aodocs#classId", "id": "Rmn9gYNz9JwCVfQaIK", "displayName": "testClass2insideDMS" } ] } ``` ## List classes in the UI You can also list your library classes in the UI, on the Library Administration page. Go to Administration > Library administration. In the left-hand pane, go to Library configuration > Document classes. This is where your classes are listed. Note the singular green checkmark signifying the library’s default class. list-classes-in-ui.png # List libraries and find target library ID for your documents (legacy v1) Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/list-libraries-and-find-target-library-id-for-your-documents PUT https://aodocs.altirnao.com/api/library/v1 To list target libraries on your domain, select a target library for your AODocs documents to be a part of, and note the target library’s unique identifier, `libraryId`. ## Method and API Play with the API Explorer: ### [PUT /library/v1](/api-reference/library) ### Request **Warning/Alert**: This method requests all metadata for all libraries on the domain. Not recommended without filtering! This method has no mandatory parameters, but without setting any filtering it tries to return all metadata for all libraries, which is often overwhelming to the server and might not produce any response. We strongly recommend you set the `include` query parameter to `NONE`. ### Sample request ```yaml Sample request theme={null} PUT https://aodocs.altirnao.com/api/library/v1?include=NONE ``` Alternatively use the [List plain libraries](/api-reference/library) method (see below) to get just the key-value pairs of `name` and `id`. ## Responses The response returns an [ApiLibraryList](/api-reference/library) resource, listing all libraries accessible to you on the domain. With the recommended parameter `include=NONE` the response is smaller and far more manageable. Take note of the `libraryId` of your target library. The library ID is one of the most commonly used identifiers in the AODocs APIs. **Additional fields to note:** * `name` (of the library) * `defaultDocumentType` (the library's default class ID) * `rootFolderId` (the ID of the topmost level of the library's hierarchy) * `favorited` (whether or not the library is starred as a favorite) * any other fields of interest ```json Sample response theme={null} { "kind": "aodocs#libraryList", "libraries": [ { "kind": "aodocs#library", "libraryId": "RnTG8PD8u8ZqTuDVHcv", "name": "my-DMS-lib-001", "defaultDocumentType": "RnTbOft844KfZYkfBpV", "rootFolderId": "1S7ayht8i78VtuNl-SebgGTu_wliznnR47", "favorited": false, ... }, { "kind": "aodocs#library", "libraryId": "Rngc1ug8K6WmL3IjZ8", "name": "my-sf-lib-005", "defaultDocumentType": "Rngc4rL89JCj5xwTtrF", "rootFolderId": "1yAMvoT8BFEvI_8GXghiyTEJqevJeW7q9C", "favorited": true } } ``` # List libraries plain (alternative to List libraries) Source: https://api.aodocs.com/manage-aodocs-documents/get-library-and-class-info/list-libraries-plain PUT https://aodocs.altirnao.com/api/library/v1/plain If you only need the library name and ID in the response, then you can use the plain library list ([ApiPlainLibraryList](/api-reference/library)) as an alternative to the full library list ([ApiLibraryList](/api-reference/library)). It is usually much faster than the standard library list API method, but returns much less information. ### Method and API Play with the API Explorer: #### [PUT /library/v1/plain](/api-reference/library) ### Usage/notes/guidelines #### Request There are no mandatory or recommended parameters to send. #### Sample request ```yaml theme={null} PUT https://aodocs.altirnao.com/api/library/v1/plain ``` ## Responses The response returns an [ApiPlainLibraryList](/api-reference/library) resource, listing all libraries accessible to you on the domain, but only listing the following for each: * library name * library ID * modification dates Take note of the `libraryId` of your target library. The library ID is one of the most commonly used identifiers in the AODocs APIs. Additional response fields to note: * `name` (of the library) ```json Sample response theme={null} { "kind": "aodocs#plainLibrary", "libraryId": "RnTG8PD8u8ZqTuDVHcv", "name": "my-DMS-lib-001", "lastModified": "1579005945318", "lastConfigModified": "1579005945318" }, { "kind": "aodocs#plainLibrary", "libraryId": "Rngc1ug8K6WmL3IjZ8", "name": "my-sf-lib-005", "lastModified": "1579619340936", "lastConfigModified": "1579619340936" } ... ```