# 你能获取通过API下载备份所需的令牌吗？

**URL:** <https://meta.discourse.org/t/can-you-get-the-token-needed-to-download-backups-via-the-api/313487>\
**Category:** Development\
**Tags:** backups, rest-api\
**Created:** [2024年六月25日 04:03 UTC](https://meta.discourse.org/t/can-you-get-the-token-needed-to-download-backups-via-the-api/313487 "2024-06-25T04:03:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paperdigits](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@paperdigits](https://meta.discourse.org/u/paperdigits)\
**Post date:** [2024年六月25日 04:03 UTC](https://meta.discourse.org/t/can-you-get-the-token-needed-to-download-backups-via-the-api/313487/1 "2024-06-25T04:03:18Z")

</div>

我正在尝试通过 API 下载备份，但文档中说[需要一个令牌](https://docs.discourse.org/#tag/Backups/operation/downloadBackup)才能下载文件。但我找不到任何关于如何通过 API 获取此令牌的文档。它似乎只存在于发送的电子邮件中。通过电子邮件链接手动下载备份是唯一的方法吗？或者我可以通过 API 获取必要的令牌吗？

---

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2024年六月25日 04:16 UTC](https://meta.discourse.org/t/can-you-get-the-token-needed-to-download-backups-via-the-api/313487/2 "2024-06-25T04:16:18Z")

</div>

你好 @paperdigits 👋 欢迎回来 🙂

你是否看到了这个话题？

> [@Download a backup from an email link with \`wget\`](https://meta.discourse.org/t/download-a-backup-with-wget/170623):
>
> For a seasoned sysadmin, the favored way of moving large files is a tool like rsync or scp, but sometimes, you don’t have ssh access to the host where you need to retrieve a large backup file. Because backup files contain sensitive information, Discourse’s has security features that make it very difficult for an unauthorized person to retrieve a backup. You must get a download link via email and use that link logged in as the user who requested it. If you want to download the data with a web br…

---

<div class="post-metadata">

**Author:** ![paperdigits](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@paperdigits](https://meta.discourse.org/u/paperdigits)\
**Post date:** [2024年六月25日 04:19 UTC](https://meta.discourse.org/t/can-you-get-the-token-needed-to-download-backups-via-the-api/313487/3 "2024-06-25T04:19:18Z")

</div>

是的，我已经收到了。所以答案是“你只能从电子邮件中获取令牌”，对吗？

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2024年六月25日 10:10 UTC](https://meta.discourse.org/t/can-you-get-the-token-needed-to-download-backups-via-the-api/313487/4 "2024-06-25T10:10:45Z")

</div>

您可以从 rails 获取令牌，尽管我暂时不知道如何操作。

您在解决什么问题？您是否尝试定期将备份复制到其他位置？

> [@Lilly](#):
>
> 您碰巧看到这个话题了吗？

我没看到，这很奇怪，因为是我写的。我以为我以前已经解决了这个问题 😂🤔
