# Discourse API로 사용자의 게시 이력을 다운로드하는 방법?

**URL:** https://meta.discourse.org/t/download-a-users-posting-history-via-discourse-api/183330
**Category:** Support
**Created:** [3월 15, 2021, 5:25오후 UTC](https://meta.discourse.org/t/download-a-users-posting-history-via-discourse-api/183330 "2021-03-15T17:25:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Maddieman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maddieman/32/213288_2.png) [@Maddieman](https://meta.discourse.org/u/Maddieman)
#### Post date: [3월 15, 2021, 5:25오후 UTC](https://meta.discourse.org/t/download-a-users-posting-history-via-discourse-api/183330/1 "2021-03-15T17:25:35Z")

</div>

안녕하세요,

법적 의무를 준수하기 위해, 사용자가 Discourse API를 통해 자신의 전체 게시 이력(요약이 아닌 전체 글)을 다운로드할 수 있는 방법이 필요합니다. 이렇게 하면 사용자가 저희 웹사이트 또는 법무팀에 직접 DSAR(데이터 접근 요청)을 할 때, Last.fm 데이터와 Discourse 게시 데이터에 대한 완전한 기록을 제공받을 수 있습니다. 현재 이것이 가능한가요? 가능하다면, 어떻게 진행해야 하는 것이 올바른 방법일까요?

저희는 get user actions([Discourse API Docs](https://docs.discourse.org/#tag/Users/paths/~1user_actions.json/get))를 사용하여 이를 시도해 보았지만, 이는 전체 게시물이 아닌 발췌문(요약)의 일부 기록만 반환하는 것 같습니다.

사용자가 이미 Discourse의 활동 설정 페이지에서 직접 데이터를 다운로드할 수 있다는 점은 알고 있습니다. 하지만 저희 법무팀은 이 방법만으로는 충분하지 않다고 주장하고 있습니다. (🙄) 데이터가 반드시 저희 웹사이트에서 다운로드되어야 한다고 요구하고 있습니다. 혹시 아이디어가 있을까요? 이 문제를 해결하지 못하면 호스팅 플랜에서 이탈해야 할지도 모른다는 점이 걱정됩니다.

도움 주시면 감사하겠습니다. 😔

---

<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: [3월 15, 2021, 6:23오후 UTC](https://meta.discourse.org/t/download-a-users-posting-history-via-discourse-api/183330/2 "2021-03-15T18:23:28Z")

</div>

API를 이용하면 가능할 수도 있습니다( [Discourse API 역공학 방법](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576) 참고). 하지만 다른 사람이 자신의 데이터를 다운로드하는 것을 방지하기 위해 이메일 인증 링크를 클릭해야 한다는 요구사항을 우회하는 쉬운 방법은 없습니다.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [3월 16, 2021, 12:08오전 UTC](https://meta.discourse.org/t/download-a-users-posting-history-via-discourse-api/183330/3 "2021-03-16T00:08:18Z")

</div>

Jay가 언급했듯이, `/export_csv/export_entity.json`에 인증된 `Post` 요청을 보내면 아카이브를 생성할 수 있습니다. 이를 위해 All Users Global API 키를 사용해야 합니다. 요청의 API 사용자를 아카이브를 생성하려는 사용자의 사용자 이름으로 설정해야 합니다. 또한 요청에 `entity` 매개변수를 제공해야 하며, `entity` 매개변수는 `user_archive`로 설정해야 합니다. 이 방식을 사용하면 해당 사용자에게 알림이 생성됩니다. 대부분의 사용자에게는 다운로드 링크가 포함된 이메일도 전송되지만, 이는 사용자의 이메일 설정에 따라 달라질 수 있으므로 이를 신뢰하기는 어렵다고 생각합니다.

아카이브를 생성하기 위한 curl 요청 예시입니다. 요청에서 `$api_key`는 Global All Users API 키로 대체되었습니다:

` curl -X POST "http://localhost:3000/export_csv/export_entity.json" -H "Api-Username: Ben" -H "Api-Key: $api_key" -F "entity=user_archive"`

사용자가 알림에 접근하여 다운로드 링크를 클릭하지 않고도 아카이브를 공유할 수 있도록 생성하는 방법이 있는지 확실하지 않습니다. 정보를 반환할 수 있는 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 쿼리를 개발할 수 있을 것입니다. 그러면 API를 통해 해당 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 쿼리를 실행할 수 있습니다. 이 방식의 단점은 쿼리에서 10,000개 이상의 데이터 행이 반환되는 경우 데이터를 가져오기 위해 여러 번의 요청을 해야 한다는 점입니다. [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 방식에 대한 자세한 내용은 다음을 참고하세요: [Discourse API를 사용하여 Data Explorer 쿼리 실행 방법](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063).

---

<div class="post-metadata">

### Author: ![Maddieman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maddieman/32/213288_2.png) [@Maddieman](https://meta.discourse.org/u/Maddieman)
#### Post date: [3월 16, 2021, 10:33오전 UTC](https://meta.discourse.org/t/download-a-users-posting-history-via-discourse-api/183330/4 "2021-03-16T10:33:34Z")

</div>

감사합니다. 이 정보를 개발팀에 전달할게요 – 큰 어려움 없이 해결할 수 있기를 바랍니다. 🤞
