Entity API
Go Up to API Reference
This part of the Team Server API lets you work with entities.
Contents
GET v1/entities
Obtains a list of entities.
If successful, the response from the server provides a list of entities with details about each one of them.
GET v1/models/<model id>/entities
Obtains a list of entities of the model with the specified ID.
If successful, the response from the server provides a list of entities with details about each one of them.
GET v1/entities/<id>
Obtains information about the entity with the specified ID.
Entity Fields
Entity resources in Entity API requests and responses may include any combination of the following fields:
Item | Example | Description |
---|---|---|
|
|
An integer that uniquely identifies the entity. |
|
|
The name of the entity. |
|
|
A description of the entity. |
|
|
The schema of the entity. |
|
|
Set to "True" if the relationship is set to Logical Only. |
|
|
Set to "True" if the relationship is set to Physical Only. |
|
|
Some notes about the entity. |
|
|
Path relative to the Team Server root API URL that points to the entry of the entity 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 entity resource at http://teamserver.example.com/api/v1/entities/40 . |
|
|
Path relative to the Team Server root URL that points to the page of the entity. 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 entity at http://teamserver.example.com/object/view.spg?key=40 . |
|
|
The date when the entity was created, in Unix time (seconds since 1970). |
|
|
The ID of the diagram containing the entity. See |
|
|
The name of the diagram containing the entity. See |
|
|
API path of the diagram containing the entity. See |
|
|
Relative URL of the diagram containing the entity. See |
|
|
The ID of the model containing the entity. See |
|
|
The name of the model containing the entity. See |
|
|
API path of the model containing the entity. See |
|
|
Relative URL of the model containing the entity. See |
|
|
The name of the table implementing the entity. See |
|
|
A list of attributes of the entity. Each entry provides the following fields:
See the Attribute API for more information. |
|
|
A list of attachments of the entity. Each entry provides the following fields:
See the Attachment API for more information. |
|
|
A list of security properties of the entity. Each entry provides the following fields:
See the Security Property API for more information. |
|
|
A list of models that are children of the entity. Each entry provides the following fields:
See the Model API for more information. |
|
|
A list of alerts that affect the entity. Each entry provides the following fields:
See the Alert API for more information. |
|
|
The type of the resource. Its value is always "Entity" for entity resources. |
Example Response
This is an example response from a GET v1/entities call:
{
"metadata_": {
"limit": 25,
"totalCount": 101,
"offset": 0
},
"entities": [
{
"diagramURL": "/v1/diagrams/2",
"model": "Logical",
"link": "/object/view.spg?key=40",
"type": "Entity",
"schema": "Person",
"id": 40,
"modelURL": "/v1/models/3",
"alerts": [],
"tableName": "Address",
"createdAt": 1369928964,
"description": "Street address information for customers, employees, and vendors.",
"name": "Address",
"modelLink": "/object/view.spg?key=3",
"diagramLink": "/object/view.spg?key=2",
"attachments": [],
"diagramId": 2,
"securityproperties": [
{
"id": "3804",
"link": "/object/view.spg?key=3804",
"name": "Security Impact",
"value": "Moderate",
"dictionary": "Adventure Works_DD",
"datatype": "Text List",
"type": "Data Security Classification"
},
// …
],
"url": "/v1/entities/40",
"modelId": 3,
"submodels": [
{
"id": "3040",
"description": "",
"link": "/object/view.spg?key=3040",
"name": "Main Model",
"image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"
},
// …
],
"diagram": "Adventure Works.DM1",
"attributes": [
{
"id": "409",
"default": "",
"definition": "Unique identification number for the state or province. Foreign key to StateProvince table.",
"keytype": "Inherited Non-Key",
"link": "/object/view.spg?key=409",
"name": "StateProvinceID",
"domain": "",
"isNullable": "NOT NULL",
"datatype": "INTEGER",
"url": "/v1/columns/409"
},
// …
],
"notes": "",
},
// …
]
}
This is from a GET v1/entities/<id> call:
{
"entity": {
"diagramURL": "/v1/diagrams/2",
"model": "Logical",
"link": "/object/view.spg?key=40",
"type": "Entity",
"schema": "Person",
"id": 40,
"modelURL": "/v1/models/3",
"alerts": [],
"tableName": "Address",
"createdAt": 1369928964,
"description": "Street address information for customers, employees, and vendors.",
"name": "Address",
"modelLink": "/object/view.spg?key=3",
"diagramLink": "/object/view.spg?key=2",
"attachments": [],
"diagramId": 2,
"securityproperties": [
{
"id": "3804",
"link": "/object/view.spg?key=3804",
"name": "Security Impact",
"value": "Moderate",
"dictionary": "Adventure Works_DD",
"datatype": "Text List",
"type": "Data Security Classification"
},
// …
],
"url": "/v1/entities/40",
"modelId": 3,
"submodels": [
{
"id": "3040",
"description": "",
"link": "/object/view.spg?key=3040",
"name": "Main Model",
"image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"
},
// …
],
"diagram": "Adventure Works.DM1",
"attributes": [
{
"id": "411",
"default": "",
"definition": "Second street address line.",
"keytype": "Non-Inherited Non-Key",
"link": "/object/view.spg?key=411",
"name": "AddressLine2",
"domain": "",
"isNullable": "NULL",
"datatype": "NVARCHAR",
"url": "/v1/columns/411"
},
// …
],
"notes": ""
}
}