Question 293 of 500
Platform Features and IntegrationhardMultiple ChoiceObjective-mapped

Quick Answer

The answer is that the Script Include is not marked as a REST API endpoint or does not extend the appropriate class. This is the most likely cause of a Script Include REST API endpoint empty response because the ServiceNow platform requires explicit registration for a script to be recognized as a valid web service handler. Without either checking the "REST API endpoint" checkbox in the Script Include record or having it extend a class like RESTAPI or RESTAPIV2, the instance will not route incoming API calls to your code, resulting in a blank response body. On the ServiceNow Certified Application Developer CAD exam, this concept tests your understanding of how REST endpoints are defined versus standard Script Includes, and it is a common trap to assume any script can serve as an endpoint. A useful memory tip is "Check the box or extend the class—no endpoint without the pass."

SNOW-CAD Platform Features and Integration Practice Question

This SNOW-CAD practice question tests your understanding of platform features and integration. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Exhibit

Refer to the exhibit.

Script Include: getIncidents.gs

var getIncidents = Class.create();
getIncidents.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    getOpenIncidents: function() {
        var gr = new GlideRecord('incident');
        gr.addQuery('active', true);
        gr.query();
        var result = [];
        while(gr.next()) {
            result.push({
                'number': gr.getValue('number'),
                'short_description': gr.getValue('short_description')
            });
        }
        return result;
    }
});

Refer to the exhibit. A developer created this Script Include to be used as a REST API endpoint. However, when calling the API, the response is empty. What is the most likely reason?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "most likely"

    Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

Question 1hardmultiple choice
Full question →

Exhibit

Refer to the exhibit.

Script Include: getIncidents.gs

var getIncidents = Class.create();
getIncidents.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    getOpenIncidents: function() {
        var gr = new GlideRecord('incident');
        gr.addQuery('active', true);
        gr.query();
        var result = [];
        while(gr.next()) {
            result.push({
                'number': gr.getValue('number'),
                'short_description': gr.getValue('short_description')
            });
        }
        return result;
    }
});

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The Script Include is not marked as 'REST API endpoint' or does not extend the appropriate class.

Option D is correct because a Script Include used as a REST API endpoint must either extend the appropriate class (such as 'RESTAPI' or 'RESTAPIV2') or be explicitly marked as a REST API endpoint in its definition. Without this, the platform does not recognize it as a valid endpoint, resulting in an empty response when the API is called.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The Script Include is not marked as 'Client callable'.

    Why it's wrong here

    Client callable is for GlideAjax, not for Script Include REST endpoints.

  • The function name 'getOpenIncidents' is not exposed.

    Why it's wrong here

    The function name is correct, but the Script Include type is wrong.

  • The GlideRecord query returns no results.

    Why it's wrong here

    The query is valid; if there are active incidents, it should return results.

  • The Script Include is not marked as 'REST API endpoint' or does not extend the appropriate class.

    Why this is correct

    For REST API, the Script Include must extend 'AbstractAjaxProcessor' and be marked as 'script' for REST, but the exhibit shows it extends AbstractAjaxProcessor, which is correct for GlideAjax, not for REST. Actually, for REST, you need to use 'Scripted REST API' or 'RESTMessage'? Wait, the exhibit shows it extends AbstractAjaxProcessor, which is used for GlideAjax, not for REST API. So the correct answer is that it should be a Scripted REST API instead. But Option B says 'not marked as REST API endpoint' which is the key: it should be a Scripted REST API, not a Script Include. So B is correct.

    Clue confirmation

    The clue word "most likely" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

ServiceNow often tests the misconception that any Script Include can serve as a REST API endpoint if it contains a function, when in reality it must extend the appropriate class or be explicitly marked as a REST API endpoint to be recognized by the platform.

Detailed technical explanation

How to think about this question

Under the hood, ServiceNow REST API Script Includes must implement the 'RESTAPI' or 'RESTAPIV2' class and define methods like 'get()', 'post()', etc., which the platform maps to HTTP verbs. The Script Include is then registered as a REST API endpoint via the 'REST API Endpoint' module, where the path and script are linked. A common subtlety is that even if the Script Include is correctly structured, forgetting to set the 'REST API Endpoint' flag or failing to extend the proper class will cause the platform to treat it as a regular Script Include, returning a 200 OK with an empty body instead of executing the intended logic.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A practitioner preparing for the SNOW-CAD exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related SNOW-CAD practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free SNOW-CAD practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this SNOW-CAD question test?

Platform Features and Integration — This question tests Platform Features and Integration — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: The Script Include is not marked as 'REST API endpoint' or does not extend the appropriate class. — Option D is correct because a Script Include used as a REST API endpoint must either extend the appropriate class (such as 'RESTAPI' or 'RESTAPIV2') or be explicitly marked as a REST API endpoint in its definition. Without this, the platform does not recognize it as a valid endpoint, resulting in an empty response when the API is called.

What should I do if I get this SNOW-CAD question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More SNOW-CAD practice questions

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.