# API経由でオフサイトアバター？

**URL:** <https://meta.discourse.org/t/off-site-avatar-via-api/168370>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [2020 年 10 月 27 日午前 10:55 UTC](https://meta.discourse.org/t/off-site-avatar-via-api/168370 "2020-10-27T10:55:51Z")\
**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:** [2020 年 10 月 28 日午後 6:29 UTC](https://meta.discourse.org/t/off-site-avatar-via-api/168370/4 "2020-10-28T18:29:22Z")

</div>

> [@Judith](#):
>
> このリクエストは「Internal Server Error」を返します。

それは、Faraday でファイルの URL を直接指定できないためだと思います。まずファイルを読み込む必要があるか、同様の処理が必要でしょう。

ただし、discourse\_api gem を使用して、URL を指定してアバターを更新することは可能です。

```ruby
client.update_avatar(
  username: "norbert6",
  url: "http://vignette1.wikia.nocookie.net/despicableme/images/1/15/Jerryindespicableme.png"
)

```

---

_[View the full topic](https://meta.discourse.org/t/off-site-avatar-via-api/168370)._
