전역(Global) 액세스 권한이 있는 API 키를 "모든 사용자(All Users)"에 대해 가지고 있습니다.
다음과 같이 요청을 보내고 있습니다:
$updateAvatarUrl = sprintf("%s/u/%s/preferences/avatar/pick.json", $this->apiHost, $username);
$headers = array(
"Api-Key: ".$this->apiKey,
"Api-Username: ".$this->apiUsername
);
$data = array(
'upload_id' => $uploadId,
'type' => 'uploaded'
);
$response = Q_Utils::put($updateAvatarUrl, $data, null, null, $headers);
하지만 반환되는 결과는 다음과 같습니다:
{"failed":"FAILED"}
application/json으로 보내는 것도 시도해 보았습니다. 전체 CURL 정보는 다음과 같습니다:
$url = 'https://community.intercoin.app/u/fdhsjkgfs_dghjkl';
Headers:
0:
"Host: community.intercoin.app"
1:
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
2:
"Content-Type: application/x-www-form-urlencoded"
3:
"Content-Length: 28"
4:
"Api-Key: 3cf975095fd50e22e3631dc916c6d2c7694419ed421338dd7bba432ba1e71417"
5:
"Api-Username: system"
body:
upload_id=2159&type=uploaded
Profile - fdhsjkgfs_dghjkl - Intercoin 이 존재하는 것을 확인하실 수 있습니다.
업로드 ID도 실제로 존재하며, 업로드를 수행한 후 다음을 얻습니다:
{
"id": 2159,
"url": "https://community.intercoin.app/uploads/intercoin/original/2X/c/ce6121fe1571faa6c41ad28afdf6c30939ffbc56.png",
"original_filename": "400.png",
"filesize": 20636,
"width": 360,
"height": 360,
"thumbnail_width": 360,
"thumbnail_height": 360,
"extension": "png",
"short_url": "upload://trIsPeqspDPRwbMsOnjtDCBBMwK.png",
"short_path": "/uploads/short-url/trIsPeqspDPRwbMsOnjtDCBBMwK.png",
"retain_hours": null,
"human_filesize": "20.2 KB"
}
문제가 무엇일까요? 문서에 설명된 대로 따랐는데…
