# ¿Cómo subir archivos a través de la API?

**URL:** https://meta.discourse.org/t/how-to-upload-files-through-the-api/204310
**Category:** Development
**Tags:** rest-api
**Created:** [23 Septiembre, 2021 13:36 UTC](https://meta.discourse.org/t/how-to-upload-files-through-the-api/204310 "2021-09-23T13:36:45Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [27 Septiembre, 2021 20:38 UTC](https://meta.discourse.org/t/how-to-upload-files-through-the-api/204310/4 "2021-09-27T20:38:40Z")

</div>

Aquí tienes un ejemplo en Node que alguien logró hacer funcionar y que podría ayudarte:

> [@How to upload images via API with Node.js?](https://meta.discourse.org/t/how-to-upload-images-via-api-with-node-js/172605/2?u=blake):
>
> I got this to work, like this: import Axios from "axios"; import FormData from "form-data"; import fs from "fs"; const http = Axios.create({ baseURL: "https://forum.zeebe.io", headers: { "Api-Key": "...", "Api-Username": "...", "Content-Type": "application/json", Accept: "application/json", }, }); http.interceptors.request.use((config) =\> { if (config.data instanceof FormData) { Object.assign(config.headers, config.data.getHeaders()); } return config; }); …

---

_[View the full topic](https://meta.discourse.org/t/how-to-upload-files-through-the-api/204310)._
