【问题标题】:is there a full Nextcloud API accessable from outside?是否有可以从外部访问的完整 Nextcloud API?
【发布时间】:2021-12-28 14:03:40
【问题描述】:

我以普通用户的身份使用 Nextcloud 来存储和共享文件。

我决定将它用作我正在开发的 Web 应用程序的后端,以便我可以将文件存储在 Nextcloud 中,而前端由我完成。

我在 API 文档上花了几个小时 https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/index.html

并且有些失望,除非我没有犯错,否则我意识到唯一可以从 Nextcloud 外部使用的 API 是 WebDav API。 这是一个简约的 API,它允许做一些基本的事情,例如通过像这个 GET 语句一样传递完整路径来上传文件(通过基本身份验证在标题中传递用户名和密码:

GET https://nextcloud.example.com/remote.php/dav/files/username/FolderOne/SubFolderTwo/HelloWorld.txt

这将下载位于 /FolderOne/SubFolderTwo/HelloWorld.txt 中的文件

使用PUT 请求,可以通过在原始正文请求中传递文件内容来覆盖文件

这是非常有效但极简的。

我期待拥有一个完整的 REST API 来访问更多属性并执行复杂的操作。

如果我遗漏了一些重要信息,您能告诉我吗?

有 OCS API,但它只能在 Nextcloud 内部工作。

谢谢。

【问题讨论】:

    标签: api rest nextcloud


    【解决方案1】:

    完整的 REST API 可用 - https://docs.nextcloud.com/server/22/developer_manual/client_apis/OCS/ocs-api-overview.html

    创建共享 - https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html

    OwnCloud 文档还提供了更多示例 https://doc.owncloud.com/server/10.8/developer_manual/core/apis/ocs-share-api.html

    您可以注册一个 App id 并使用它来登录或通过身份验证标头中的用户名和密码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-28
      • 2020-03-26
      • 2021-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多