URL paths

For a request to be received and handled correctly by the external system, the adapter must send it to the right path. The path is the portion of the URL after the host and port and before the ?. For example, in http://myservicenow.com/api/rest/v1/changes?name=CHG, the path is /api/rest/v1/changes. If the adapter sends /api/v2/change instead, the call will typically result in a 404 error or be ignored by the external system.

How the path is constructed

The adapter assembles the full path from three sources:

  • base_path — the common prefix shared by most or all calls to the system (for example, /api/rest). Defined in the service instance configuration.
  • version — the API version segment (for example, v1). Defined in the service instance configuration. Do not include leading or trailing slashes — the value should be just the version string. If no version applies, leave this as an empty string.
  • entitypath — the remainder of the path for a specific call. Defined in action.json within the endpoint configuration at /adapter-home-dir/entities/<entity-name>/action.json.

Example entitypath:

1"entitypath": "{base_path}/{version}/device_management/v1/device/{pathv1}/action/{pathv2}?{query}"

Placeholders in {...} are replaced by the adapter library before the call is made. Do not modify {base_path}, {version}, or {pathv#}. Path variables like {pathv1} and {pathv2} carry dynamic, per-call values.

Verify the path

base_path — confirm it contains only the common prefix for all calls. It must not include the protocol, host, or port, and should not include the version. An incorrect base_path causes every call to fail.

version — confirm the version string matches what the external system expects. No slashes should appear before or after it.

entitypath — if calls are failing after base_path and version are confirmed correct, the entitypath in action.json may be outdated (for example, after an API version upgrade on the external system). Update it directly in the relevant action.json file.