sysparm_fields not working in attachment api

Adithya Khurana
Tera Contributor

/api/now/attachment?sysparm_fields=sys_id

sysparm_fields is not working for attachment api. 

2 ACCEPTED SOLUTIONS

Ankita19
Tera Guru
Tera Guru

Hi,

what is your expected result .can you expain .

also check this one may help you https://developer.servicenow.com/dev.do#!/reference/api/tokyo/rest/c_AttachmentAPI

 

View solution in original post

Omkar Mone
Mega Sage

Hello 

 

sysparm_fields is not an option in the Get operation of the attachment API. Please try to use something like this - 

/api/now/attachment?sysparm_query=sys_id=30a53f2c97b721106f5ab0efe153af59

 

Also, check the Rest API Explorer in ServiceNow - https://docs.servicenow.com/en-US/bundle/utah-api-reference/page/integrate/inbound-rest/concept/use-...

I hope this helps you.

 

Regards,

Omkar

View solution in original post

4 REPLIES 4

Ankita19
Tera Guru
Tera Guru

Hi,

Try to change sys_id to table_sys_id . Please try and let me know.

sys_id is also a field in response. I tried with all the possible field options but, i am not getting the expected output.

sample response : 

{
"size_bytes": "106879",
"file_name": "4.3_2_modify-label-names.png",
"sys_mod_count": "3",
"average_image_color": "#ffffff",
"image_width": "800",
"sys_updated_on": "2023-06-14 09:10:26",
"sys_tags": "",
"table_name": "sys_product_help",
"sys_id": "003a3ef24ff1120031577d2ca310c74b",
"image_height": "484",
"sys_updated_by": "admin",
"content_type": "image/png",
"sys_created_on": "2016-02-29 16:07:02",
"size_compressed": "105563",
"compressed": "true",
"state": "available",
"table_sys_id": "750129c94f12020031577d2ca310c7a4",
"chunk_size_bytes": "",
"hash": "",
"sys_created_by": "admin"
},

Ankita19
Tera Guru
Tera Guru

Hi,

what is your expected result .can you expain .

also check this one may help you https://developer.servicenow.com/dev.do#!/reference/api/tokyo/rest/c_AttachmentAPI

 

Omkar Mone
Mega Sage

Hello 

 

sysparm_fields is not an option in the Get operation of the attachment API. Please try to use something like this - 

/api/now/attachment?sysparm_query=sys_id=30a53f2c97b721106f5ab0efe153af59

 

Also, check the Rest API Explorer in ServiceNow - https://docs.servicenow.com/en-US/bundle/utah-api-reference/page/integrate/inbound-rest/concept/use-...

I hope this helps you.

 

Regards,

Omkar