This operation returns employee photos as base64 encoded strings for one or more employees based on single or multi-key attributes such as personid
or a combination of AOID and COID values.
The associated Access Control Point is EMPLOYEE_PHOTO.
Example calls
The following example request payloads and their associated responses demonstrate the most common use cases.
Use case: two employees - single key retrieval
These example requests each use a single key to retrieve employee photo data for two employees. Note that modifiedSinceDateTime
is optional and is omitted from these examples.
Example request with personId
{
"where": {
"employees": {
"key": "personId",
"values": [
"5",
"6"
]
}
}
}
Example response with personId
[
{
"personIdentity": {
"personKey": 5
},
"photo": {
"image": "{base64Image}",
"imageType": "image/png",
"lastUpdateDateTime": "2018-04-22T15:45:26"
}
},
{
"personIdentity": {
"personKey": 6
},
"photo": {
"image": "{base64Image}",
"imageType": "image/png",
"lastUpdateDateTime": "2019-04-22T15:45:46"
}
}
]
Example request with personNumber
{
"where": {
"employees": {
"key": "personNumber",
"values": [
"SEANIVAN",
"GARRYIVAN"
]
}
}
}
Example response with personNumber
[
{
"personIdentity": {
"personNumber": "SEANIVAN",
"personKey": 5
},
"photo": {
"image": "{base64Image}",
"imageType": "image/png",
"lastUpdateDateTime": "2018-04-22T15:45:26"
}
},
{
"personIdentity": {
"personNumber": "GARRYIVAN",
"personKey": 6
},
"photo": {
"image": "{base64Image}",
"imageType": "image/png",
"lastUpdateDateTime": "2019-04-22T15:45:46"
}
}
]
Use case: two employees - single key retrieval with modifiedSinceDateTime
The example request below uses a single key to retrieve employee photo data for two employees. The request includes the optional modifiedSinceDateTime
property and discusses the particulars of response behavior for each returned employee.
Example single key request with modifiedSinceDateTime
{
"where": {
"employees": {
"key": "personId",
"values": [
"5",
"6"
]
}
},
"multiReadOptions": {
"modifiedSinceDateTime": "2019-01-22T15:45:26.000"
}
}
Example single key response with modifiedSinceDateTime
In the following example, the employee photo for personKey 5 (SEANIVAN) has not been updated since the date and time specified in the modifiedSinceDateTime
property, so the photo data is not returned in the response. However, note that the lastUpdateDateTime
of the person's photo record is still included in the response.
[
{
"personIdentity": {
"personKey": 5
},
"photo": {
"lastUpdateDateTime": "2018-04-22T15:45:26"
}
},
{
"personIdentity": {
"personKey": 6
},
"photo": {
"image": "{base64Image}",
"imageType": "image/png",
"lastUpdateDateTime": "2019-04-22T15:45:46"
}
}
]
Use case: two employees - multi-key retrieval with modifiedSinceDateTime
The example request below uses multiple keys (a pair of AOID and COID keys, which in this example are the same number) to retrieve employee photo data for two employees. The request includes the optional modifiedSinceDateTime
property and discusses the particulars of response behavior for each returned employee.
Example multi-key request with modifiedSinceDateTime
{
"where": {
"employees": {
"multi_key": [
"aoid",
"coid"
],
"multi_key_values": [
[
"444556",
"444556"
],
[
"90109",
"90109"
]
]
}
},
"multiReadOptions": {
"modifiedSinceDateTime": "2018-01-22T15:45:26.000"
}
}
Example multi-key response with modifiedSinceDateTime
In the following example, the employee photo for the person defined by aoid,coid=["444556","444556"]
does not exist, so the photo data and the lastUpdateDateTime
is not returned in the response. However, note that the lastUpdateDateTime
of the person's photo record would be included in the response if that person's photo existed but had been last updated prior to the date and time specified in the optional modifiedSinceDateTime
property.
[
{
"personIdentity": {
"personNumber": "90109",
"personKey": 266,
"aoid": "90109",
"coid": "90109"
},
"photo": {
"image": "{base64Image}",
"imageType": "image/png",
"lastUpdateDateTime": "2018-04-23T10:16:14"
}
},
{
"personIdentity": {
"personNumber": "444556",
"personKey": 1403,
"aoid": "444556",
"coid": "444556"
}
}
]