REST Inbound 401 - 403 detail": "Failed API level ACL Validation"

davidself3
Tera Contributor

I was recently working on an integration where the client needed to be able to trigger a data source setup to pull a flat file from an sFTP. The trick though, is that they wanted to be able to trigger that from a REST message sent when that flat file is generated.

They had recently upgraded from an early version of Kingston (which is very relevant) to Madrid.

I built out a POC in my personal dev instance (Madrid) which worked flawlessly. I had a custom table setup to retrieve a REST Post. This would trigger an event, which triggered an event script action. That script action references a property that contains the name of a scheduled import, and uses the SncTriggerSynchronizer.executeNow method (which executes the configured data source.)

Everything worked great until I moved all the code over to the customers Dev instance. I put rest_service role and the CRUD role to that custom table on the sys_user NUID (non-user ID) like I've done hundreds of times before. My tests from SOAP UI kept throwing 401's and 403's... I was scratching my head. I triple checked I had web services enabled.. Checked the various REST properties.. Nothing looked abnormal. 

We were about to create a HI incident, when I decided to just skim the role table for something that might make sense...I added various roles, all failing. Then I found snc_platform_rest_api_access. I added it to the NUID, fired the message in SOAP UI, boom 201!

I know this is documented, because I went and looked it up afterwards. rest_service role is being deprecated.

https://developer.servicenow.com/app.do#!/document/content/app_store_doc_rest_integrate_kingston_c_R...    

find_real_file.png

I'm making this post, because I'm sure the old school veteran developers (myself included) in the community are going to run into this problem. My hope is they will find this post and it will get them over the hurdle.

Here's the exact response I was getting so it'll show up in the meta.

{
"error": {
"detail": "Failed API level ACL Validation",
"message": "User Not Authorized"
},
"status": "failure"
}

 

find_real_file.png

1 REPLY 1

davidmcdonald
Kilo Guru

I cannot thank you enough David, this saved me a lot of searching.

I was shouting at my ServiceNow instance, saying "this used to work, why don't you work anymore?!?", and that new role "snc_platform_rest_api_access" was the answer.

Thanks again!