POST http://helix2:1900/api/PublicApi/GetEntityById
To load an entity fully, for update purposes, or for displaying info about entity, like comments, and attachments, it is recommended to use this method. If you want to get information about Items linked to the Entity (like Cis linked to a Ticket) use the Utility methods. 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": "Ci",
"Id": 192,
"LoadDynamicProperties": true
}
If you want to read extra reference details for object, you need to set in request like:
POST http://helix2:1900/api/PublicApi/GetEntityById
{
"EntityType": "WorklogView",
"Id": 192,
"LoadDynamicProperties": true,
"loadExtraReferenceDetails": {
"RequesterOrganizationId": "Organization",
"TicketEndUserId": "Person"
}
}
Note: you always need to have loadDynamicProperties on true if you want to loadExtraRefernceDetails.
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
}
If you load extra reference details properties, response looks like:
{
"Data": {
"Entity": {
"LanguageId": 1,
"Id": 156,
"CustomerAccountId": 16,
"EntityTypeId": 10,
"DiscountPercent": null,
"EntityTypeName": "test",
"BillingMethodId": 1,
"EntityReferenceNo": "REQ0000551",
"BillingMethodName": "Per Hour",
"BillingMethodNameKey": "Common.PerHour",
"EntityTypeNameKey": "WorklogTypes.test_1",
"TableRepositoryId": 159,
"AgentName": "Henrik (Testexa) Svensson",
"AgentUrl": "/appattachment/getattachmentresult/235",
"TicketId": 1116,
"ReferenceNo": "WL0000156",
"Subject": "dator",
"EntityStatus": "Assigned",
"TranslatedEntityStatus": "Assigned",
"AgentId": 145,
"AgentEmail": "nsphenrik@testexa.local",
"TicketAgentGroupId": 1,
"TicketAgentOrganizationId": 87,
"RequesterOrganizationId": 87,
"TicketEndUserId": 444,
"TicketTypeId": 112,
"TicketStatus": 1,
"RequesterName": "Dzenan Strujic",
"RequesterEmail": "dzenan.strujic@textexa.local",
"StartTime": "2018-11-24T23:00:00Z",
"EndTime": "2018-11-25T05:45:00Z",
"DurationHours": 6,
"DurationMinutes": 45,
"CurrencyId": 1,
"CurrencyName": "EUR",
"Status": 1,
"IsCanceled": false,
"Description": null,
"AgentCost": 607.5,
"Discount": 0,
"IsInvoiceable": true,
"IsInvoiced": true,
"IsExported": false,
"TimeSpent": 24300,
"TimeSpentText": "06h:45m",
"MaintenanceRateTypeId": 1,
"MaintenanceRateValue": 90,
"MaintenanceRateTypeName": "Standard",
"TotalCharge": 607.5,
"Remarks": null,
"InvoiceId": 0,
"InvoiceReferenceNumber": null,
"AgentCostWithDiscount": 607.5,
"CustomerAccountName": "Customer Henrik Test",
"EntityTypePath": "|1||10|",
"EntityTypeMembershipLevel": null,
"EntityTypeIcon": "f-nsp-cube",
"TicketTypeName": "Request",
"AdditionalCharges": 0,
"TicketAssignee": "ServiceDesk",
"InsertUserId": 145,
"InsertTime": "2018-11-26T10:09:55Z",
"InsertIpAddress": "192.168.111.66",
"LastUpdateUserId": 1,
"LastUpdateTime": "2018-11-28T06:25:19Z",
"LastUpdateIpAddress": null
},
"DynamicProperties": {},
"ExtraReferenceDetails": {
"RequesterOrganizationIdExtra": {
"u_CustomField1": null,
"u_CustomField2": null,
"u_CustomField3": null,
"OrganizationName": "Testexa AB",
"DomainEmail": "testexa.local",
"Image": "",
"StreetAddress": null,
"CustomerNumber": null,
"PostalCode": null,
"City": null,
"Country": null,
"EmailAddress": null,
"Phone": null,
"Fax": null,
"ParentOrganizationId": null,
"TypeId": 110,
"OwnerId": null,
"Version": 6,
"BaseStatus": 1,
"CreatedDate": "2018-10-29T06:46:03Z",
"CreatedBy": 1,
"UpdatedDate": "2018-11-07T09:08:51Z",
"UpdatedBy": 86,
"IPAddress": "192.168.111.4"
},
"TicketEndUserIdExtra": {
"u_PersonalNumber": null,
"FirstName": "Dzenan",
"LastName": "Strujic",
"EMailAddress": "dzenan.strujic@textexa.local",
"Phone": "",
"MobilePhone": "",
"AddressId": null,
"Department": "-",
"JobTitle": "-",
"PersonTitleId": null,
"DateOfBirth": null,
"Image": null,
"FullName": "Dzenan Strujic",
"OrganizationId": 87,
"DefaultLanguageId": 1,
"IsVIP": false,
"VIPNotes": null,
"Room": null,
"CostCenter": null,
"MaxStorage": 0,
"Description": "-",
"Comment": "-",
"Notes": "-",
"Company": "-",
"FaxNumber": "",
"HomeFolder": "-",
"HomeDrive": "-",
"HomePhone": "",
"HomeAddress": "-",
"IpPhoneNumber": "",
"Manager": "-",
"PagerNumber": "",
"WebPageAddress": "-",
"MemberOf": "NSP_Agent",
"RoomNumber": "-",
"OfficeLocation": "-",
"ExtraCustomField1": "-",
"ExtraCustomField2": "-",
"ExtraCustomField3": "-",
"PhoneClean": null,
"MobilePhoneClean": null,
"SkypeName": "",
"LyncAddress": "Dzenan@testexa.local",
"DoNotSendEmailNotification": false,
"LyncTel": "",
"AdManagerUserId": null,
"IsActive": true,
"IsLicensed": true,
"DisplayName": "Dzenan Strujic",
"UserTypeId": 1,
"Email": "dzenan.strujic@textexa.local",
"PasswordMD5HexHash": "ad89ea12768486f9f7cef1e2c777de72",
"LastPwdDate": null,
"AuthToken": null,
"AuthTokenGeneratedOn": null,
"WindowsUserName": "dzenan",
"WindowsSidString": "S-1-5-21-296481471-456928714-2885353289-52402",
"LdapServerId": 2,
"TypeId": 111,
"OwnerId": null,
"Version": 2,
"BaseStatus": 1,
"CreatedDate": "2018-11-07T13:00:22Z",
"CreatedBy": 141,
"UpdatedDate": "2018-11-07T13:00:22Z",
"UpdatedBy": 141,
"IPAddress": 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": [
{
"EntityTypeName": "Work log standard type",
"BillingMethodName": null,
"MaintenanceRateTypeId": 0,
"MaintenanceRateTypeName": "-",
"CustomerAccountId": null,
"EntityTypeNameKey": "WorklogTypes.StandardType",
"EntityReferenceNo": "REQ0000169",
"AgentName": "Dzenan Strujic",
"TableRepositoryId": 159,
"AgentUrl": "/appattachment/getattachmentresult/76",
"BillingMethodId": 0,
"BillingMethodNameKey": null,
"TicketId": 425,
"ReferenceNo": "WL0000039",
"Subject": "Vincent 2",
"EntityStatus": "Closed",
"TranslatedEntityStatus": "Closed",
"AgentId": 86,
"AgentEmail": "dzenan@testexa.local",
"TicketAgentGroupId": 1,
"TicketAgentOrganizationId": 87,
"RequesterOrganizationId": 87,
"TicketEndUserId": 444,
"TicketTypeId": 112,
"TicketStatus": 1,
"DiscountPercent": 0,
"RequesterName": "Dzenan Strujic",
"RequesterEmail": "dzenan.strujic@nilex.se",
"StartTime": "2018-11-07T08:00:00Z",
"EndTime": "2018-11-07T09:00:00Z",
"DurationHours": 1,
"DurationMinutes": 0,
"CurrencyId": 1,
"CurrencyName": "EUR",
"IsCanceled": true,
"AgentCost": 1,
"Discount": 0,
"LanguageId": 1,
"IsInvoiceable": false,
"IsInvoiced": null,
"IsExported": false,
"TimeSpent": 3600,
"TimeSpentText": "01h:00m",
"MaintenanceRateValue": 1,
"TotalCharge": 1,
"AgentCostWithDiscount": 1,
"TicketTypeName": "Request",
"CustomerAccountName": null,
"Remarks": "not active",
"InvoiceId": 0,
"EntityTypeMembershipLevel": 0,
"EntityTypeIcon": "f-nsp-manage",
"EntityTypePath": "|1||2|",
"InvoiceReferenceNumber": null,
"AdditionalCharges": 0,
"TicketAssignee": "Dzenan (Testexa) Strujic (ServiceDesk)",
"MachineName": null,
"Name": null,
"NameKey": null,
"Description": "worklog",
"DescriptionKey": null,
"EntityTypeId": 2,
"InsertUserId": 86,
"InsertTime": "2018-11-07T10:49:27Z",
"InsertIpAddress": "192.168.111.67",
"LastUpdateUserId": 86,
"LastUpdateTime": "2018-11-07T10:57:53Z",
"LastUpdateIpAddress": "192.168.111.67",
"Id": 39,
"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
}