User is unauthorized to write to table: Incident, when trying to upload an attachment

ArnonLa
Tera Contributor

Hi,

I'm trying to use SNOW's Rest API to upload attachments to Incidents.

curl --location --request POST 'https://[...].service-now.com/now/attachment/file?table_name=incident&table_sys_id=[...]&file_name=[...]' \
--header 'Accept: application/json' \
--header 'Authorization: Basic [...]' \
--header 'Content-Type: [...]' \
--data-binary '[...]'

When I use a user with an admin role, the attachment is uploaded successfully.
When I use a none admin user, I'm getting the next error:
403 Forbidden - User not authorized. User is unauthorized to write to table: Incident

The same none admin user can successfully create and update Incidents using the Rest API. It only fails when trying to upload an attachment.
This user can upload attachments with no issues when using SNOW application in the browser.

I've tried adding to this user a few relevant Roles like: 
incident_manager, itil, rest_service, & sn_incident_write.

I've tried creating a new Role and then a few new ACLs that require this role.
ACL with create & write operations on the Incident and sys_attachment table.
I've assigned the new roles to this user but it didn't help.

Also tried to add the roles to:
System Properties -> Security -> List of roles (comma-separated) that can create attachments.

Nothing is helping.

Any idea?

9 REPLIES 9

Nitin Panchal
Tera Guru

Hi , 

Check out this community post. 

https://community.servicenow.com/community?id=community_question&sys_id=85b1db6ddbdcdbc01dcaf3231f961912

 

Thanks,

Nitin

Hi @Nitin Panchal, Thank you for replying.

Unfortunately, I don't see any solution in the post above.
I've tried adding this user the mentioned roles: itil, rest_service and a few more.
Also, the credentials are correct since I can successfully perform other API calls with this user.


Can you please share details of the ACLs? 

I think you will need table level acl , the one without * in both tables - incident and sys_attachment.

Thanks,

Nitin

I didn't select the fields of the table if that's what you're referring to.
find_real_file.png
Same for the Incident table.
The role, reat_attachment, is the one I assigned to the user.