SDAPI URL Syntax 2.0
The Script Debugger API uses a specialized schema for its URLs, and each URL consists of a base URL and an extended URL. The base URL is the same for all API requests; the extended URL changes depending on the resource and the operation. To access the Script Debugger API's functionality, you construct URLs as described below.
Base URL
The base URL has a different structure depending on whether you are using a production system or a development system (sandboxes). The base URL has the following structure:
https://sub_domain.demandware.net/s/-/dw/debugger/
where
sub_domain
is any valid
subdomain of the demandware.net domain (for example,
staging.store.adidas.demandware.net).
Extended URL
The base URL provides the main access point of the Script Debugger API. You extend the base URL to access specific resources. When you extend the base URL, you must conform to the following patterns. The variables shown in these patterns are described below.
The first pattern addresses multiple resources of a resource type:
base_url/version_id/resource_type
The second addresses a single resource using an identifier:
base_url/version_id/resource_type/identifier
The third addresses resource information by specifying an action:
base_url/version_id/resource_type/action
The third addresses information from a dependent resource by specifying an action:
base_url/version_id/resource_type/identifier/relationship_type/action
Version ID
The
version_id
specifies the API version. Each API
version supports a set of resource types
(
resource_type
), resource properties and actions
(
action
). A new API version can add new resource
types, add properties to existing resource types, deprecate previously
supported resource types, and introduce new semantics or behaviors without
introducing structural changes.
The
version_id
starts with the character "v"
(lowercase) followed by the actual version number, separated by an
underscore. For example:
http://example.com/dw/debugger/v1_0/resource_type/identifier
Resource type
Resource types (
resource_type
) are
fundamental to the Script Debugger API, as they are to any RESTful API.
Each resource type has a corresponding set of data: properties and actions
(
action
). An instance of a resource type is
analogous to a debugger object, such as Breakpoint
or
Script Thread
.
The Script Debugger API provides a
fixed set of system resource types for each API version. Resource types
that provide access to multiple resources are given plural names (for
example, "breakpoints"). Resource types that provide access to only one
resource are given singular names (for example, "breakpoint"). The
following example URL retrieves resources of type
breakpoints
:
http://example.com/dw/debugger/v1_0/breakpoints
Identifier
Unique
identifiers (
identifier
) enable you to request
specific resource instances. The following URL returns the thread using an
ID:
http://example.com/dw/debugger/v1_0/thread/1
The
identifier
must be URL encoded.
Action
Actions
(
action
) operate on specific resource types
(
resource_type
) and relationship types
(
relationship_type
). Actions are not generally
available across all resource types and relationship types, and they are
only available when using the HTTP method POST. Actions perform special
operationsβfor example, resume script.
The following example URL uses an action to direct the script to step into a function (this action is specific to the threads resource type):
http://example.com/dw/debugger/-/v1_0/threads/1/frame/0/into