View API
Go Up to API Reference
This part of the Team Server API allows you to work with views.
Contents
GET v1/views
Obtains a list of views.
If successful, the response from the server provides a list of views with details about each one of them.
GET v1/models/<model id>/views
Obtains a list of views of the model with the specified ID.
If successful, the response from the server provides a list of views with details about each one of them.
GET v1/views/<id>
Obtains information about the view with the specified ID.
View Fields
View resources in View API requests and responses can include any combination of the following fields:
Item | Example | Description |
---|---|---|
|
|
An integer that uniquely identifies the view. |
|
|
The name of the view. |
|
|
A description of the view. |
|
|
Some notes about the view. |
|
|
The schema of the model that contains the view. |
|
|
The project of the view. |
|
|
The platform of the view. |
|
|
Path relative to the Team Server root API URL that points to the entry of the view resource. For example, if the Team Server root API URL is http://teamserver.example.com/api , the example value here determines that you can access the view resource at http://teamserver.example.com/api/v1/views/6668 . |
|
|
Path relative to the Team Server root URL that points to the page of the view. For example, if the Team Server root URL is http://teamserver.example.com , the example value here determines that you can access the page of the view at http://teamserver.example.com/object/view.spg?key=6668 . |
|
|
The date when the view was created, in Unix time (seconds since 1970). |
|
|
The ID of the diagram containing the view. See |
|
|
The name of the diagram containing the view. See |
|
|
API path of the diagram containing the view. See |
|
|
Relative URL of the diagram containing the view. See |
|
|
The ID of the model containing the view. See |
|
|
The name of the model containing the view. See |
|
|
API path of the model containing the view. See |
|
|
Relative URL of the model containing the view. See |
|
|
A list of columns of the view. Each entry provides the following fields:
See the View Column API for more information. |
|
|
A list of attachments of the view. Each entry provides the following fields:
See the Attachment API for more information. |
|
|
A list of security properties of the view. Each entry provides the following fields:
See the Security Property API for more information. |
|
|
A list of models that are children of the view. Each entry provides the following fields:
See the Model API for more information. |
|
|
The type of the resource. Its value is always "View" for view resources. |
|
|
Set to "True" if the relationship is set to Logical Only. |
|
|
Set to "True" if the relationship is set to Physical Only. |
Example Response
This is an example response from a GET v1/views call:
{
"views": [
{
"diagramURL": "/v1/diagrams/6111",
"platform": "Logical",
"securityproperties": [],
"model": "Logical",
"link": "/object/view.spg?key=6668",
"columns": [
{
"expression": "",
"id": 6775,
"alias": "",
"sequence": "10",
"name": "Discontinued"
},
// …
],
"type": "View",
"url": "/v1/views/6668",
"id": 6668,
"schema": "",
"modelId": 6112,
"project": "Projects",
"modelURL": "/v1/models/6112",
"description": "",
"createdAt": 1369929045,
"submodels": [
{
"id": "6898",
"description": "",
"link": "/object/view.spg?key=6898",
"name": "Main Model",
"image": "/getDiagImage.spg?image=e2e6f0cf22cc4c60aeec5dd92820ff9e"
},
// …
],
"diagramLink": "/object/view.spg?key=6111",
"name": "Alphabetical list of products",
"modelLink": "/object/view.spg?key=6112",
"attachments": [
{
"id": "7137",
"link": "/object/view.spg?key=7137",
"name": "Team Member List",
"value": "ALL",
"dictionary": "Northwind_DD",
"datatype": "Text List",
"type": "General Attachments"
},
// …
],
"diagram": "Northwind Sample",
"notes": "",
"diagramId": 6111
},
// …
],
"metadata_": {
"limit": 25,
"totalCount": 71,
"offset": 0
}
}
This is from a GET v1/views/<id> call:
{
"view": {
"diagramURL": "/v1/diagrams/6111",
"platform": "Logical",
"securityproperties": [],
"model": "Logical",
"link": "/object/view.spg?key=6668",
"columns": [
{
"expression": "",
"id": 6781,
"alias": "",
"sequence": "4",
"name": "CategoryID"
},
// …
],
"type": "View",
"url": "/v1/views/6668",
"id": 6668,
"schema": "",
"modelId": 6112,
"project": "Projects",
"modelURL": "/v1/models/6112",
"description": "",
"createdAt": 1369929045,
"submodels": [
{
"id": "6898",
"description": "",
"link": "/object/view.spg?key=6898",
"name": "Main Model",
"image": "/getDiagImage.spg?image=e2e6f0cf22cc4c60aeec5dd92820ff9e"
},
// …
],
"diagramLink": "/object/view.spg?key=6111",
"name": "Alphabetical list of products",
"modelLink": "/object/view.spg?key=6112",
"attachments": [
{
"id": "7137",
"link": "/object/view.spg?key=7137",
"name": "Team Member List",
"value": "ALL",
"dictionary": "Northwind_DD",
"datatype": "Text List",
"type": "General Attachments"
},
// …
],
"diagram": "Northwind Sample",
"notes": "",
"diagramId": 6111
}
}