Render one named view of a saved lens
const url = 'http://localhost:11044/api/v1/lenses/example/views/example';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"args":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/lenses/example/views/example \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "args": { "additionalProperty": "example" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Lens id, resolved in order: the caller’s saved lens (the slug of its name, as PUT /lenses returns it), a world or realm lens, then a saved view by name; 404 when none matches
View id, one of those POST /lenses/{id}/views lists for this lens (for example items, table or brief); 404 when no view has this id, 409 when it does not apply to this lens’s result
Query Parameters
Section titled “Query Parameters”Optional, and never needed: the call always acts as the signed-in principal. Naming the principal changes nothing; naming anyone else is refused with 403.
Request Body
Section titled “Request Body”Optional. args supplies values for the lens’s declared parameters, overlaid on their declared defaults. The opened result is cached per lens and args, so the view listing and each view render share one retrieval only when they send the same args; a required parameter left unset fails the request
Optional body for opening a saved lens — POST /lenses/{id}/run, /present, /views and /views/{view} — carrying values for its declared parameters
object
Parameter values keyed by parameter name. They override the declared defaults; a required parameter with neither a value nor a default fails the open. Empty or absent uses the defaults.
object
Example generated
{ "args": { "additionalProperty": "example" }}Responses
Section titled “Responses”No authenticated principal
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}username names someone other than the signed-in principal
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}Lens or view not found
A refusal from the lens authoring surface. Carries only the reason
object
Why the request was refused, written to be shown. Names the lens or view where the refusal is about one
Example generated
{ "error": "example"}View does not apply to this lens
A refusal from the lens authoring surface. Carries only the reason
object
Why the request was refused, written to be shown. Names the lens or view where the refusal is about one
Example generated
{ "error": "example"}
