Courseiva
Platform Features and IntegrationhardMultiple ChoiceObjective-mapped

SNOW-CAD Platform Features and Integration Practice 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;
    }
});

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?

⚠ Common exam trap

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.

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.

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.

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.

About these practice questions

Courseiva writes every SNOW-CAD question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.