Documentation Index
Fetch the complete documentation index at: https://api.aodocs.com/llms.txt
Use this file to discover all available pages before exploring further.
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.
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 .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:
folder:folderId pair:
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.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:
attachmentsattachmentsToCopyattachments, 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.
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 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.
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.200 OK status code and a JSON-formatted representation of an ApiDocument 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.