User File Associations in Mavenlink act as a join object between Users, Workspaces, and Attachments / Google Documents.
To fetch a paginated set of User File Associations for the requesting user, make a GET request as follows:
The resulting JSON will contain the User File Association data in the
user_file_associations key at the root of the response.
These results will be referenced in the
results array, sorted by creation date. Each object will have the following fields:
id- the internal user file association id
post_id- the Mavenlink Post ID that the Attachment or Google Document is associated with
workspace_id- the Workspace ID for the Post
You can include User File Associations' associations with the
include param. For example, to include the Workspace,
Post, and associated Attachment or Google Document, request the following:
In this example, our API will ensure that the returned JSON contains top-level keys called
workspaces, and one or both of
google_documents, depending on what polymorphic assets were referenced. See Object Associations
to learn more about how the Mavenlink API handles associations. The following associations can be requested on this endpoint:
post- When included, the
post_idwill reference the Post for which the User File Association belongs.
workspace- When included, the
workspace_idwill reference the Workspace for which the User File Association belongs.
asset_object- When included, the polymorphic
asset_object_refstruct will reference the Attachment or Google Document for which the User File Association belongs. This will be a a two-key JSON object with "id" and "key", where the "key" will be "attachments" or "google_documents".