HTTP API Resource - Person

Person

A person record stores the demographic information for a person. Unapproved updates to a person record are stored as a 'working copy' person record that is related to the 'active' person record. When the update is approved, the active person record is updated and the working copy is deleted.

The HTTP API resource for Persons has some special features and restrictions for active and working copy persons which are explained in the sections below.

The URL where persons can be accessed/created/modified is

http://[hostName]:[portNumber]/[api-context-root]/generic/persons

GET

Works as normal api with the following special functionality:

  • Searching the API on person code alone retrieves active persons only with a workingCopy detail lst.

  • Working copy persons can be accessed by searching on the technical id.

Get on the above url will return all persons for the resource name. A sample reply will look like below.

{
    "offset": 0,
    "count": 50,
    "hasMore": true,
    "limit": 50,
    "items": [
        {
            "id": "1585903",
            "code": "MEM123",
            "createdBy": 2,
            "dateOfBirth": "1968-04-06",
            "dobInterpretation": "E",
            "functionDynamicLogicId": 40,
            "gender": "F",
            "lastUpdatedBy": 2,
            "name": "Jane Doe",
            "objectLastUpdatedBy": 2,
            "objectVersionNumber": 1,
            "subtype": "PERS",
            "uuid": "33D6375103B730E6E0532332C40AE49A",
            "links": [
                {
                    "href": "http://[hostName]:[portNumber]/api/generic/persons/1585903",
                    "rel": "self"
                }
            ],
            "creationDate": {
                "value": "2015-03-17T14:42:58.199+01:00"
            },
            "lastUpdatedDate": {
                "value": "2015-03-17T14:42:58.199+01:00"
            },
            "objectLastUpdatedDate": {
                "value": "2015-03-17T14:42:58.199+01:00"
            },
            "functionDynamicLogic": {
                "id": "40",
                "links": [
                    {
                        "href": "http://[hostName]:[portNumber]/api/generic/dynamiclogic/40",
                        "rel": "canonical"
                    }
                ]
            },
            "language": {
                "id": "20",
                "links": [
                    {
                        "href": "http://[hostName]:[portNumber]/api/generic/languages/20",
                        "rel": "canonical"
                    }
            "addressList": [
                {
                    "id": "3",
                    "city": "NEW YORK",
                    "createdBy": 2,
                    "houseNumber": 10,
                    "lastUpdatedBy": 2,
                    "objectVersionNumber": 1,
                    "postalCode": "2300CL",
                    "startDate": "2009-01-01",
                    "street": "MAIN STREET",
                    "links": [
                        {
                            "href": "[hostName]:[portNumber]/api/generic/addresses/3",
                            "rel": "canonical"
                        }
                    ],
                    "creationDate": {
                        "value": "2010-04-07T14:55:35.719+02:00"
                    },
                    "lastUpdatedDate": {
                        "value": "2010-04-07T14:55:35.719+02:00"
                    },
                    "addressType": {
                        "id": "1",
                        "links": [
                            {
                                "href": "[hostName]:[portNumber]/api/generic/addresstypes/1",
                                "rel": "canonical"
                            }
                        ]
                    },
                  "links": [
                        {
                          "href": "http://[hostName]:[portNumber]/api/generic/persons/1" },
                          "rel": "self"
                        },
                        {
                          "href": "http://[hostName]:[portNumber]/api/generic/persons/2" },
                          "rel": "workingcopy"
                        }
                        ],
                    "country": {
                        "id": "2250",
                        "links": [
                            {
                                "href": "[hostName]:[portNumber]/api/generic/countries/2250",
                                "rel": "canonical"
                            }
                        ]
                    }
                }
            ]
        },
                ]
            }
        }
}

POST/PUT/PATCH

Insert/Update/Patch on persons have the following restrictions:

  • It is not possible to create a working copy person.

  • It is only possible to update an active person record when no working copy exists.

Expected Error Messages

Table 1. Expected Error Messages
Code Severity Message Description

REL-IP-PERS-001

Fatal

The person cannot be updated because a working copy exists.

Updates on active persons are only allowed when no working copy exists for that person.

REL-IP-PERS-002

Fatal

It is not possible to create or delete a working copy person.

Create or delete a working copy is not allowed through the person API.