Attachment API returning 404 error

Anirudh Gupta
Kilo Expert

Hello community members,

Hope all are safe and doing great!

I am trying to retrieve/download an attachment using the Attachment API. This attachment is a csv file attached to a record on sc_request.

But when I try to hit it using the REST API Explorer it returns with a 404 error although the record is there is the sys_attachment table.

find_real_file.png

find_real_file.png

Any idea why this could happen ?

Although the logged in user is an admin and all the READ ACL has admin override checked. Also to be at a safer side have created an ACL which gives read access to admin role.

Any kind of help is highly appreciated.

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Anirudh,

Are you passing the sys_id of the attachment record? 

 

-Pradeep Sharma

View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Anirudh,

Are you passing the sys_id of the attachment record? 

 

-Pradeep Sharma

Hi Pradeep, Yes I was passing the sys_id of the attachment record.

Just figured out that there was a custom ACL that was blocking the REST API hit.

Referred this kb for it :  https://hi.service-now.com/kb_view.do?sysparm_article=KB0634424.

I got a similar error on my end when I passed the wrong sys_id hence assumed that could be the issue. 

Thanks for sharing the KB article number. Is your issue resolved now?

 

- Pradeep Sharma

Yes Pradeep, it is resolved now. Thanks for your continuous support.