Upload User Photo Using REST API?

Austin N
Tera Contributor

Is it possible to upload a user photo/avatar icon using REST API?  I have tried uploading the photo using the Attachment API, setting the table_name to ZZ_YYsys_user and the table_sys_id to the user's sys_id value as explained in this article, but this results in a 'broken' image:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0693478

 

I have also tried updating the ecc_queue table as explained in this article:

http://www.john-james-andersen.com/blog/service-now/post-picture-image-field-rest.html

 

This appears to upload the photo, and the image shows in the photo field on the user's record, but the photo does not show in the avatar icon in the top right of the navigation bar

6 REPLIES 6

Hi Austin,

If it is sending it across and other fields are populating correctly you must have that set up correctly.  Have you turned on all logging and checked those logs for any clues?  Have you checked that the file size is the same in both systems?

The only other thing I can think of is how are you assigning the image to the record?

Sorry I can't offer any better solutions.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

zubairsadaq
Tera Contributor

check this out