rest api for fetching cat_item images
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 12:28 AM
I am trying to get images of the item using the rest api /api/sn_sc/servicecatalog/items?sysparm_text=laptop
the image field is missing in the response.
when I try the rest api api/sn_sc/servicecatalog/items/8b6abec14f86c68085b73485f110c7fa it does not give the field.
even I tried on api/now/table/sc_cat_item/8b6abec14f86c68085b73485f110c7fa
the field is present here but comes blank..
but when I try on the UI I see an image...
what api will help fetch me the image?
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2016 04:12 AM
The picture is not stored on the sc_cat_item table.
In the screenshot you can see an image in the Picture field of this Catalog Item.
But if you look at the XML of the record there is no value in that field.
Images are stored on the sys_attachment table.
For Image type fields, the table name is prefixed with 'ZZ_YY' (don't ask me why). Eg, ZZ_YYsc_cat_item. It's how they are differentiated from normal attachments.
You can get the image from here by searching for the sys_id of the Catalog Item in the table_sys_id field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2016 09:14 PM
Thanks Geoffrey. I am using Helsinki version. when I send the request api/now/table/sys_attachment/8b6abec14f86c68085b73485f110c7fa
or
api/now/table/ZZ_YYsc_cat_item/8b6abec14f86c68085b73485f110c7fa
it gives invalid table ZZ_YYsc_cat_item.
I am not able to figure out from the table explorer which alternate table contains the images.
not sure if I am missing something. can you suggest?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2016 09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2016 12:23 AM
if I give the item sys_id in this field I get a 404 error. whereas the image is displayed on the item record.
If I give the attachment/image sys_id ( i tried for the icon one) it gives me the 200 response.
the question is how to get the image sys_id from the sc_cat_item... there is no table ZZ_YYsc_cat_item nor sys_attachment table in the helsinki version.