avatar_upload
This endpoint is used to upload BuddyPress avatar for user profile.
Please see the Postman screenshot below. You can also use Advanced REST Client extension for Chrome to send data to test the endpoint.
You must POST the form with avatar image in file upload field var with other required and optional variables as hidden fields.
Resource URL
http://localhost/api/userplus/avatar_upload/
Method
POST
Required Parameters
- key – get API key from Settings > User Plus
- cookie
- avatar – file upload type var
Optional Parameters
- full – BuddyPress avatar width and height (default is BP_AVATAR_FULL_WIDTH or 300)
- thumb – BuddyPress avatar width and height (default is BP_AVATAR_THUMB_WIDTH or 100).
Sample Request URL
http://localhost/api/userplus/avatar_upload/
Sample Response
{
"status": "ok",
"full": "https://www.domain.com/wp-content/uploads/avatars/1/dp-bpfull.jpg",
"thumb": "https://www.domain.com/wp-content/uploads/avatars/1/dp-bpthumb.jpg"
}
Hi,
Please, can you show an example of how you complete POST avatar field (file upload type var)?
Thanks.