Skip to content

Resource Resolver

The Resource Resolver lets you fetch data from any platform resource with a single string — called a PRN — instead of writing multiple API calls. It is useful anywhere you need a piece of data from another part of the platform and you just want the value, not the process of fetching it.


What is a PRN?

A Protokol Resource Name (PRN) uniquely identifies a resource and, optionally, a path inside it.

prn:<type>:<ref>:<path>
Segment Description
type The kind of resource — component or integration
ref The resource identifier — a component slug or an integration ID
path (optional) The specific field or piece of data you want

Examples

prn:component:<slug>
prn:component:<slug>:<path>
prn:integration:<integration-id>:<path>
prn:integration:<integration-id>:<path>?<param>=<value>

For the full list of paths available on a component or integration, refer to the documentation for that specific resource.


Using the Resource Resolver

Send a POST request to the resource resolver endpoint with the PRN you want to resolve.

POST /v3/resource-resolver
{
  "prn": "prn:integration:<integration-id>:<path>"
}

Response:

{
  "data": "<resolved value>"
}

The shape and type of data depends on the resource and path being resolved. Refer to the documentation for the specific resource to understand what is returned.


Formatting the Result

You can optionally pass a format field — a Go text/template string — to shape the returned value. This is useful when you want to extract a single piece of information from a richer resolved object.

{
  "prn": "prn:component:products",
  "format": "{{ .settings.currency }} / {{ .settings.vat_rate }}"
}

Response:

{
  "format": "EUR / 0.17"
}

Passing Parameters

Some paths accept additional parameters as a query string appended to the path segment of the PRN.

prn:integration:protokol-ecommerce:terms_of_service?lang=en

The resource that owns the path decides which parameters it accepts and what they do. Supported parameters are listed in the documentation for each resource.


Resource Types

component

Resolves a component belonging to the current project. The ref is the component slug.

If a path is given, the resolver navigates the component's data using dot-notation and returns only that value. If no path is given, the full component object is returned.

Available paths depend on the shape of the component. Refer to the component's own documentation for the fields it exposes.

integration

Resolves a specific piece of data exposed by an installed integration. The ref is the integration ID and the path is the name of the resource that integration has made available.

Each integration explicitly decides what it exposes and documents the paths it supports. If a path is not supported, the resolver returns an error. Refer to the documentation of the individual integration for the list of supported paths.


Errors

Situation Error
PRN is malformed invalid PRN: expected format prn:<type>:<ref>[:<path>]
Unknown resource type unknown resource type "…" in PRN
Integration not installed or path not supported Error message from the integration
Path not found inside a component path segment "…" not found in resource