API Merge People

Merge People

The merge people endpoint allows you to combine the person record for up to http://securelb.trackerproducts.com/api/people/mergePeople/{destinationPersonId}


Merging people will take all case, item, task, media, and notes associated with the source person and apply those associations to the destination person. For example, if a source person is a witness in a case, then after merge operation the destination person will now be a witness in a case.


Here are some general notes on doing a people merge:


Here is an example of using this endpoint:

To start, let's look at a person record that will be our destination person:


{

"formDataParsed": [ ],

"id": 1716172,

"guid": "31df989b-f3b7-4950-bd97-49f10227d9cb",

"organizationId": 375,

"userId": null,

"createDateTime": "2019-10-24T12:54:05.23Z",

"updatedDateTime": null,

"isDeleted": null,

"businessName": "",

"businessNameLC": "",

"name": "Destination Something Person",

"nameLC": "destination something person",

"firstName": "Destination",

"firstNameLC": "destination",

"middleName": "Something",

"middleNameLC": "something",

"lastName": "Person",

"lastNameLC": "person",

"alias": "DP",

"aliasLC": "dp",

"driverLicence": "oh 333333",

"mobilePhone": "333-333-3333",

"otherPhone": "333-333-3334",

"email": "dp@gmail.com",

"dob": "2000-03-03T05:00:00Z",

"raceId": 1,

"race": "Unknown",

"genderId": 1,

"gender": "Unknown",

"deceased": null,

"juvenile": null,

"active": true,

"personTypeId": null,

"historiesAmount": 0,

"formData": [ ],

"formDataAmount": 0,

"notes": [ ],

"notesAmount": 0,

"media": [ ],

"mediaAmount": 0,

"rootMediaFolderId": 254092,

"externalOrganizationIds": [ ],

"displayedName": null,

"defaultAddress": "n/a",

"isForbidden": false

}



Here is the cases list for the destination person

http://securelb.trackerproducts.com/api/people/1716172/casesList


{

"personType": {

"id": 3,

"name": "Witness",

"active": true,

"organizations": null

},

"caseNotes": null,

"formDataParsed": [ ],

"id": 2934344,

"caseNumber": "2019-1024-03",

"caseOfficerId": 27689,

"caseOfficer": "Jimmy Paige",

"offenseTypeId": 158,

"offenseType": "Accident",

"offenseDescription": "Accident 3",

"offenseLocation": "Newport, KY, USA",

"offenseDate": "2019-10-24T04:00:00Z",

"followUpDate": null,

"active": true,

"officeId": 607,

"officeName": "Default Office",

"creatorId": 1,

"creator": "Jack 3176D103FF Sparrow",

"createdDate": "2019-10-24T12:51:10.921Z",

"organizationId": 375,

"organizationName": "Merge Test Org",

"items": [ ],

"nextItemId": "1",

"media": null,

"mediaAmount": 0,

"rootMediaFolderId": 254091,

"formData": null,

"formDataAmount": 0,

"notes": null,

"notesAmount": 0,

"itemsNotesAmount": 0,

"tags": [ ],

"tagsAmount": 0,

"peopleAmount": 0,

"tasksAmount": 0,

"historiesAmount": 0,

"closedDate": null,

"reviewDate": null,

"reviewDateNotes": "",

"isRestricted": false,

"permissionAmount": 0,

"permissions": null,

"isForbidden": false

}



Here are our source people for this merge:

Source Person1

{

"formDataParsed": [ ],

"id": 1716170,

"guid": "643924d3-3d07-42a8-b461-12dc044eb2d2",

"organizationId": 375,

"userId": null,

"createDateTime": "2019-10-24T12:34:22.424Z",

"updatedDateTime": null,

"isDeleted": null,

"businessName": "",

"businessNameLC": "",

"name": "Source First Person1",

"nameLC": "source first person1",

"firstName": "Source",

"firstNameLC": "source",

"middleName": "First",

"middleNameLC": "first",

"lastName": "Person1",

"lastNameLC": "person1",

"alias": "SP1",

"aliasLC": "sp1",

"driverLicence": "oh 111111",

"mobilePhone": "111-111-1111",

"otherPhone": "111-111-1112",

"email": "sp1@gmail.com",

"dob": "2000-01-01T05:00:00Z",

"raceId": 1,

"race": "Unknown",

"genderId": 1,

"gender": "Unknown",

"deceased": false,

"juvenile": false,

"active": true,

"personTypeId": null,

"historiesAmount": 0,

"formData": [ ],

"formDataAmount": 0,

"notes": [ ],

"notesAmount": 0,

"media": [ ],

"mediaAmount": 0,

"rootMediaFolderId": 254087,

"externalOrganizationIds": [ ],

"displayedName": null,

"defaultAddress": "1 First Street, , Cincinnati, Ohio, 11111",

"isForbidden": false

},



Source Person2


{

"formDataParsed": [ ],

"id": 1716171,

"guid": "caf9a209-6797-41ca-a090-ff18ac8d1627",

"organizationId": 375,

"userId": null,

"createDateTime": "2019-10-24T12:36:12.969Z",

"updatedDateTime": null,

"isDeleted": null,

"businessName": "",

"businessNameLC": "",

"name": "Source Second Person2",

"nameLC": "source second person2",

"firstName": "Source",

"firstNameLC": "source",

"middleName": "Second",

"middleNameLC": "second",

"lastName": "Person2",

"lastNameLC": "person2",

"alias": "SP2",

"aliasLC": "sp2",

"driverLicence": "oh 222222",

"mobilePhone": "222-222-2222",

"otherPhone": "222-222-2223",

"email": "sp2@gmail.com",

"dob": "2000-02-02T05:00:00Z",

"raceId": 1,

"race": "Unknown",

"genderId": 1,

"gender": "Unknown",

"deceased": false,

"juvenile": false,

"active": true,

"personTypeId": null,

"historiesAmount": 0,

"formData": [ ],

"formDataAmount": 0,

"notes": [ ],

"notesAmount": 0,

"media": [ ],

"mediaAmount": 0,

"rootMediaFolderId": 254088,

"externalOrganizationIds": [ ],

"displayedName": null,

"defaultAddress": "2 Second Street, , Cincinnati, Ohio, 22222",

"isForbidden": false

}



Here are the case lists with our source people:

http://securelb.trackerproducts.com/api/people/1716172/casesList

Source Person1 Case


{

"personType": {

"id": 2,

"name": "Victim",

"active": true,

"organizations": null

},

"caseNotes": null,

"formDataParsed": [ ],

"id": 2934342,

"caseNumber": "2019-1024-01",

"caseOfficerId": 27689,

"caseOfficer": "Jimmy Paige",

"offenseTypeId": 158,

"offenseType": "Accident",

"offenseDescription": "accident",

"offenseLocation": "Newport, KY, USA",

"offenseDate": "2019-10-24T04:00:00Z",

"followUpDate": null,

"active": true,

"officeId": 607,

"officeName": "Default Office",

"creatorId": 1,

"creator": "Jack 3176D103FF Sparrow",

"createdDate": "2019-10-24T12:37:28.144Z",

"organizationId": 375,

"organizationName": "Merge Test Org",

"items": [ ],

"nextItemId": "1",

"media": null,

"mediaAmount": 0,

"rootMediaFolderId": 254089,

"formData": null,

"formDataAmount": 0,

"notes": null,

"notesAmount": 0,

"itemsNotesAmount": 0,

"tags": [ ],

"tagsAmount": 0,

"peopleAmount": 0,

"tasksAmount": 0,

"historiesAmount": 0,

"closedDate": null,

"reviewDate": null,

"reviewDateNotes": "",

"isRestricted": false,

"permissionAmount": 0,

"permissions": null,

"isForbidden": false

}



Source Person2 Case


{

"personType": {

"id": 1,

"name": "Suspect",

"active": true,

"organizations": null

},

"caseNotes": null,

"formDataParsed": [ ],

"id": 2934343,

"caseNumber": "2019-1024-02",

"caseOfficerId": 27689,

"caseOfficer": "Jimmy Paige",

"offenseTypeId": 158,

"offenseType": "Accident",

"offenseDescription": "accident 2",

"offenseLocation": "Newport, KY, USA",

"offenseDate": "2019-10-24T04:00:00Z",

"followUpDate": null,

"active": true,

"officeId": 607,

"officeName": "Default Office",

"creatorId": 1,

"creator": "Jack 3176D103FF Sparrow",

"createdDate": "2019-10-24T12:38:21.398Z",

"organizationId": 375,

"organizationName": "Merge Test Org",

"items": [ ],

"nextItemId": "1",

"media": null,

"mediaAmount": 0,

"rootMediaFolderId": 254090,

"formData": null,

"formDataAmount": 0,

"notes": null,

"notesAmount": 0,

"itemsNotesAmount": 0,

"tags": [ ],

"tagsAmount": 0,

"peopleAmount": 0,

"tasksAmount": 0,

"historiesAmount": 0,

"closedDate": null,

"reviewDate": null,

"reviewDateNotes": "",

"isRestricted": false,

"permissionAmount": 0,

"permissions": null,

"isForbidden": false }



So pre merge we have:


Now we will do a merge of our source people into our destination person.

In the url we provide the id of the destination person.

In the body of the post we provide an array of source people ids.

POST http://securelb.trackerproducts.com/api/people/mergePeople/1716172


Now the same call to get cases list for our destination person produces the following:


{

"personType": {

"id": 2,

"name": "Victim",

"active": true,

"organizations": null

},

"caseNotes": null,

"formDataParsed": [ ],

"id": 2934342,

"caseNumber": "2019-1024-01",

"caseOfficerId": 27689,

"caseOfficer": "Jimmy Paige",

"offenseTypeId": 158,

"offenseType": "Accident",

"offenseDescription": "accident",

"offenseLocation": "Newport, KY, USA",

"offenseDate": "2019-10-24T04:00:00Z",

"followUpDate": null,

"active": true,

"officeId": 607,

"officeName": "Default Office",

"creatorId": 1,

"creator": "Jack 3176D103FF Sparrow",

"createdDate": "2019-10-24T12:37:28.144Z",

"organizationId": 375,

"organizationName": "Merge Test Org",

"items": [ ],

"nextItemId": "1",

"media": null,

"mediaAmount": 0,

"rootMediaFolderId": 254089,

"formData": null,

"formDataAmount": 0,

"notes": null,

"notesAmount": 0,

"itemsNotesAmount": 0,

"tags": [ ],

"tagsAmount": 0,

"peopleAmount": 0,

"tasksAmount": 0,

"historiesAmount": 0,

"closedDate": null,

"reviewDate": null,

"reviewDateNotes": "",

"isRestricted": false,

"permissionAmount": 0,

"permissions": null,

"isForbidden": false

},

{

"personType": {

"id": 1,

"name": "Suspect",

"active": true,

"organizations": null

},

"caseNotes": null,

"formDataParsed": [ ],

"id": 2934343,

"caseNumber": "2019-1024-02",

"caseOfficerId": 27689,

"caseOfficer": "Jimmy Paige",

"offenseTypeId": 158,

"offenseType": "Accident",

"offenseDescription": "accident 2",

"offenseLocation": "Newport, KY, USA",

"offenseDate": "2019-10-24T04:00:00Z",

"followUpDate": null,

"active": true,

"officeId": 607,

"officeName": "Default Office",

"creatorId": 1,

"creator": "Jack 3176D103FF Sparrow",

"createdDate": "2019-10-24T12:38:21.398Z",

"organizationId": 375,

"organizationName": "Merge Test Org",

"items": [ ],

"nextItemId": "1",

"media": null,

"mediaAmount": 0,

"rootMediaFolderId": 254090,

"formData": null,

"formDataAmount": 0,

"notes": null,

"notesAmount": 0,

"itemsNotesAmount": 0,

"tags": [ ],

"tagsAmount": 0,

"peopleAmount": 0,

"tasksAmount": 0,

"historiesAmount": 0,

"closedDate": null,

"reviewDate": null,

"reviewDateNotes": "",

"isRestricted": false,

"permissionAmount": 0,

"permissions": null,

"isForbidden": false

},

{

"personType": {

"id": 3,

"name": "Witness",

"active": true,

"organizations": null

},

"caseNotes": null,

"formDataParsed": [ ],

"id": 2934344,

"caseNumber": "2019-1024-03",

"caseOfficerId": 27689,

"caseOfficer": "Jimmy Paige",

"offenseTypeId": 158,

"offenseType": "Accident",

"offenseDescription": "Accident 3",

"offenseLocation": "Newport, KY, USA",

"offenseDate": "2019-10-24T04:00:00Z",

"followUpDate": null,

"active": true,

"officeId": 607,

"officeName": "Default Office",

"creatorId": 1,

"creator": "Jack 3176D103FF Sparrow",

"createdDate": "2019-10-24T12:51:10.921Z",

"organizationId": 375,

"organizationName": "Merge Test Org",

"items": [ ],

"nextItemId": "1",

"media": null,

"mediaAmount": 0,

"rootMediaFolderId": 254091,

"formData": null,

"formDataAmount": 0,

"notes": null,

"notesAmount": 0,

"itemsNotesAmount": 0,

"tags": [ ],

"tagsAmount": 0,

"peopleAmount": 0,

"tasksAmount": 0,

"historiesAmount": 0,

"closedDate": null,

"reviewDate": null,

"reviewDateNotes": "",

"isRestricted": false,

"permissionAmount": 0,

"permissions": null,

"isForbidden": false

}



We also have a related endpoint which will allow you to see the merged source people history record:

GET http://securelb.trackerproducts.com/api/people/1716172/getMergedPersonHistories