ServiceNow Scripted REST APIs: Part 13 – Table settings
foreign welcome back everyone to part 13 in this series I'm creating scripted rest apis in servicenow in previous videos we looked at creating an API and creating the resources in that API but now it's time to discuss security there are many different ways to secure your API as well as the underlying tables in your API and we're going to look and demonstrate the main methods for doing that in the next videos and I strongly recommend that you watch all of them we're going to start by looking at the table settings if we look at our table configuration here there's this setting that says allow access to this table via web services so if we check the documentation here for creating a table it states here that select the checkbox to enable users to make inbound web services web service queries to this table so in other words if that checkbox is ticked then we allow or permit API queries to this table but in my testing it seems that this only applies to the table API I'm not sure about other servicenow apis that come out of the box but at the very minimum to the table API from servicenow so if we come to postman here I'm going to send our get vehicle request our scripted rest API okay we've tested this before and if I go ahead and send this request we get the response back with the vehicle details okay that's what we expect if we have to do the same thing in the table API and send that request that should work as well except in this case we're getting all fields from that record back okay so both requests work now if we come back to our table and disable this setting let's try it again in my table API we'll send this request now that doesn't work and that's what we expect because we've now disabled API requests to that table okay we're not permitting that however if I come back to my scripted rest API my resource here okay that we tested before and send that one again it works it continues to work okay so it's not explicitly stated in the documentation but it seems as though this setting only applies to the table API and maybe to some other servicenow apis out of the box I'm not sure I haven't done the testing but for your scripted apis that enabling that setting is not necessary so now that we know that let's start talking access controls as a way for securing not only our API but also our table and we'll do that in the next two videos foreign
https://www.youtube.com/watch?v=zx8Kl4nnVrQ