Method: Get single entity

POST http://helix2:1900/api/PublicApi/GetEntityById

To load an entity fully, for update purposes, or for displaying full info about entity, like comments, and attachments, it is recommended to use this method. Which related data should be loaded can be set in an array-property called “Schema”. This array is optional, and valid values are:

Fields, Comments, Worklogs, Attachments, Relations, Cis, Tickets, All.

Note that for attachments only basic file-info is fetched, not the actual binary data. This need to be fetched by separate call, for each attached file.

Example call:

POST http://helix2:1900/api/PublicApi/GetEntityById

 

{

  "EntityType": "Ticket",

  "Id": 192,

}

 

If you want to read dynamic properties for entities like: Ci, Contract, …

POST http://helix2:1900/api/PublicApi/GetEntityById

 

{

  "EntityType": "Ticket",

  "Id": 192,

  "LoadDynamicProperties": true

}

 

If no schema is specified as above, the default behaviour is to load only ticket-fields, as seen below (fields excluded for brevity):

  "Data": { 

    "Id": 192,  

    "EntityTypeId": 112,

    "Version": 23,

    "CreatedDate": "2015-09-02T09:56:46Z",

    "UpdatedDate": "2015-09-02T13:30:21Z"   

  },

  "Errors": null,

  "IsError": false

}

 

If you load dynamic properties, response looks like:

{

    "Data": {

        "Entity": {

            "ReferenceNo": "CI0367651",

            "ExternalReference": null,

            "CiGroupIds": null,

            "DepartmentId": null,

            "OrganizationId": null,

            "SerialNumber": "7075-2656-5595-3156-7674-3441-23",

            "ImpactId": null,

            "CiStateId": 1,

            "FunctionId": null,

            "ProductId": 13290,

            "VendorId": null,

            "SlaId": null,

            "LocationId": null,

            "ManagedById": null,

            "UsedById": null,

            "LastAuditDate": null,

            "InventoryNumber": null,

            "InventoryNumberType": null,

            "Name": "HBGBALDERVIRT01",

            "NameKey": null,

            "Description": null,

            "DescriptionKey": null,

            "EntityTypeId": 6,

            "InsertUserId": 1,

            "InsertTime": "2017-11-27T11:40:41Z",

            "InsertIpAddress": "::1",

            "LastUpdateUserId": 1,

            "LastUpdateTime": "2017-11-27T11:40:41Z",

            "LastUpdateIpAddress": "::1",

            "Id": 367651,

            "Status": 1

        },

        "DynamicProperties": {

            "Warranty Start": null,

            "Warranty Period (months)": null,

            "Domain": null,

            "OS": {

                "Id": 219690,

                "EntityId": 367651,

                "AttributeId": 5,

                "Value": "Microsoft Windows Server 2008 R2 Standard ",

                "ValueTranslateKey": null

            },

            "OS Version": null,

            "OS Edition": null,

            "OS Service Pack": null,

            "Memory (GB)": {

                "Id": 219695,

                "EntityId": 367651,

                "AttributeId": 9,

                "Value": "4",

                "ValueTranslateKey": null

            },

            "Disk Space (GB)": {

                "Id": 219659,

                "EntityId": 367651,

                "AttributeId": 10,

                "Value": "99",

                "ValueTranslateKey": null

            },

            "CPU": {

                "Id": 219692,

                "EntityId": 367651,

                "AttributeId": 11,

                "Value": "Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz",

                "ValueTranslateKey": null

            },

            "CPU Speed (GHz)": {

                "Id": 219693,

                "EntityId": 367651,

                "AttributeId": 12,

                "Value": "2527",

                "ValueTranslateKey": null

            },

            "CPU Core Count": {

                "Id": 219694,

                "EntityId": 367651,

                "AttributeId": 13,

                "Value": "1",

                "ValueTranslateKey": null

            },

            "MAC Address": {

                "Id": 219578,

                "EntityId": 367651,

                "AttributeId": 14,

                "Value": "00-0C-29-D9-44-B9",

                "ValueTranslateKey": null

            },

            "UUID": null,

            "Hostname": {

                "Id": 219658,

                "EntityId": 367651,

                "AttributeId": 16,

                "Value": "HBGBALDERVIRT01",

                "ValueTranslateKey": null

            },

            "Disk Slots": null,

            "Procurement type": null,

            "Invoice number": null,

            "Purchase date": null,

            "Purchase price": null,

            "Residual value": null,

            "IP Address": {

                "Id": 219577,

                "EntityId": 367651,

                "AttributeId": 437,

                "Value": "192.168.112.43",

                "ValueTranslateKey": null

            },

            "Book Value": null,

            "Depreciation Value": null,

            "Depreciation Type": null,

            "Depreciation Period": null,

            "Depreciation end date": null

        }

    },

    "Errors": null,

    "IsError": false

}

Here is a request fetching comments, attachments, worklogs and relations, but not ticket fields:

{

  "EntityType": "Ticket",

  "Id": 4662,

  "Schema": ["Comments", "Attachments", "Worklogs", "Relations"]

}

Response example:

  "Data": { 

    "Id": 4662,

    "EntityTypeId": 112,

    "EntityType": "Ticket"

    "Comments": [ 

      { 

        "Id": 1617,

        "EntityInstanceId": 4662,

        "SourceId": 7,

        "Body": "Testcomment",

        "CreatedById": 1366,

        "CreatedDate": "2016-02-09T09:54:22Z",

        "IsPublic": true,

        "IsSolution": false,

        "IsWorkaround": false,

        "Status": 1,

        "CommentTime": 0,

        "Attachments": [ 

 

        ]

      },

      { 

        "Id": 1625,

        "EntityInstanceId": 4662,

        "SourceId": 1,

        "Body": "REQ0000148 has been merged into this request.",

        "CreatedById": 1,

        "CreatedDate": "2016-05-26T14:54:52Z",

        "IsPublic": false,

        "IsSolution": false,

        "IsWorkaround": false,

        "Status": 1,

        "CommentTime": 0,

        "Attachments": [ 

 

        ]

      }

    ],

    "Attachments": [ 

 

    ],

    "WorkLogs": [ 

      { 

        "Id": 1,

        "EntityInstanceId": 4662,

        "AgentId": 1,

        "StartTime": "2016-05-26T00:00:00Z",

        "EndTime": "2016-05-26T00:30:00Z",

        "CurrencyId": 7,

        "AgentCost": 0.0000,

        "OtherCharges": 0.0000,

        "Descriptions": "edfdfddffddfdf",

        "IsCanceled": false,

        "Remark": null,

        "AgentRateTypeId": 0,

        "Discount": 0.0000,

        "InsertUserId": 1,

        "InsertTime": "2016-05-26T14:24:55Z",

        "LastUpdateUserId": 1,

        "LastUpdateTime": "2016-05-26T14:25:02Z",

        "Status": 1

      }

    ],

    "Relations": [ 

      { 

        "Id": 155,

        "SourceId": 4662,

        "SourceEntityType": "Ticket",

        "DestinationId": 4683,

        "DestinationEntityType": "Ticket",

        "RelationshipType": "Association",

        "Status": 1

      },

      { 

        "Id": null,

        "SourceId": 1470,

        "SourceEntityType": "Ticket",

        "DestinationId": 4662,

        "DestinationEntityType": "Ticket",

        "RelationshipType": "Merged",

        "Status": 1

      }

    ]

  },

  "Errors": null,

  "IsError": false

}