REST Flashcards

1
Q

Which of the following describes an outbound REST integration in ServiceNow? More than one response may be correct.
A. A REST call from ServiceNow to a web service to get updated stock prices for company records.
B. A REST call from ServiceNow to a ServiceNow instance to get user details.
C. A REST call from ServiceNow to a language translation web service to translate a knowledge article.
D. A REST call from ServiceNow to a vendor to get updated product information.
E. A REST call from ServiceNow to a weather API to get updated weather information at a customer site.

A

A. A REST call from ServiceNow to a web service to get updated stock prices for company records.
B. A REST call from ServiceNow to a ServiceNow instance to get user details.
C. A REST call from ServiceNow to a language translation web service to translate a knowledge article.
D. A REST call from ServiceNow to a vendor to get updated product information.
E. A REST call from ServiceNow to a weather API to get updated weather information at a customer site.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
Which of the following is NOT information used to configure a REST Message record?
A. HTTP Method
B. Endpoint
C. Name
D. Authentication
E. HTTP Headers
A

A. HTTP Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
Which of the following are authentication methods supported in a REST Message record? More than one response may be correct.
A. No authentication
B. Query parameters
C. Basic
D. Username and password
E. OAuth 2.0
A

A. No authentication

C. Basic

E. OAuth 2.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
Which one of the following is NOT an available HTTP method?
A. GET
B. POST
C. PUT
D. UPDATE
E. DELETE
A

D. UPDATE

PATCH is the fifth HTTP method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

View the IEX Cloud API documentation for Earnings. Which of the following are valid HTTP Method Endpoints? More than one response may be correct.
A. https://cloud.iexapis.com/stable/stock/{symbol}/earnings/{last}/{field}
B. https://cloud.iexapis.com/stable/stock/${symbol}/earnings/${last}/${field}
C. /stock/{symbol}/earnings/{last}/{field}
D. https://cloud.iexapis.com/stable/stock/${symbol}/earnings/
E. https://cloud.iexapis.com/stable/stock/NOW/earnings/${last}/

A

B. https://cloud.iexapis.com/stable/stock/${symbol}/earnings/${last}/${field}
D. https://cloud.iexapis.com/stable/stock/${symbol}/earnings/
E. https://cloud.iexapis.com/stable/stock/NOW/earnings/${last}/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True or False? Query Parameters are name/value pairs appended to the endpoint value at runtime. For example, a query parameter with the Name last and the Value 2 is appended to the earnings endpoint as https://cloud.iexapis.com/stable/stock/${symbol}/earnings?last=2

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which HTTP Log Level was used to create the HTTP Log?
The outbound HTTP log shows the method and URL used, but has no information in the Request headers or Request body fields.
A. None
B. Basic
C. Elevated
D. Debug
E. All

A

B. Basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following are ways to execute a REST message method? More than one response may be correct.
A. Click the Test related link on the HTTP Method record.
B. Click the Test button on the HTTP Method record.
C. Click the Preview Script Usage related link to copy JavaScript to call the web service in a server-side script.
D. Click the Get Code Snippet related link to copy JavaScript to call the web service in a server-side script.
E. Click the Execute Now button on the HTTP Method record.

A

A. Click the Test related link on the HTTP Method record.

C. Click the Preview Script Usage related link to copy JavaScript to call the web service in a server-side script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can a developer extract data from the response body after calling a REST web service? More than one response may be correct.
A. Click the Convert Response Body button to convert the response.
B. Use the JSON API to convert JSON formatted responses to a JavaScript object.
C. Use the XMLDocument2 API to extract data from XML formatted responses.
D. Use the XMLDocument2 Script Include to parse the XML.
E. Use the Convert Response Body wizard to translate the response into an object.

A

B. Use the JSON API to convert JSON formatted responses to a JavaScript object.
C. Use the XMLDocument2 API to extract data from XML formatted responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

True or False? REST Message records are required to interact with external REST web services.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
Which one of the following is NOT an IntegrationHub subscription level?
A. Starter
B. Basic
C. Standard
D. Professional
E. Enterprise
A

B. Basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
Which of the following features and spokes use IntegrationHub? More than one response may be correct.
A. Slack Spoke
B. Customer Service Spoke
C. PowerShell step
D. Make a decision flow logic
E. XML Parser
A

A. Slack Spoke
C. PowerShell step
E. XML Parser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False? Inline connections should only be used in REST steps for testing.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following describes ways to make a REST step dynamic? More than one response may be correct.

a. Write a script to build the endpoint.
b. Set the HTTP Method to POST and the user will be prompted for any values required by the API.
c. Use a data pill in the Resource Path for any variable information described in the external API’s documentation.
d. Use a data pill in the Query Parameter value for any query parameters described in the external API’s documentation.

A

c. Use a data pill in the Resource Path for any variable information described in the external API’s documentation.
d. Use a data pill in the Query Parameter value for any query parameters described in the external API’s documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following describes how to test a REST step? More than one response may be correct.

a. Click the Test button on an action, supply input values, and click the Run Test button.
b. Publish the action and meet the conditions of the action’s trigger.
c. Add the action to a flow that is configured to Show draft actions and click the Test button on the flow.
d. Publish the action and add the action to a flow to test.
e. Click the Test button for the step, supply input values, and click the Run Test button.

A

a. Click the Test button on an action, supply input values, and click the Run Test button.
c. Add the action to a flow that is configured to Show draft actions and click the Test button on the flow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following describes how to parse the response body from a REST API call? More than one response may be correct.
A. Use the XML Parser step to extract data from the response body.
B. Use the JSON Parser step to extract data from the response body.
C. Use the Parse Response option in the REST step to write the results of the response to output variables.
D. Create a script step that parses the response body and writes the results to output variables.
E. Use the OpenAPI Specification to generate output variables from the response body.

A

A. Use the XML Parser step to extract data from the response body.
D. Create a script step that parses the response body and writes the results to output variables.

17
Q

Which of the following are benefits of using Connection & Credential Aliases? More than one response may be correct.
A. Connection details can be configured in the REST Message record separately from the action.
B. Connection details are separated from a flow, so the flow does not need to be updated if the connection changes.
C. Connection details are separated from an action, so the action does not need to be updated if the connection changes.
D. Multiple connections can be associated with a Connection & Credential Alias to make switching connections easy.
E. Multiple actions can point to a single configuration.

A

C. Connection details are separated from an action, so the action does not need to be updated if the connection changes.
D. Multiple connections can be associated with a Connection & Credential Alias to make switching connections easy.
E. Multiple actions can point to a single configuration.

18
Q

Which one of the following describes how to select the Credential record to use for a REST step?
A. Select the Credential on the REST step.
B. Select the Credential on the Connection & Credential Alias.
C. The REST step tries every available Credential until one works.
D. Select the Credential on the Connection record.

A

D. Select the Credential on the Connection record.

19
Q
Which of the following is NOT a type of credential used by REST APIs? More than one response may be correct.
A. API Key
B, Basic Auth
C. CIM
D. OAuth 2.0
E. JDBC
A

C. CIM

E. JDBC

20
Q

True or False? In an inbound REST integration, ServiceNow is the web service provider.

A

True

21
Q
Which of the following is the application in ServiceNow used to construct and test API requests to a ServiceNow instance?
A. REST API Provider
B. REST API Explorer
C. REST Message Explorer
D. REST Request Builder
E. REST Request Explorer
A

B. REST API Explorer

22
Q
Which one of the following is NOT selected to determine what fields are available in the Prepare request section of the REST API Explorer?
A. Path parameters
B. Method
C. API Name
D. Namespace
E. API Version
A

A. Path parameters

23
Q

The highlighted items are examples of which type of values?
The image shows a URL from the Table API with a PUT method that accesses /api/now/table/{tableName}/{sys_id} with {tableName}/{sys_id} highlighted.
A. Request parameters
B. Request headers
C. Query parameters
D. Path parameters
E. Response headers

A

D. Path parameters

24
Q

True or False? All query parameters accept encoded queries as values.

A

False

25
Q

Which one of the following describes the process to test the configured web service call to a ServiceNow instance?
A. Click the Send button and view the results.
B. Click the Test button and view the results.
C. Click the Execute Now button and view the results.
D. Click the Run Test button and view the results.
E. Click the Test button, configure the input values, click the Run Test button, and view the results.

A

A. Click the Send button and view the results.

26
Q
Which HTTP Status Code typically means success?
A. 1xx
B. 2xx
C. 3xx
D. 4xx
E. 5xx
A

B. 2xx

27
Q
Which of the following are options for how the response is formatted? More than one response may be correct.
A. application/json
B. text/json
C. application/xml
D. text/xml
E. text/csv
A

A. application/json
C. application/xml
D. text/xml

28
Q

Which of the following are strategies specific to adding security to inbound REST requests? More than one response may be correct.
A. Use a really complex password.
B. Create a user specifically for inbound requests.
C. Disallow web service access to tables.
D. Create CORS rules.
E. Configure Access Controls to deny access.

A

B. Create a user specifically for inbound requests.
C. Disallow web service access to tables.
D. Create CORS rules.

29
Q
REST API Explorer creates code samples for which of the following languages? More than one response may be correct.
A. cURL
B. Perl
C. Python
D. JavaScript
E. PowerShell
A
A. cURL
B. Perl
C. Python
D. JavaScript
E. PowerShell
30
Q

True or False? Scripted REST APIs can be created in Studio.

A

True

31
Q

Which of the following describes what is configured in the Content Negotiation section? More than one response may be correct.
A. The available authentication methods.
B. The supported request formats.
C. The records available to the API.
D. The supported response formats.
E. The contract between the web service provider and consumer.

A

B. The supported request formats.

D. The supported response formats.

32
Q

True or False? Documentation for a Scripted REST API needs to be created as a UI Page.

A

False

33
Q
Creating a Scripted REST Resource creates which of the following? More than one response may be correct.
A. Response body
B. Request headers
C. REST Method
D. Path parameters
E. Query parameters
A

C. REST Method

D. Path parameters

34
Q
Which of the following APIs allow developers to access data from the request?
A. RESTAPIRequestBody
B. RESTAPIRequestV2
C. RESTRequest
D. RESTRequestV2
E. RESTAPIRequest
A

E. RESTAPIRequest

35
Q
Which of the following methods creates the response body in the resource script?
A. setBody()
B. setContent()
C. setBodyContent()
D. getBody()
E. getContent()
A

A. setBody()

36
Q

True or False? Scripted REST APIs allow developers to create custom error codes.

A

True

37
Q

Which of the following describes how to start versioning an API?
A. Click the Enable versioning button.
B. Click the Copy button on the Scripted REST API record and increment the Version field.
C. Select the Enable versioning configuration option on the Scripted REST API record.
D. Click the Enable versioning related link.
E. Click the Add new version related link.

A

E. Click the Add new version related link.

38
Q

Which of the following describe ways to open the Usage by Web API dashboard? More than one response may be correct.
A. Open REST > Dashboards and search for Usage by Web API.
B. Click the API analytics related link on the API record.
C. Open Performance Analytics > Dashboards and search for Usage by Web API.
D. Click the API analytics button on the resource record.
E. Open REST > API Analytics.

A

B. Click the API analytics related link on the API record.

C. Open Performance Analytics > Dashboards and search for Usage by Web API.