@servicenow/sdk - v4.4.1
    Preparing search index...

    Type Alias RestApi<I, V>

    RestApi: Now.Internal.WithID<
        {
            active?: boolean;
            consumes?: string;
            name: string;
            policy?: ""
            | "read"
            | "protected";
            produces?: string;
        } & restEnforceAcl & restShortDescription & restServiceId & restDocLink & Now.Internal.Meta,
    > & (
        | {
            routes?: (Routes & { version: V["version"] })[];
            versions: Version<I>[];
        }
        | { routes?: Routes[]; versions?: never }
    )

    Creates endpoints, query parameters, and headers for a scripted REST service (sys_ws_definition).

    Type Parameters

    • I extends number
    • V extends Version<I>

    Type Declaration

    • { routes?: (Routes & { version: V["version"] })[]; versions: Version<I>[] }
      • Optionalroutes?: (Routes & { version: V["version"] })[]

        The resources (sys_ws_operation) for the API

      • versions: Version<I>[]

        A list of versions (sys_ws_version) for the API

    • { routes?: Routes[]; versions?: never }
      • Optionalroutes?: Routes[]

        The resources (sys_ws_operation) for the API

      • Optionalversions?: never

        A list of versions (sys_ws_version) for the API

    an object containing the following properties:

    • $id - unique id for the record, typically using Now.ID["value"]
    • name - the name of the API, which is used in the API documentation
    • serviceId - the API identifier used to distinguish this API in URI paths. It must be unique within the API namespace
    • active? - indicates whether the API can serve requests
    • consumes? - a list of media types that resources of the API can consume
    • docLink? - a URL that links to static documentation about the API
    • enforceAcl? - a list of variable identifiers of ACL objects or sys_ids of ACLs to enforce when accessing resources (sys_security_acl)
    • policy? - the policy for how application files are protected when downloaded or installed
    • produces? - a list of media types that resources of the API can produce
    • routes? - the resources (sys_ws_operation) for the API
    • shortDescription? - a brief description of the API, which is used in the API documentation
    • versions? - a list of versions (sys_ws_version) for the API