Skip to content

External API for attachments #826

@korelstar

Description

@korelstar

#785 introduced a new functionality for attachments (see also #74). The internal API contains two new straight-forward endpoints:

  • POST /notes/{noteid}/attachment: uploads a new attachment to a note and returns the relative filepath
  • GET /notes/{noteid}/attachment?path={path}: downloads an existing attachment using the relative filepath

I would like to expose this functionality also to the external API so that third-party apps can use it. However, I'm not sure, if these endpoints are sufficient for you app developer @nextcloud/notes @stefan-niedermann. Therefore, please provide feedback!

What I have in mind is the following: when there are these two API changes only, your app will have to parse a note for image tags (e.g. ![label](relative image path)) and (optionally) links (e.g. [label](relative link path)) and then run subsequent requests to the GET attachment endpoint.

Another alternative is to do this parsing (also) on the server and provide a list of attachments together with the note's response (new attribute besides title, content etc). However, this will slow down synchronization and your app will still have to parse the note in order to show those images.

Hence, I vote for staying with these two changes (just add GET attachment and POST attachment) and the client will have to do the rest. Do you agree with this approach or do you see any other requirements for this API? @nextcloud/notes @stefan-niedermann

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeature: APIRelated to the API for 3rd-party apps, i.e. Android or iOSneeds discussionNeed to clarify if and how we should implement this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions