Upload an image via web services into a field of type image not attachment

joseeduardo
Giga Expert

Hi I would like to upload an image straight to an image field via web services! I've already experienced with rest services an attachments now I would like to instead upload it to a field "image" so I can see a picture for each incident!, or is there any other way to show the attachments withouth downloading them?

I already did some tests though I recieve 201 in REST it doesnt want to show the image in the form! that is what I am looking forward to do.

Thank you very much!

1 ACCEPTED SOLUTION

Rushit Patel2
Tera Guru

Hi,



this blog will be helpful.Post a picture to an image field through REST-John Andersen



it posts into image field of user table. simillary u can do for incident table.



i hope this helps.


View solution in original post

3 REPLIES 3

Rushit Patel2
Tera Guru

Hi,



this blog will be helpful.Post a picture to an image field through REST-John Andersen



it posts into image field of user table. simillary u can do for incident table.



i hope this helps.


Thank you very very very very much!!! that worked just excellent! I made the call via Json! but it still worked soo well! and the best it was just changing a name in the code I already had! thank you again Rushit Patel!


Hunter Phillips
Giga Contributor

For anyone who wasn't able to resolve this using the linked blog post -- you can alternatively use the Attachment API to POST a new attachment record, and store that attachment record sys_id as the image field value on the target record

You can see this by viewing the value of an image field on a record. The image field value is just a sys_id of an attachment. 

The catch here is you need to use the now/attachment/upload endpoint
POST /now/attachment/upload