Sync resource
Sync single user by external-system user identifier
To sync single user
POST /api/sync/user
Response: FinishedUserSyncResponse (subclass of ActionResponse)
FinishedUserSyncResponse:
{
responseType: "FinishedUserSyncResponse",
text: string,
items: ItemSyncResult[]
}
ItemSyncResult:
{
item?: LabeledIdentified,
way: string
}
LabeledIdentified:
{
id: string | number,
text: string
}
SyncWay:
"CREATE" | "CREATE_DRAFT" | "UPDATE" | "DELETE" | "SKIP"
Example 200
POST /api/sync/user HTTP/1.1
Content-Type: application/json; charset=UTF-8
Host: https://demo.kpsys.cz
{
"identifier": "ZAM1XYZ"
}
{
"text": "User synced with identifier ZAM1XYZ",
"responseType": "FinishedUserSyncResponse",
"finished": true,
"items": [{
"item": {
"id": 123456,
"text": "Jessica Alba"
},
"way": "CREATE"
}]
}
Fetch-only single user by external-system user identifier
To fetch single user
POST /api/sync/user/fetch
Response: FinishedUserFetchResponse (subclass of ActionResponse)
FinishedUserFetchResponse:
{
responseType: "FinishedUserFetchResponse",
text: string,
items: ItemFetchResult[]
}
ItemFetchResult:
{
item: UserEditationRequest
}
Example 200
POST /api/sync/user/fetch HTTP/1.1
Content-Type: application/json; charset=UTF-8
Host: https://demo.kpsys.cz
{
"identifier": "ZAM1XYZ"
}
{
"text": "User sync with identifier SCH0387",
"responseType": "FinishedUserFetchResponse",
"finished": true,
"items": [
{
"item": {
"id": 31230,
"active": false,
"readerAccounts": [
{
"readerCategory": {
"id": "IST",
"text": "Interní-student"
},
"cardNumber": "SCH0387",
"registrationDate": "2021-09-08T00:00:00+02:00",
"registrationExpirationDate": "9999-12-31T00:00:00+01:00"
}
],
"editorAccounts": null,
"emails": [
{
"value": "rostislav.schwarz.st@vsb.cz",
"source": {
"id": "external-unis",
"text": "Unis"
}
}
],
"phoneNumbers": [
{
"value": "+420734281136",
"smsCapable": true,
"source": {
"id": "external-unis",
"text": "Unis"
}
}
],
"addresses": [
{
"permanent": true,
"mailing": true,
"street": "Peškova 523/12",
"city": "Olomouc",
"state": "Česká republika",
"postalCode": "77900"
}
],
"username": null,
"readableDepartments": null,
"firstName": "Rostislav",
"lastName": "Schwarz",
"prefixDegree": null,
"suffixDegree": null,
"birthDate": "1988-03-09T00:00:00+01:00",
"guId": "SCH0387",
"netId": "SCH0387",
"openidId": null,
"bakalariId": "040449B2BC6380",
"edookitId": null,
"edupageId": null,
"jobName": null,
"jobAddress": null,
"educationLevel": "FEI / Fakulta elektrotechniky a informatiky",
"schoolClass": "K / B",
"identityCardNumber": null,
"kind": "PERSON"
}
}
]
}