Model API Structure
The Model API is organized hierarchically around programs and their contained modules. This structure allows for clear access to program-level data and detailed information within each module.
Program Endpoints
These endpoints provide access to top-level program information and elements.
1. List All Programs
GET /model
Retrieves a list of all programs defined within the project. Each entry in the response will be a reference object to a program element, including relevant links for further navigation.
Response Structure (Example):
{
"data": [
{
"id": "elements::JeeApplication::bookApp::1.0.0",
"label": "bookApp::1.0.0",
"type": "expansionControl::Program",
"format": "reference",
"properties": {
"programElement": {
/* Reference to program */
}
},
"links": {
"self": "/model/{program_type}/{program_key}",
"elementTypes": "/model/{program_type}/{program_key}/types",
"modules": "/model/{program_type}/{program_key}/modules"
}
}
]
}
2. Retrieve Program Details
GET /model/{program_type}/{program_key}
Fetches a detailed data object for a specific program.
Path Parameters:
program_type
: The type of the program (e.g.,elements/JeeApplication
).program_key
: The unique identifier for the program.
Response Structure (Example):
{
"data": {
"id": "elements::JeeApplication::bookApp::1.0.0",
"label": "bookApp::1.0.0",
"type": "expansionControl::Program",
"format": "reference",
"properties": {
"programElement": { /* Element representing this program (e.g. Application) */ },
"type": { /* Program type (e.g. elements::JeeApplication) */ },
"modules": [ /* List of modules contained within this program */ ]
},
"links": {
"self": "/model/{program_type}/{program_key}",
"elementTypes": "/model/{program_type}/{program_key}/types"
}
}
}
3. List Element Types in a Program
GET /model/{program_type}/{program_key}/types
Returns a list of all distinct element types directly used within the specified program element (excluding types found within its modules). This is useful for pre-loading necessary type definitions.
4. Retrieve Elements of a Specific Type in a Program
GET /model/{program_type}/{program_key}/{element_type}
Retrieves all instances of a specified element_type
that are directly part of the program element.
Path Parameters:
program_type
: The type of the program.program_key
: The unique identifier for the program.element_type
: The specific element type to retrieve instances of. This parameter must be URL-encoded.
Module Endpoints
These endpoints provide access to modules within a program and their contained elements. All module endpoints are relative to a specific program's URL.
1. List Modules within a Program
GET /{program_url}/modules
Retrieves a list of references to all modules included in the specified program.
Path Parameters:
program_url
: The full URL to the program (e.g.,/model/{program_type}/{program_key}
).
Response Structure (Example):
{
"data": [
{
"id": "elements::JeeComponent::utils",
"label": "utils",
"type": "expansionControl::Module",
"format": "reference",
"properties": {
"moduleElement": { /* Reference to the module element */ }
},
"meta": {
"module.model.modelResource": "true" // If this is `true`, the module is imported.
},
"links": {
"self": { "href": "/{program_url}/modules/{module_type}/{module_key}" }
}
},
// ... more modules
]
}
2. Retrieve Module Details
GET /{program_url}/modules/{module_type}/{module_key}
Fetches a detailed data object for a specific module within a program.
Path Parameters:
program_url
: The full URL to the parent program.module_type
: The type of the module (e.g.,Component
).module_key
: The unique identifier for the module.
3. List Element Types in a Module
GET /{program_url}/modules/{module_type}/{module_key}/types
Returns a list of all distinct element types directly used within the specified module element. This is useful for preloading necessary type definitions for the module.
4. Retrieve Elements of a Specific Type in a Module
GET /{program_url}/modules/{module_type}/{module_key}/{element_type}
Retrieves all instances of a specified element_type
that are directly part of the module element.
Path Parameters:
program_url
: The full URL to the parent program.module_type
: The type of the module.module_key
: The unique identifier for the module.element_type
: The specific element type to retrieve instances of. This parameter must be URL-encoded.