API Update Existing Person

API URL

https://securelb.trackerproducts.com/api/people/X

Where X = ID of Person

Instructions

To update a person in the system, the user must go through the following process:

Get ID of the person to update

A simple search can return a matching person based on name (any part of first, last, and business name will return results). Also, an email address can be used to accomplish this search (As a reminder, the email address in the system is unique which may be the best way to find a particular person).


Also, please see the following page for a more comprehensive search of people in the system: Custom Person Search 

The endpoint which can be used is the type-ahead search. Note that this search will only return a list of 10 people at one time, so the search should be as specific as possible.

https://securelb.trackerproducts.com/api/people/typeahead?search=X

Where X = Last Name OR Email Address of Person.

Using ID to get all info on the Person

https://securelb.trackerproducts.com/api/people/X

Where X = ID of person found in previous setp

This returns the person document:

PUT the Person

Take all the JSON information provided in the previous step, change and then PUT back to https://securelb.trackerproducts.com/api/people/X

Where X = ID of the Person being updated

Example JSON for Person PUT


{

       "id":96,

       "guid":"9993788e-fcc1-47f4-8ca7-abc71dff3aa8",

       "organizationId":275,

       "userId":null,

       "createDateTime":"2017-12-04T22:49:00.927Z",

       "updatedDateTime":null,

       "isDeleted":null,

       "businessName":"",

       "businessNameLC":"",

       "name":"Johannes Brahms",

       "nameLC":"johannes brahms",

       "firstName":"Johannes",

       "firstNameLC":"johannes",

       "middleName":"",

       "middleNameLC":null,

       "lastName":"Brahms",

       "lastNameLC":"brahms",

       "alias":"Joe",

       "aliasLC":"joe",

       "driverLicence":"",

       "mobilePhone":"888-888-8888",

       "otherPhone":"123-777-1234",

       "email":"",

       "dob":"1959-01-01T00:00:00.000Z",

       "raceId":27,

       "race":"White",

       "genderId":12,

       "gender":"Male",

       "deceased":false,

       "juvenile":false,

       "active":true,

       "personTypeId":null,

       "formData":[],

       "formDataAmount":0,

       "notes":[],

       "notesAmount":0,

       "media":[],

       "mediaAmount":0,

       "rootMediaFolderId":175,

       "displayedName":" Johannes Brahms",

       "defaultAddress":"1 Somewhere Ave, , Vienna, , 1006"

}

PUTing a Duplicate Person

Entering a duplicate person via a PUT action is handled the same as the POST of a new person. See details 

Use this API if you are PUTing a Duplicate person. https://securelb.trackerproducts.com/api/people/putDuplicate

PUT a Person with custom form data

Custom form data can also be added to a person record

The first step in this process is retrieving custom forms.

GET

https://securelb.trackerproducts.com/api/forms/all


This will return data for all custom forms in your organization.


here is a sample of the return data:

Using ID to get all info on the Person

https://securelb.trackerproducts.com/api/people/X

Where X = ID of person found in previous setp

This returns the person document:

PUT the Person

Take all the JSON information provided in the previous step, change and then PUT back to https://securelb.trackerproducts.com/api/people/X

Where X = ID of the Person being updated

Example JSON for Person PUT


{

       "id":96,

       "guid":"9993788e-fcc1-47f4-8ca7-abc71dff3aa8",

       "organizationId":275,

       "userId":null,

       "createDateTime":"2017-12-04T22:49:00.927Z",

       "updatedDateTime":null,

       "isDeleted":null,

       "businessName":"",

       "businessNameLC":"",

       "name":"Johannes Brahms",

       "nameLC":"johannes brahms",

       "firstName":"Johannes",

       "firstNameLC":"johannes",

       "middleName":"",

       "middleNameLC":null,

       "lastName":"Brahms",

       "lastNameLC":"brahms",

       "alias":"Joe",

       "aliasLC":"joe",

       "driverLicence":"",

       "mobilePhone":"888-888-8888",

       "otherPhone":"123-777-1234",

       "email":"",

       "dob":"1959-01-01T00:00:00.000Z",

       "raceId":27,

       "race":"White",

       "genderId":12,

       "gender":"Male",

       "deceased":false,

       "juvenile":false,

       "active":true,

       "personTypeId":null,

       "formData":[],

       "formDataAmount":0,

       "notes":[],

       "notesAmount":0,

       "media":[],

       "mediaAmount":0,

       "rootMediaFolderId":175,

       "displayedName":" Johannes Brahms",

       "defaultAddress":"1 Somewhere Ave, , Vienna, , 1006"

}

PUTing a Duplicate Person

Entering a duplicate person via a PUT action is handled the same as the POST of a new person. See details 

Use this API if you are PUTing a Duplicate person. https://securelb.trackerproducts.com/api/people/putDuplicate

PUT a Person with custom form data

Custom form data can also be added to a person record

The first step in this process is retrieving custom forms.

GET

https://securelb.trackerproducts.com/api/forms/all


This will return data for all custom forms in your organization.


here is a sample of the return data:

The data to note here is the form id and the name of the custom form field.

For example, form id : 819, form name is "Test2", field name is "field4627" I will now update a person record to include this custom form data.


PUT back to https://securelb.trackerproducts.com/api/people/1634911

Custom form data is added in the formData property.

Here is my request:

{

"id": 1634865,

"guid": "6fdbb17f-1722-48dd-85e4-7fef0a6be5ab",

"organizationId": 1,

"userId": null,

"createDateTime": "2018-03-26T14:45:09.908Z",

"updatedDateTime": "2018-08-03T12:56:25.113Z",

"isDeleted": null,

"businessName": "",

"businessNameLC": "",

"name": "Crazy Person",

"nameLC": "crazy person",

"firstName": "Crazy",

"firstNameLC": "crazy",

"middleName": "",

"middleNameLC": null,

"lastName": "Person",

"lastNameLC": "person",

"alias": "",

"aliasLC": "",

"driverLicence": "",

"mobilePhone": "",

"otherPhone": "",

"email": "",

"dob": null,

"raceId": 1,

"race": "Unknown",

"genderId": 1,

"gender": "Unknown",

"deceased": false,

"juvenile": false,

"active": true,

"personTypeId": null,

"formData": [

{

"formId": 819,

"formName": "Test2",

"data": "{\"field4627\":\"Sample Legal Hold Status\"}",

"entityId": "1634865",

"dateFields": [ ]

}

],

"formDataAmount": 0,

"notes": [ ],

"notesAmount": 0,

"media": [ ],

"mediaAmount": 0,

"rootMediaFolderId": 133677,

"externalOrganizationIds": [ ],

"displayedName": "Crazy Person",

"defaultAddress": "910 E Watersville Road, , Mt. Airy, Maryland, ",

"isForbidden": false

}

POST a Person address

An address can be added for a person by :

POST to:

https://securelb.trackerproducts.com/api/people/1634950/addresses

Here is the json for the POST body:

{

"id": 0,

"date": "2018-09-25T18:42:49.218Z",

"entityId": 1634950,

"line1": "111 First Street",

"line2": "Suite 1",

"city": "Cincinnati",

"zip": "11111",

"stateId": 35,

"addressTypeId": 1,

"countryId": 231

}


Things to note for posting an address:

"entityId" is the person id for whom the address is being added

"id" is required and should be set to a value of 0 - the added address will be assigned an "id" by the system.

"stateId", "addressTypeId", and "countryId" are all supplied in the body by reference to their corresponding integer ids. Here are the GET requests for these items:

https://securelb.trackerproducts.com/api/states

https://securelb.trackerproducts.com/api/countries

https://securelb.trackerproducts.com/api/addressTypes

GET and PUT a Person address


To get the addresses associated with a person record use the following GET request:

https://securelb.trackerproducts.com/api/people/1634950/addresses

This will return the following data: [ {

"id": 1090834,

"createDateTime": "2018-09-25T19:18:05.937+00:00",

"updatedDateTime": null,

"isDeleted": null,

"entityId": 1634991,

"line1": "701 Overton St",

"line2": "",

"city": "Newport",

"zip": "41071",

"date": "2018-09-25T19:17:19.679+00:00",

"stateId": 17,

"state": null,

"countryId": 231,

"country": null,

"addressTypeId": 1,

"addressType": null,

"isDefaultAddress": true

}

]


To edit this address, use the following PUT request:

https://securelb.trackerproducts.com/api/people/1634991/addresses/1090834


Notice the url contains the person "id" and also the address "id"

Also, "country", "addressType", and "state" can be removed. You can just send the ids for these fields.

Here is the body of my address edit: {

"id": 1090834,

"createDateTime": "2018-09-25T19:18:05.937+00:00",

"updatedDateTime": null,

"isDeleted": null,

"entityId": 1634991,

"line1": "701 Overton St",

"line2": "",

"city": "Somewhere",

"zip": "41071",

"date": "2018-09-25T19:17:19.679+00:00",

"stateId": 35,

"countryId": 231,

"addressTypeId": 1,

"isDefaultAddress": true

}