One of the unsung features in the Automated Test Framework is that you can use it to test your Scripted REST APIs. I’m a fan of having as much robotic coverage as possible, so backstopping API development with tests is a good thing. Let’s look at how to do that. I will use an example of a relatively recent API that I developed, the commenting system on this very blog. I’ll create a test that:
It is quite common when developing and troubleshooting integrations that a ServiceNow developer may need some logging around API access. This logging can be required in both directions - in outbound API access of some external service or when providing an API for an external service to integrate inward to your instance. In this blog post, we will examine strategies for outbound logging. Log Levels There are three levels of Outbound Web Service Logging: Basic, Elevated and All.
I’ll start with the good stuff. Starting with Jakarta, SNI is supported! If you need to enable it, create a system property named glide.outbound.tls_sni.enabled and set the value to true. After you set this property, it make take up to 30 seconds for the change to take effect. If you’re using a MID server, create a MID server property with the same name and restart the MID Server. If you don’t know what SNI is, don’t worry, you’re not alone.
As highlighted in my New Integration/API and Authentication Features Blog Post, Istanbul introduces two new inbound OAuth 2.0 flows: Authorization Code Grant Flow Implicit Grant Flow These flows allow you to build apps that interact with ServiceNow APIs without needing to be directly aware of an end user’s username/password. Some possible use cases include: Building a mobile (iOS or Android) app that interacts with task records in a ServiceNow instance Building a web application that interacts with ServiceNow on behalf of your users This blog post is a quick tutorial to:
If you’ve used ServiceNow for a bit then you are probably familiar with using Dot-walking to access data on related records. In case you are new to the concept here is the definition and a link to product documentation. From the product docs: Dot-walking in ServiceNow provides access to fields on related tables from a form, list, or script. If the current table contains a reference to another table, any field on the referenced table can be accessed using dot-walking.