# API를 통한 사용자 아바타 선택이 더 이상 작동하지 않음

**URL:** <https://meta.discourse.org/t/user-avatar-selection-through-api-no-longer-working/211661>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [12월 9, 2021, 8:59오후 UTC](https://meta.discourse.org/t/user-avatar-selection-through-api-no-longer-working/211661 "2021-12-09T20:59:16Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [12월 17, 2021, 10:33오후 UTC](https://meta.discourse.org/t/user-avatar-selection-through-api-no-longer-working/211661/6 "2021-12-17T22:33:04Z")

</div>

이 문제는 `discourse connect overrides avatar` 사이트 설정 때문인 것 같습니다.

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/1/e17e2e34c5eb6623b4313bab9a07a673e19bd593.png)

> [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) 페이로드의 값으로 사용자 아바타를 덮어씁니다. 활성화된 경우, 사용자는 Discourse에서 아바타를 업로드할 수 없습니다.

저희 로컬 환경에서 해당 설정을 해제하면 API를 통해 아바타를 업데이트할 때 200 HTTP 응답을 받습니다:

```plaintext
curl -i -sS -X PUT "http://localhost:4200/u/10614bb2d4eacd328c45/preferences/avatar/pick.json" \
-H "Content-Type: multipart/form-data" \
-H "Api-Key: 6cea489d21282803c446fd2e9d236901c3d186f36079911833db4b57c43c01d5" \
-H "Api-Username: blake.erickson" \
-F "upload_id=57" \
-F "type=uploaded"

HTTP/1.1 200 OK

```

해당 설정을 체크하면 422 오류가 발생합니다:

```plaintext
curl -i -sS -X PUT "http://localhost:4200/u/021ca796a01ad178bc52/preferences/avatar/pick.json" \
-H "Content-Type: multipart/form-data" \
-H "Api-Key: 6cea489d21282803c446fd2e9d236901c3d186f36079911833db4b57c43c01d5" \
-H "Api-Username: blake.erickson" \
-F "upload_id=57" \
-F "type=uploaded"

HTTP/1.1 422 Unprocessable Entity

```

---

_[View the full topic](https://meta.discourse.org/t/user-avatar-selection-through-api-no-longer-working/211661)._
