Skip to content

Shortest chain of links between two sets of notes (each `{"paths": [...]}` and/or

POST
/datanotes/operations/graph_path/
curl --request POST \
--url https://example.com/datanotes/operations/graph_path/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "from_nodes": {}, "to_nodes": {}, "direction": null, "edges": null, "max_depth": null }'

Shortest chain of links between two sets of notes (each {"paths": [...]} and/or {"table", "where"}): found, length and path: the steps (from, label, direction, to). direction both by default; max_depth default 6 (max 10).

Media typeapplication/json
object
from_nodes
required
object
key
additional properties
any
to_nodes
required
object
key
additional properties
any
direction
Any of:
string
Allowed values: out in both
edges
Any of:
Array<string>
max_depth
Any of:
integer

Done.

Media typeapplication/json
object
found
required
boolean
length
required

Links on the path; null when none was found.

integer | null
via
required

The links, in order (empty when not found or from = to).

Array<object>
GraphStep

One link followed.

object
from
required

Note path the step starts at.

string
label
required

Edge label: the link column, or link for other links.

string
direction
required

Out: from links to to; in: to links to from.

string
Allowed values: out in
to
required

Note path reached.

string
from

Start note of the path (found only).

string
to

End note (found only).

string

Example

{
"via": [
{
"direction": "out"
}
]
}

Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unknown table, view, migration, note or folder.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Ambiguous table name: it matches several tables (paths or tables lists them).

Media typeapplication/json
object
error
required
string
paths

The tables’ folders the name matches.

Array<string>
tables

The qualified tables the name matches.

Array<string>

Example generated

{
"error": "example",
"paths": [
"example"
],
"tables": [
"example"
]
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}