# How to get uploaded image url using the Discourse API?

**URL:** https://meta.discourse.org/t/how-to-get-uploaded-image-url-using-the-discourse-api/37800
**Category:** Development
**Tags:** rest-api
**Created:** [1월 12, 2016, 3:51오전 UTC](https://meta.discourse.org/t/how-to-get-uploaded-image-url-using-the-discourse-api/37800 "2016-01-12T03:51:27Z")
**Posts on this page:** 1
**Showing post:** 16

<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: [1월 12, 2017, 4:59오후 UTC](https://meta.discourse.org/t/how-to-get-uploaded-image-url-using-the-discourse-api/37800/16 "2017-01-12T16:59:50Z")

</div>

sorry the `user_id` is only if the type is `avatar`.

I’m pretty sure you will need a post\_id though if you are uploading it to a post.

I’m not sure off the top of my head, but you can:

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

The current issue you will run into though is that we don’t return the `upload_id`:

> [@Upload avatar image with API](https://meta.discourse.org/t/upload-avatar-image-with-api/55253/2):
>
> The problem I found is that this just returns { “success”: “OK” } and doesn’t return the upload\_id?

---

_[View the full topic](https://meta.discourse.org/t/how-to-get-uploaded-image-url-using-the-discourse-api/37800)._
