33 questions from the Working with External Data domain of the ServiceNow Certified Application Developer (CAD) exam, each with its answer and an explanation. Read them through as revision, then sit the full practice exam to test yourself on them under multiple-choice conditions.
Answer
The system that sends the request and uses the response is the web service consumer, for example when a REST message calls an external API. The system that exposes the service and answers the request is the provider.
Answer
The REST API Explorer lets you build and send requests to the instance's own REST APIs, such as the Table API, and generates sample code for them in formats such as cURL, JavaScript and Python. It doesn't connect to public providers, teach REST or convert SOAP functions.
Answer
The endpoint is the URI the request is sent to, which identifies the resource being read, created or changed. The format of the returned data is set with headers such as Accept, and what the provider sends back is the response.
Answer
A transform map defines which import set table field is written to which field on the target table, and can run scripts during the transform. A data source only describes where the imported data comes from.
Answer
The DynamicTranslation API translates text on demand into one or more languages through a configured translation service. The other options are not translation APIs.
Answer
Auto Map Matching Fields, a related link on the transform map, creates field maps for every import set field whose name matches a field on the target table. Mapping Assist is for mapping fields by hand, and the transform map is the record that holds the mappings.
Answer
Several fields can be marked as coalesce fields. They are combined, so an existing record is updated only when all of them match; otherwise a new record is inserted.
Answer
A scripted REST API defines custom endpoints with scripted logic, so it can combine data from several tables and handle operations more complex than simple create, read, update and delete. It isn't inherently faster than the Table API, and access to tables is limited with access controls.
Answer
REST requests are stateless, so each request has to carry its own credentials, such as basic authentication or an OAuth token, and the instance authenticates every request separately.
Answer
ServiceNow REST APIs use the standard HTTP methods GET, POST, PUT, PATCH and DELETE. COPY is not one of them.
Answer
REST messages and IntegrationHub connections can authenticate to external APIs with OAuth profiles and tokens, as well as with basic authentication, so a user name and password don't have to be sent with every call.
Answer
The REST step lets you choose how the request body is sent, such as text, binary or multipart, to match what the external service expects.
Answers
Transformer(), TransformerDefinition() and TransformerRuleList() are part of the Transformation Service plugin, which defines and runs data transformations from scripts. GlideImportSetTransformer() and GlideTransformLog() work without that plugin.
Answer
IntegrationHub lets flows call third-party systems through spokes and actions, such as the REST step, when something happens in ServiceNow. It isn't a single workflow activity or an import tool.
Answer
getContentBase64() returns an attachment's content as a Base64-encoded string, which can be placed in a REST request body to send the file to another system. Saving attachments is done with other GlideSysAttachment methods, such as write().
Answer
LDAP uses port 389 by default. Traffic on that port isn't encrypted on its own, so you should make sure the connection is protected, for example by using LDAPS on port 636.
Answer
An ECC Queue record represents one message between the instance and a MID Server or another system, and its Payload field holds the content of that message. Details such as the agent and topic are kept in other fields.
Answer
Statement c is not true: which data an LDAP integration brings in depends on how its OU definitions, filters, attributes and transform maps are configured, not only on whether OU definitions are active.
Answer
Setting up the RESTMessageV2 request doesn't send anything. The script has to call var response = request.execute(); to send the request and get a response object before it can read response.getBody().
Answer
RESTMessageV2 sends outbound REST requests from server scripts, and it can be used in both scoped applications and the global scope.
Answers
REST requests can be authenticated with basic authentication, OAuth 2.0 or mutual authentication using protocol profiles. JDBC is a way of connecting to databases, and CIM is not an authentication method.
Answers
JSON responses are converted to JavaScript objects with the JSON API, for example JSON.parse(), and data in XML responses is read with the XMLDocument2 API. There is no Convert Response Body wizard or button, and XMLDocument2 is an API rather than a script include.
Answer
A REST step uses a Connection & Credential alias, and the credential set up for that alias is the one used. That keeps credentials out of the flow itself and lets them differ between instances. The step never tries credentials one by one.
Answer
IntegrationHub is available as Starter, Standard, Professional and Enterprise subscriptions, each adding more spokes and features. Basic is not one of them.
Answers
The PowerShell step, the Slack spoke and the XML Parser step are IntegrationHub features that need an IntegrationHub subscription. Make a decision flow logic is a core Flow Designer feature, and the Customer Service spoke comes with the Customer Service Management application.
Answer
GET, POST, PUT and DELETE are standard HTTP methods for reading, creating, replacing and deleting resources. There is no UPDATE method; records are updated with PUT or PATCH.
Answer
Query parameters are added after a question mark at the end of the endpoint as name=value pairs, joined with & when there are several, so a parameter named last with the value 2 becomes ?last=2.
Answer
An inline connection stores the connection details inside the action, which is convenient while testing. For real use, a Connection & Credential alias lets each instance supply its own connection and credentials without editing the action.
Answer
No. A script can create a RESTMessageV2 object and set its endpoint, method, headers and body directly, without a REST Message record. REST Message records make the configuration reusable and easier to maintain.
Answer
A REST Message's endpoint, authentication, HTTP methods and HTTP headers define the request that is sent. The name only identifies the record, so it isn't part of configuring the request.
Answers
A REST Message can use no authentication, basic authentication or OAuth 2.0. Username and Password isn't a separate option, because user names and passwords are covered by basic authentication, and query parameters pass data rather than authenticate.
Answers
Responses can be returned as application/json, application/xml or text/xml. text/csv isn't one of the offered formats, and test/json isn't a valid media type.
Answers
Data pills can be placed in the resource path for values that change, such as an ID in the URL, and in query parameter values. Choosing POST doesn't prompt anyone for values, and building the endpoint in a script isn't how a REST step is made dynamic.