Updating User Avatar through the API

Updating User Avatar through the API

This question is answered

I noticed there are get, create, update, and delete methods for user avatars.

How can I tell if a user has a custom avatar set? Would I just have to check the avatar URL to see if it is the default one?

Also, if I just call update avatar will it create one if one does not already exist, or do I have to call create specifically if there is no existing avatar?

Verified Answer
  • What version of the platform are you running?

    I assume you are talking about the REST v1 API? Yes, it does support updating a user's avatar. You ought to be able to use Update whether the user currently has an avatar or not. It appears that create and update both do the same thing, but it should be tested.

    However the REST v1 API is deprecated and will be removed in a future version. Our REST v2 API does not currently support updating the user's avatar but it will by the time the REST v1 API is removed from the product. Keep that in mind while doing any custom development in regards to upgradability. You'll want to make sure to abstract the REST URLs and the code you are using to communicate with the REST v1 API so that can easily be changed to using the REST v2 API in the future.

All Replies
  • What version of the platform are you running?

    I assume you are talking about the REST v1 API? Yes, it does support updating a user's avatar. You ought to be able to use Update whether the user currently has an avatar or not. It appears that create and update both do the same thing, but it should be tested.

    However the REST v1 API is deprecated and will be removed in a future version. Our REST v2 API does not currently support updating the user's avatar but it will by the time the REST v1 API is removed from the product. Keep that in mind while doing any custom development in regards to upgradability. You'll want to make sure to abstract the REST URLs and the code you are using to communicate with the REST v1 API so that can easily be changed to using the REST v2 API in the future.

  • Hi Dan,

    Thanks for the response.

    I am a contractor here, and I am still new to the system. It looks like we are running version 5.6

    It does appear we are using v1 of the REST API, and there is an abstraction layer in place.