# API를 통해 사진을 게시하는 방법은?

**URL:** <https://meta.discourse.org/t/how-to-post-pictures-via-api/314282>\
**Category:** Development\
**Created:** [6월 29, 2024, 6:49오전 UTC](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282 "2024-06-29T06:49:34Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)\
**Post date:** [7월 5, 2024, 2:16오전 UTC](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282/13 "2024-07-05T02:16:13Z")

</div>

늦게 합류했지만, 이전에 nodejs용 서드파티 discourse-api를 작성한 적이 있습니다:

> **[DiscourseApi | node-discourse-api](https://lhcfl.github.io/node-discourse-api/classes/api.DiscourseApi.html#createUpload)**
>
> Create a upload | Documentation for node-discourse-api

이 라이브러리를 사용하면 업로드를 쉽게 생성할 수 있습니다. 이렇게 하면 됩니다:

```js
const { DiscourseApi } = require("node-discourse-api");
const api = new DiscourseApi("https://discourse.example.com");
api.options.api_username = "API_USERNAME";
api.options.api_key = "API_KEY";

api.createUpload(file_path_or_buffer, { filename: "filename" })

```

(참고: 이 라이브러리는 완성된 것이 아닙니다)

---

_[View the full topic](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282)._
