Avatar upload is accomplished by posting avatar data. Unlike other POST requests, the avatar upload must be formatted (and set the content type to) "multipart/form-data". There are two post parameters that are required. The first is 'data' which contains JSON formatted information about the photo including 'when' and 'caption' (see below). The second is 'filedata' which contains the avatar data itself.
| Method | Description |
|---|---|
| /me/avatar | upload an avatar |
A successful avatar upload returns the ID of the newly created media.
For information on the format of the actual photo data, see the url below or any of the various information sources on the web:
http://www.faqs.org/rfcs/rfc1867.html
POST http://api.hipgeo.com/me/avatar?access_token=TOKENVALUE
data:
{
"when":"2011-02-07 18:21:29",
"caption":"Avatar"
}
&filedata=MULTIPART-FILE-DATA
Returns:
{
"id":"m_8083",
"user":{
"id":"u_219",
"name":"Jonathan",
"shareable":1,
"pingable":1,
"fullname":"Jonathan Smith",
"avatar":{
"id":"m_8083",
"shareable":0,
"privacy":0,
"type":0,
"when":"2011-11-14 19:14:11",
"icon":"\/images\/media\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_m.bin?8083",
"icon_l":"\/images\/media\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_l.bin?8083",
"icon_b":"\/images\/media\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_b.bin?8083",
"full":"\/images\/media\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_d.bin?8083",
"height":450,
"width":600,
"caption":"I am an avatar"
},
"photo":"\/images\/media\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_b.bin?8083"
},
"result":"success"
}
| Error Code | Possible Errors |
|---|---|
| 400 |
|
| 401 |
|
| 404 |
|
| 405 |
|