- URL:
- https://<root>/<serviceName>/NetworkDiagramServer/createDiagramFromFeatures
- Methods:
- POST
- Version Introduced:
- 10.6
Description
The create operation creates a new diagram resource. It is performed on a Network Diagram Service resource. The result of this operation is a Diagram Information JSON object. The newly created diagram is a temporary diagram.
Request Parameters
| Parameter | Details | 
|---|---|
| 
 | The name of the geodatabase version. Syntax:  Example:  | 
| 
 | The token (guid) used to lock the version. Syntax:  Example:  | 
| 
 (Required) | The name of the diagram template the new network diagram will be based on. Syntax:  Example:  | 
| 
 (Required) | An array of network element Global IDs from which the new diagram is going to be built. Syntax:  Example:  | 
| 
 | The response format. The default response format is html. Values:  | 
Example Usage
Creating a new temporary network diagram based on the ExpandContainers template from three utility network distribution lines which Global IDs are {22E157ED-68A0-407D-9F06-A030C5A1995F}, {BDCD6D28-D03B-4099-8F2E-DCB7665DD0F0} and {BAF7AC0F-47CB-479A-A916-827D18890375}; that is:
- 
URL: https://myserver.esri.com/server/rest/services/Naperville/Network Diagram Server/create Diagram From Features 
- 
Parameters: Use dark colors for code blocks Copy gdbVersion= sessionId= template=ExpandContainers initialFeatures=["{22E157ED-68A0-407D-9F06-A030C5A1995F}","{BDCD6D28-D03B-4099-8F2E-DCB7665DD0F0}","{BAF7AC0F-47CB-479A-A916-827D18890375}"] f=pjson
- 
Sent GET URL: https://myserver.esri.com/server/rest/services/Naperville/Network Diagram Server/create Diagram From Features?gdb Version=&session Id=&template=Expand Containers&initial Features=%5B%22%7B22E157ED-68A0-407D-9F06-A030C5A1995F%7D%22%2C%22%7BBDCD6D28-D03B-4099-8F2E-DCB7665DD0F0%7D%22%2C%22%7BBAF7AC0F-47CB-479A-A916-827D18890375%7D%22%5D&f=pjson 
Creating a new temporary network diagram in version ABV1 based on the Basic template from the distribution line which Global ID is {F8199534-8B77-4D26-8C3C-8A55DB66728E}, that is:
- 
URL: https://myserver.esri.com/server/rest/services/Naperville/Network Diagram Server/create Diagram From Features 
- 
Parameters: Use dark colors for code blocks Copy gdbVersion=ABV1 sessionId= template=Basic initialFeatures=["{F8199534-8B77-4D26-8C3C-8A55DB66728E}"] f=pjson
- 
Sent URL (GET): https://myserver.esri.com/server/rest/services/Naperville/Network Diagram Server/create Diagram From Features?gdb Version=ABV1&session Id=&template=Basic&initial Features=%5B%22%F8199534-8B77-4D26-8C3C-8A55DB66728E%7D%22%5D&f=pjson 
JSON Response Syntax
A Diagram JSON Information object.
JSON Response Example
{
 "diagramInfo": {
  "tag": "",
  "isStored": false,
  "canStore": true,
  "canExtend": true,
  "isSystem": false,
  "creator": "acb7352",
  "creationDate": 1505218557000,
  "lastUpdateBy": "acb7352",
  "lastUpdateDate": 1505218557000,
  "containerMargin": 0.5,
  "junctionCount": 2,
  "edgeCount": 1,
  "containerCount": 0,
  "aggregationCount": 0,
  "isHistorical": false,
  "access": "esriDiagramPublicAccess",
  "diagramExtent": {
   "xmin": 6807921.0110047311,
   "ymin": 1848205.2526849657,
   "xmax": 6808257.8722076416,
   "ymax": 1848207.8143596351,
   "spatialReference": {
    "wkid": 3498,
    "latestWkid": 3498
   }
  },
  "networkExtent": {
   "xmin": 6807921.0110047311,
   "ymin": 1848205.2526849657,
   "xmax": 6808257.8722076416,
   "ymax": 1848207.8143596351,
   "spatialReference": {
    "wkid": 3498,
    "latestWkid": 3498
   }
  },
  "name": "7C458C4491F94B5591635AFA029816FF",
  "id": "{EEEAF10B-FD9B-4DEE-B911-3E65FAA5A3B2}",
  "template": "Basic"
 }
}