Interface overview
The web service is used to start an event in Nepton.
The web service is designed to be used in terminal applications. All events started through the web service are recorded as clocked events.
Authentication in the web service differs from other web services in that a person who has successfully authenticated with a username and password can authenticate as another person based on a PIN code or RFID code. In the first step, the authenticated person must have the rights to view personal data. For example:
<CallerAuthentication> <CustomerId>1234</CustomerId> <Username>PäätelaiteKäyttäjä</Username> <Password>KuvitteellinenSalasana123</Password> <PinCode>1234</PinCode> <!-- PIN code given on the terminal --> </CallerAuthentication>
If the person cannot be found with the provided PIN code or RFID code, authentication will fail.
The WSDL schema of the web service is publicly available here. The interfaces are described in general here.
The occurrences column in the description determines whether a piece of information is mandatory in the call or not. Occurrences 0 means that the information in question does not need to be passed in the call. Occurrences 1 means that the information must appear once in the call. Occurrences 0..n means that the information in question can appear any number of times in the call. Occurrences 1..n means that the information in question must appear in the data at least once, but can appear more often.
Changes from the previous version (BeginActivity)
Structural changes
| Old | New | Additional info |
<tyo:ParametersForBeginActivity> |
<tyo:ParametersForBeginActivityV2> |
The name of the call root element has changed. |
<tyo:ReturnValueForBeginActivity> |
<tyo:ReturnValueForBeginActivityV2> |
The name of the response root element has changed. |
<StartedActivity> |
<StartedActivity> |
|
Obsolete elements
The following elements were previously in the response twice, first under the Activity element and the second time under the PlannedWorkDetails element:
-
PlannedWorkCalculationUnit
-
PlannedWorkColor
-
PlannedWorkUseForWorkDayLengthCalculations
-
PlannedWorkCanBeCancelledUntil
-
PlannedWorkWorkTimeLimitOffsetStartInMins
-
PlannedWorkWorkTimeLimitOffsetEndInMins
-
PlannedWorkActivityGroupPublicInfo
From now on, these elements will only be found under the PlannedWorkDetails element.
RelatedActivityId was already reported as deprecated in the previous version, but now this element has been technically removed from the response.
New features and elements
-
Possibility to define external identifiers to events
-
Added ExternalIdentifiers element to the call
- Added ExternalIdentifiers element to the response
-
- Response includes information about person's personnel number
- Added UserPersonnelNumber element
- Response includes information about approver's personnel number
- Added ApproverPersonnelNumber element
Sent data
|
LEVEL |
FIELD NAME |
FORMAT |
OCCURRENCES |
DESCRIPTION |
|---|---|---|---|---|
|
0 |
ParametersForBeginActivityV2 |
XML element |
1 |
Root element, |
|
1 |
CallerAuthentication |
XML element |
1 |
More information about authentications here. |
|
1 |
ActivityTypeId |
integer |
1 |
The Nepton identifier of the event type to be started. The list of event types can be read via the API. More info here. |
|
1 |
BeginDateTime |
datetime |
0..1 |
The start date and time of the event type to be started. Data given in form If this data is not given, the event will start at current time. |
|
1 |
EndDateTime |
datetime |
0..1 |
The end date and time of the event. Data given in format Not mandatory. The event can be ended via another method. |
|
1 |
TerminalId |
integer |
0..1 |
Terminal identifier. Any identifier can be used, as long as the identifiers are integers. |
|
1 |
Comment |
string |
0..1 |
Any comments for events. |
|
1 |
OvertimeBasePartTargetedTo |
string |
0..1 |
Accrual, where overtime base part is being directed to. See possible values here. |
|
1 |
OvertimeIncrementPartTargetedTo |
string |
0..1 |
Accrual, where overtime increment part is being directed to. See possible values here. |
|
1 |
RelatedProjects |
XML element |
0..1 |
Projects to be registered for the event. |
|
2 |
ActivityToProjectRelation |
XML element |
0..n |
|
|
3 |
Id |
integer |
0..1 |
The unique identifier of the project in Nepton. The unique identifier of the project or project code must be provided. |
|
3 |
Duration |
integer |
0..1 |
Project duration in minutes. |
|
3 |
Name |
string |
0..1 |
Project name. Data is not used. |
|
3 |
Code |
string |
0..1 |
Project code. The unique identifier of the project or project code must be provided. |
|
1 |
WorkIncrements |
XML element |
0..1 |
Supplements to be added to the event. |
|
2 |
WorkIncrement |
XML element |
0..n |
|
|
3 |
Index |
integer |
1 |
Index of supplement |
|
3 |
Value |
decimal |
1 |
Supplement value in minutes, units or decimals. |
|
1 |
ExternalIdentifiers |
XML element |
0..1 |
External identifiers given to the event |
|
2 |
ExternalIdentifier |
XML element |
1..n |
External identifier given to the event |
|
3 |
Identifier |
string |
1 |
External identifier |
|
3 |
IdentifierType |
string |
1 |
Type of external identifier. The only supported type at the moment is |
Call example
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tyo="http://tyoaika.tyoteho.fi">
<soapenv:Header/>
<soapenv:Body>
<tyo:ParametersForBeginActivityV2>
<CallerAuthentication /> <!-- Authentication is needed, but left out on this example -->
<ActivityTypeId>1</ActivityTypeId>
<BeginDateTime>2021-05-28T07:35:34</BeginDateTime>
<TerminalId>418</TerminalId>
<ExternalIdentifiers>
<ExternalIdentifier>
<Identifier>ae2f6c97-104f-49e4-9cff-70951f00234e</Identifier>
<IdentifierType>External</IdentifierType>
</ExternalIdentifier>
</ExternalIdentifiers>
</tyo:ParametersForBeginActivityV2>
</soapenv:Body>
</soapenv:Envelope>
Response
|
LEVEL |
FIELD NAME |
FORMAT |
OCCURRENCES |
DESCRIPTION |
|---|---|---|---|---|
|
0 |
ReturnValueForBeginActivityV2 |
XML element |
1 |
Root element, |
|
1 |
ResponseCode |
integer |
1 |
Processing result code. Possible codes can be found here. |
|
1 |
ResponseString |
string |
0..1 |
Code description |
|
1 |
UserId |
integer |
0..1 |
Nepton ID of the authenticated person |
|
1 |
CustomerId |
integer |
0..1 |
Deployment's worktime customer ID (from Nepton) |
|
1 |
Locale |
string |
0..1 |
User's language. See supported languages and their codes here. |
|
1 |
StartedActivity |
XML element |
0..1 |
Information of the started event. |
|
2 |
Id |
integer |
0..1 |
Unique event identifier in Nepton |
|
2 |
UserId |
integer |
0..1 |
A unique identifier for a person in Nepton. (The person who has the event) |
|
2 |
UserFirstName |
string |
0..1 |
Person's first name. (The person who has the event) |
|
2 |
UserLastName |
string |
0..1 |
Person's last name. (The person who has the event) |
|
2 |
UserUsername |
string |
0..1 |
Person's userame. (The person who has the event) |
|
2 |
UserPersonnelNumber |
string |
0..1 |
Person's personnel number. (The person who has the event) |
|
2 |
UserSocialSecurityNumber |
string |
0..1 |
Person's social security number. (The person who has the event) |
|
2 |
ActivityTypeId |
integer |
0..1 |
Unique identifier of the event type in Nepton. |
|
2 |
ActivityTypeName |
string |
0..1 |
Event type name. |
|
2 |
ActivityTypeCategoryId |
string |
0..1 |
Event type category unique identifier in Nepton. |
|
2 |
ActivityTypeCategoryName |
string |
0..1 |
Event type category name |
|
2 |
ApproverUserId |
integer |
0..1 |
Person who has approved the event. Reference by user ID. |
|
2 |
ApproverFirstName |
string |
0..1 |
The first name of the person who has approved the event. |
|
2 |
ApproverLastName |
string |
0..1 |
The last name of the person who has approved the event. |
|
2 |
ApproverPersonnelNumber |
string |
0..1 |
The personnel number of the person who has approved the event. |
|
2 |
BeginDateTime |
dateTime |
0..1 |
The start date and time of the event. Format is |
|
2 |
EndDateTime |
dateTime |
0..1 |
The end date and time of the event. Format is |
|
2 |
ModifiedDateTime |
dateTime |
0..1 |
The time the event was last modified. The format is |
|
2 |
ModifiedByUserId |
integer |
0..1 |
User ID of the user who last modified the event. |
|
2 |
ModifiedFromIp |
string |
0..1 |
The IP-address from where the event was last modified from. |
|
2 |
Comment |
string |
0..1 |
Comments on the event. |
|
2 |
IsClockedEvent |
boolean |
0..1 |
Is the event clocked ( |
|
2 |
IsCreatedWithPinCode |
boolean |
0..1 |
Is the event clocked with PIN code ( |
|
2 |
OvertimeBasePartTargetedTo |
string |
0..1 |
Overtime base part target for the event. |
|
2 |
OvertimeIncrementPartTargetedTo |
string |
0..1 |
Overtime increment part target for the event. |
|
2 |
RelatedProjects |
XML element |
0..1 |
Projects on the event. |
|
3 |
ActivityToProjectRelation |
XML element |
0..n |
|
|
4 |
Id |
integer |
0..1 |
Project unique identifier in Nepton |
|
4 |
Duration |
integer |
0..1 |
Project duration in minutes. |
|
4 |
Name |
string |
0..1 |
Project name |
|
4 |
Code |
string |
0..1 |
Project code |
|
2 |
WorkIncrements |
XML element |
0..1 |
Supplements on the event. |
|
3 |
WorkIncrement |
XML element |
0..n |
|
|
4 |
Index |
integer |
1 |
Supplement index |
|
4 |
Value |
decimal |
1 |
Supplement value in minutes, units, or decimals. |
|
2 |
ActivityDetails |
XML element |
0..1 |
Additional information on the event |
|
3 |
AbsenceDetails |
XML element |
0..1 |
Additional information on the absence |
|
4 |
CompensationTypeId |
integer |
0..1 |
Absence compensation type identifier. Possible values:
|
|
4 |
CompensationTypeName |
string |
0..1 |
Absence compensation type name |
|
4 |
EarnsVacationDays |
boolean |
0..1 |
Does the absence accumulate annual holiday ( |
|
4 |
AbsenceTypeId |
integer |
0..1 |
Absence identifier. Absence types can be found in Worktime > Working community settings > Work hours > Absence types. |
|
4 |
AbsenceTypeName |
string |
0..1 |
Absence type name |
|
3 |
PlannedWorkDetails |
XML element |
0..1 |
Additional details for planned work shift |
|
4 |
PlannedWorkCalculationUnitBeginActivity |
string |
0..1 |
Calculation unit of the work shift location. Read more here. |
|
4 |
PlannedWorkColor |
string |
0..1 |
The color of the planning level of the work shift location. The color can be set in Shift Planning: Locations > Select planning level > Planning level settings > Planning level color. |
|
4 |
PlannedWorkUseForWorkDayLengthCalculations |
boolean |
0..1 |
Does workday length come from shift ( |
|
4 |
PlannedWorkCanBeCancelledUntil |
string |
0..1 |
Date and time, until which the shift need can be cancelled. Format is |
|
4 |
PlannedWorkWorkTimeLimitOffsetStartInMins |
integer |
0..1 |
The time offset in minutes for the allowed work start time from the work shift. The value is added to the event start time used to set the allowed work start time. A value of zero sets the allowed work start time as the event start time. |
|
4 |
PlannedWorkWorkTimeLimitOffsetEndInMins |
integer |
0..1 |
The time offset in minutes for the allowed work end time from the work shift. The value is added to the event end time used to set the allowed work end time. A value of zero sets the allowed work end time as the event end time. |
|
4 |
AssumedLunchInMinutes |
integer |
0..1 |
The length of the assumed lunch break from work shift in minutes. |
|
4 |
PlannedWorkActivityGroupPublicInfo |
string |
0..1 |
Public information given to shift group information |
|
3 |
SickLeaveDetails |
XML element |
0..1 |
Sick leave details |
|
4 |
CompensationTypeId |
integer |
0..1 |
Identifier of the sick leave compensation type. Possible values:
|
|
4 |
CompensationTypeName |
string |
0..1 |
Sick leave compensation type name |
|
4 |
EarnsVacationDays |
boolean |
0..1 |
Does absence earn vacation days ( |
|
4 |
SickLeaveTypeId |
integer |
0..1 |
Identifier of the sick leave type. Possible values:
|
|
4 |
SickLeaveTypeName |
string |
0..1 |
Sick leave type name |
|
4 |
MedicalCertificateGiven |
boolean |
0..1 |
If medical certificate has been given ( |
|
4 |
SupervisorsPermission |
boolean |
0..1 |
If supervisor has approved the sick leave instead of medical certificate ( |
|
4 |
ReasonCode |
string |
0..1 |
Reason code for sick leave |
|
2 |
ExternalIdentifiers |
XML element |
0..1 |
External identifiers for the event |
|
3 |
ExternalIdentifier |
XML element |
1..n |
External identifier for the event |
|
4 |
Identifier |
string |
1 |
External identifier |
|
4 |
IdentifierType |
string |
1 |
External identifier type. At the moment the only supported type is |
|
2 |
IsDeleted |
boolean |
0..1 |
Is the event deleted ( |
|
1 |
AccrualList |
XML element |
0..1 |
A list of accruals and their values |
|
2 |
Accrual |
XML element |
0..n |
|
|
3 |
InternalName |
string |
1 |
Name used as an identifier for the accrual |
|
3 |
Name |
string |
1 |
Accrual name |
|
3 |
Amount |
string |
1 |
Accrual value in hours and minutes, for example |
|
3 |
ChangeAmount |
string |
0..1 |
How much the value of the accrual has changed on the current day. Value in hours and minutes, for example |
|
1 |
CurrentDateTimeUTC |
dateTime |
1 |
The current time in the UTC time zone. Format is |
Response example
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tyoaika.tyoteho.fi">
<SOAP-ENV:Body>
<ns1:ReturnValueForBeginActivityV2>
<ResponseCode>1000</ResponseCode>
<ResponseString>All clear. No errors.</ResponseString>
<UserId>123456</UserId>
<CustomerId>1234</CustomerId>
<Locale>fi_FI</Locale>
<StartedActivity>
<Id>12345678</Id>
<UserId>123456</UserId>
<UserFirstName>Maija</UserFirstName>
<UserLastName>Meikäläinen</UserLastName>
<UserUsername>maija.meikäläinen</UserUsername>
<UserPersonnelNumber>1111</UserPersonnelNumber>
<ActivityTypeId>1</ActivityTypeId>
<ActivityTypeName>Työ</ActivityTypeName>
<ActivityTypeCategoryId>1</ActivityTypeCategoryId>
<ActivityTypeCategoryName>Työ</ActivityTypeCategoryName>
<BeginDateTime>2021-01-20T09:12:23</BeginDateTime>
<ModifiedDateTime>2021-01-20T09:12:23</ModifiedDateTime>
<ModifiedByUserId>123456</ModifiedByUserId>
<ModifiedFromIp>127.0.0.1</ModifiedFromIp>
<IsClockedEvent>true</IsClockedEvent>
<IsCreatedWithPinCode>false</IsCreatedWithPinCode>
<OvertimeBasePartTargetedTo>balance</OvertimeBasePartTargetedTo>
<OvertimeIncrementPartTargetedTo>uncompensated</OvertimeIncrementPartTargetedTo>
<IsDeleted>false</IsDeleted>
</StartedActivity>
<AccrualList>
<Accrual>
<InternalName>balance</InternalName>
<Name>Saldo</Name>
<Amount>12:32</Amount>
</Accrual>
</AccrualList>
<CurrentDateTimeUTC>2021-01-20T06:12:23</CurrentDateTimeUTC>
</ns1:ReturnValueForBeginActivityV2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>