Get an external dependency snapshot
const url = 'https://api.modeldesk.io/dependency-snapshots?location=https%3A%2F%2Fexample.com&focus=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.modeldesk.io/dependency-snapshots?location=https%3A%2F%2Fexample.com&focus=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --header 'Authorization: Bearer <token>'Get the cached snapshot of an external, URI-addressed dependency. A location can hold one cached snapshot per vocabulary it has been parsed into, so focus is required: the caller is authorized for the focus model, the location must be in that model’s own dependency set, and the row served is the one the focus model’s resolved metamodel can read, the same selection the full model read makes. With ref, both the dependency set and the resolved metamodel are the ones the focus model holds at that ref. A location the focus holds no dependency of, because only one of its dependencies imports it, is served through the dependency edge that dependency’s snapshot declares, the one metamodel names, and the row is the one the full model read attaches for that edge. A location or focus that resolves to nothing is answered 404. The ETag is the cached row’s id rather than a content hash, and If-None-Match is answered 304 when it matches the selected row.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The dependency’s location, as recorded on the dependency element.
The model whose dependency set names the location and whose resolved metamodel selects the snapshot to serve.
A ref of the focus model, a model_branch document id, whose dependency set must name the location and whose pins resolve the metamodel that selects the snapshot. Read as GET /models/{focus}?ref= reads it: a draft is its owner’s alone. When omitted, the focus model’s main branch is read.
For a location the focus holds no dependency of: the metamodel the importing dependency edge’s document was read through, the one the edge declares or, when it declares none, the one its importer declares, as the transitive copy of the edge would state it. Omitted, an edge read through neither is asked for. Ignored when the focus holds a dependency of the location itself, though a value that is not a UUID is still a 400.
Responses
Section titled “Responses”OK
The self-contained state of a dependency at a pin: every element of the pinned model, keyed by element id, with no metamodel, index or nested dependency content.
object
The pinned commit. Absent for an external dependency, which has no commit.
object
The root element’s revision, when the snapshot records one.
object
object
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
The values the element holds that its type declares no property for; absent when none.
A value an element holds under no binding its type declares, kept so a round trip loses nothing.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
A structure the import holds without an element, kept with its own properties inside the layer of the element that refers to it. A node is held once; any other place that refers to it holds a reference to it instead.
object
The property that links the holding element or the enclosing node to this node; absent on a node no property links to.
The node’s global identity in the format’s own terms; absent on an anonymous node.
A label unique within the model, set only on an anonymous node that is referred to more than once.
Whether this entry only points at the node another entry holds under the same localId.
Whether the node is an ordered list, whose entries are its members in order.
Where an element was derived from: the source and rules models, and per property the source values it read.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
Example
{ "elements": { "additionalProperty": { "extensionLayer": [ { "kind": "attribute" } ], "lineage": { "properties": [ { "propertyType": "ATTRIBUTE", "sources": [ { "propertyType": "ATTRIBUTE", "role": "PRIMARY" } ] } ] } } }}Not modified
Bad request
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}Not found, answered with the same plain problem, in the same words, for a focus the caller may not read, a location neither the focus nor any of its dependency snapshots declares (through metamodel, when the focus holds no dependency of it), and a location with no snapshot its metamodel can read. The one exception is ref: on a focus the caller may read, a ref that is not there for them (an unknown id or another user’s draft alike) is answered as RefNotFoundProblem. That reveals only that the caller may read the focus, which GET /models/{modelId} already tells them, and nothing about the location; a focus they may not read keeps the plain problem whatever ref was named.
A Problem answered when a ref the request reads at is not there for the caller, on a resource they may read: a ref id that names nothing, a ref of another resource, and another user’s draft, which reads exactly as a ref that does not exist. The draft routes answer it too when the caller holds no draft.
A 404, as a missing resource is, and told apart from one by its type. A resource the caller cannot read keeps the plain answer it always had, whatever ref was named, so this one never says anything about a resource the caller could not see. To a client it means that the ref it was reading, typically a draft committed or discarded in another session, is gone while the resource stays: it goes back to the branch. The problem names no ref, so the answer for an id that names nothing and for another user’s draft is the same, byte for byte.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Stable constant a client branches on, which is what tells this 404 from a resource that is missing or not the caller’s to read.
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example
{ "type": "https://modeldesk.io/problems/ref-not-found"}default
Section titled “default”Error
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}