Created attachment is not getting saved to sys_attachement table .(Issue with create & Retrive attachment)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2020 01:36 AM
HI ,
I have created a attachment & tried to retrieve it by passing id it returns 404 .Adding details below
CASE I
Create Attachment
POST : https://dev87746.service-now.com/api/now/table/ecc_queue?&sysparm_exclude_reference_link=true
Request Body : { source: 'alm_asset:1cab288d3790200044e0bfc8bcbe5d43',
name: 'dev87746.txt',
agent: 'AttachmentCreator',
topic: 'AttachmentCreator',
payload: 'dev87746 service instnace in use' }
Response : Received response 401 from POST call to https://dev87746.service-now.com/api/now/table/ecc_queue?&sysparm_exclude_reference_link=true
It says 401 & still returns response : {"file_name":"dev87746.txt","sys_id":"74c34891db51101065a42946489619a8","FileContent":"dev87746 service instnace in use","AttachmentOwnerType":"alm_asset","AttachmentOwnerId":"00aa7c9edb401010aad88809489619aa"}
Retrive :
Now when i tried to get the attachement by :https://dev87746.service-now.com/api/now/table/sys_attachment/74c34891db51101065a42946489619a8?sysparm_exclude_reference_link=true
it returns 404 .
Retrive Response : {
"error": {
"detail": "Record doesn't exist or ACL restricts the record retrieval",
"message": "No Record found"
},
"status": "failure"
}
CASE II
POST : https://dev87746.service-now.com/api/now/table/ecc_queue?&sysparm_exclude_reference_link=true
This Api returns 201 me sometimes .
RequestBody : { source: 'alm_asset:1cab288d3790200044e0bfc8bcbe5d43',
name: 'dev87746.txt',
agent: 'AttachmentCreator',
topic: 'AttachmentCreator',
payload: 'dev87746 service instnace in use' }
Response: Successful response 201 from POST call to https://dev87746.service-now.com/api/now/table/ecc_queue?&sysparm_exclude_reference_link=true
Response received: {"file_name":"dev87746.txt","sys_id":"6a0a88d9db51101065a42946489619fc","FileContent":"dev87746 service instnace in use","AttachmentOwnerType":"alm_asset","AttachmentOwnerId":"00aa7c9edb401010aad88809489619aa"}
Retrive : https://dev87746.service-now.com/api/now/table/sys_attachment/6a0a88d9db51101065a42946489619fc?sysparm_exclude_reference_link=true
Retrive response : 404
{
"error": {
"detail": "Record doesn't exist or ACL restricts the record retrieval",
"message": "No Record found"
},
"status": "failure"
}
Note : The user role is set to Admin .
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2020 12:40 AM
Is there any update on this? Is this question resolved or you need some more assistance?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader