POST attendance/setScheduledAction?Token={Token}

Scheduled action of the person can be stored to the system. Only already approved actions can be transferred. Application privilege "New" for licensed agenda "Requests" required. Functionality may also be restricted by record permission "Submitting requests" and "Approve requests" of agenda "Person".

Request Information

Authorization

  • Authorization by token required

Availability

  • Method can be used

URI Parameters

NameDescriptionTypeAdditional information
Token

The action is authorized by this token. Token should generated by calling action "POST login". Expiration time of each token is 20 seconds

globally unique identifier

Required

Body Parameters

AttendanceSetScheduledActionReq
NameDescriptionTypeAdditional information
PersonId

Unique identification of the person in the system. The scheduled action record is uniquely identified by "PersonId", "SalaryElementExtCode", "DateTo" and "DateFrom".

string

Required

String length: inclusive between 0 and 100

SalaryElementExtCode

The code of the salary elements in the external system. The same external code of the salary element has to be defined in the system as well. The scheduled action record is uniquely identified by "PersonId", "SalaryElementExtCode", "DateTo" and "DateFrom".

string

Required

String length: inclusive between 0 and 15

DateFrom

The begin (Date) of the scheduled action. The scheduled action record is uniquely identified by "PersonId", "SalaryElementExtCode", "DateTo" and "DateFrom". Only date is valid, time is ignored.

date

Required

Data type: Date

DateTo

The end (Date) of the scheduled action. The scheduled action record is uniquely identified by "PersonId", "SalaryElementExtCode", "DateTo" and "DateFrom". Only date is valid, time is ignored.

date

Required

Data type: Date

TimeFrom

The interval begin (Time) of the scheduled action. It is required parameter when parameter "ActionType" is set to "Interval" (value 3)

date

Data type: Time

TimeTo

The interval end (Time) of the scheduled action. It is required parameter when parameter "ActionType" is set to "Interval" (value 3)

date

Data type: Time

ApproverId

The unique identification of the approver in the system (The approver personal ID).

string

String length: inclusive between 0 and 100

ApprovalDate

The date of the approval

date

None.

Status

The status of the scheduled action. The meaning is : 0 - new; 1 - approved; 2 - waiting for cancel; 3 - reject; 4 - cancelled; 5 - deleted. Only status "approved" is supported in the request

integer

Required

Matching regular expression pattern: [1]

ActionType

The type of the scheduled action. The meaning is : 0 - day; 1 - half a day[begin]; 2 - half a day[end]; 3 - value; 5 - interval; 6 - maximal value; 7 - interval value; 8 - interval maximal value. Only "day", "half day[begin]", "half day[end]", value and interval types are supported. The action type can internally acquire values "maximal value", "interval value" and "interval maximal value" as well, but usage of them as WebAPI input parameters is not allowed.

integer

Required

Matching regular expression pattern: [0,1,2,3,5]

Text

The text of the request

string

String length: inclusive between 0 and 4000

Description

The description.

string

String length: inclusive between 0 and 4000

ValueDays

Value - Days

decimal number

None.

ValueTime

Value - Duration in minutes

integer

None.

IntervalBegin

Value - IntervalBegin (time in minutes since day begin. For example: time 08:00 is 480 minutes)

integer

None.

IntervalEnd

Value - IntervalEnd (time in minutes since day begin. For example: time 15:00 is 900 minutes)

integer

None.

InsertForEachDay

The scheduled action should by inserted for each day within requested time range. The meaning is : 0 - no; 1 - yes

integer

Matching regular expression pattern: [0,1]

Request Formats

application/json

Sample:
{"PersonId":"100200300","SalaryElementExtCode":"Holiday","DateFrom":"\/Date(1732147200000)\/","DateTo":"\/Date(1732320000000)\/","TimeFrom":"\/Date(-62135596800000)\/","TimeTo":"\/Date(-62135596800000)\/","ApproverId":"900900900","ApprovalDate":"\/Date(-62135596800000)\/","Status":1,"ActionType":0,"Text":"Private reasons","Description":null,"ValueDays":null,"ValueTime":null,"IntervalBegin":null,"IntervalEnd":null,"InsertForEachDay":0}

application/xml

Sample:

<Request>
  <PersonId>100200300</PersonId>
  <SalaryElementExtCode>Holiday</SalaryElementExtCode>
  <DateFrom>2024-11-21T00:00:00Z</DateFrom>
  <DateTo>2024-11-23T00:00:00Z</DateTo>
  <TimeFrom>0001-01-01T00:00:00</TimeFrom>
  <TimeTo>0001-01-01T00:00:00</TimeTo>
  <ApproverId>900900900</ApproverId>
  <ApprovalDate>0001-01-01T00:00:00</ApprovalDate>
  <Status>1</Status>
  <ActionType>0</ActionType>
  <Text>Private reasons</Text>
  <ValueDays d2p1:nil="true" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" />
  <ValueTime d2p1:nil="true" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" />
  <IntervalBegin d2p1:nil="true" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" />
  <IntervalEnd d2p1:nil="true" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" />
  <InsertForEachDay>0</InsertForEachDay>
</Request>

text/json

Sample:
{
  "PersonId": "sample string 1",
  "SalaryElementExtCode": "sample string 2",
  "DateFrom": "2024-11-21T12:34:51.1115455+01:00",
  "DateTo": "2024-11-21T12:34:51.1115455+01:00",
  "TimeFrom": "2024-11-21T12:34:51.1115455+01:00",
  "TimeTo": "2024-11-21T12:34:51.1115455+01:00",
  "ApproverId": "sample string 7",
  "ApprovalDate": "2024-11-21T12:34:51.1115455+01:00",
  "Status": 9,
  "ActionType": 10,
  "Text": "sample string 11",
  "Description": "sample string 12",
  "ValueDays": 1.1,
  "ValueTime": 1,
  "IntervalBegin": 1,
  "IntervalEnd": 1,
  "InsertForEachDay": 13
}

text/xml

Sample:
<Request xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <PersonId>sample string 1</PersonId>
  <SalaryElementExtCode>sample string 2</SalaryElementExtCode>
  <DateFrom>2024-11-21T12:34:51.1115455+01:00</DateFrom>
  <DateTo>2024-11-21T12:34:51.1115455+01:00</DateTo>
  <TimeFrom>2024-11-21T12:34:51.1115455+01:00</TimeFrom>
  <TimeTo>2024-11-21T12:34:51.1115455+01:00</TimeTo>
  <ApproverId>sample string 7</ApproverId>
  <ApprovalDate>2024-11-21T12:34:51.1115455+01:00</ApprovalDate>
  <Status>9</Status>
  <ActionType>10</ActionType>
  <Text>sample string 11</Text>
  <Description>sample string 12</Description>
  <ValueDays>1.1</ValueDays>
  <ValueTime>1</ValueTime>
  <IntervalBegin>1</IntervalBegin>
  <IntervalEnd>1</IntervalEnd>
  <InsertForEachDay>13</InsertForEachDay>
</Request>

Response Information

Response Codes

Http CodeError NumberDescription
200 request succesfully done 0 ScheduledAction for Person [{0}] stored successfully
400 bad request 1002 Entry parameter missing or parameter bindigs failed
401 unauthorized 1000 Token {0} not found
401 unauthorized 1001 Token {0} already expired
401 unauthorized 1006 Ip filter violated for ip client address [{0}]
401 unauthorized 1007 Ip filter [{0}] parsing failed
401 unauthorized 1008 Request rate policy violated for [{0}]
403 bad request 1126 Time interval is wrong
403 bad request 1128 Attendance Closing already done
403 bad request 1131 Already scheduled event for person [{0}] found
403 bad request 1134 No claim of scheduled action
403 bad request 1135 Some mandatory parameter value [ValueTime, ValueDate] missing.
404 required resource does not exist on the server 1100 PersonId [{0}] not found
404 required resource does not exist on the server 1125 No approver for personal Id[{0}] found
404 required resource does not exist on the server 1129 Working time model or salary element external code not found
404 required resource does not exist on the server 1130 Working days not found
415 unsupported Media Type The request entity has a media type which the server or resource does not support. Only application/json and application/xml are supported
500 internal error Server exception description

Resource Description

BaseRespOfAttendanceSetScheduledActionReq
NameDescriptionTypeAdditional information
Result

RequestResult

None.

Request

AttendanceSetScheduledActionReq

None.

Response Formats

application/json

Sample:
{"Result":{"Message":"Processed with result: ExecOK","Code":0,"ModelStateErr":null},"Request":{"PersonId":"100200300","SalaryElementExtCode":"Holiday","DateFrom":"\/Date(1732147200000)\/","DateTo":"\/Date(1732320000000)\/","TimeFrom":"\/Date(-62135596800000)\/","TimeTo":"\/Date(-62135596800000)\/","ApproverId":"900900900","ApprovalDate":"\/Date(-62135596800000)\/","Status":1,"ActionType":0,"Text":"Private reasons","Description":null,"ValueDays":null,"ValueTime":null,"IntervalBegin":null,"IntervalEnd":null,"InsertForEachDay":0}}

application/xml

Sample:

<Response>
  <Result>
    <Message>Processed with result: ExecOK</Message>
    <Code>0</Code>
  </Result>
  <Request>
    <PersonId>100200300</PersonId>
    <SalaryElementExtCode>Holiday</SalaryElementExtCode>
    <DateFrom>2024-11-21T00:00:00Z</DateFrom>
    <DateTo>2024-11-23T00:00:00Z</DateTo>
    <TimeFrom>0001-01-01T00:00:00</TimeFrom>
    <TimeTo>0001-01-01T00:00:00</TimeTo>
    <ApproverId>900900900</ApproverId>
    <ApprovalDate>0001-01-01T00:00:00</ApprovalDate>
    <Status>1</Status>
    <ActionType>0</ActionType>
    <Text>Private reasons</Text>
    <ValueDays d3p1:nil="true" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance" />
    <ValueTime d3p1:nil="true" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance" />
    <IntervalBegin d3p1:nil="true" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance" />
    <IntervalEnd d3p1:nil="true" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance" />
    <InsertForEachDay>0</InsertForEachDay>
  </Request>
</Response>

text/json

Sample:
{
  "Result": {
    "Message": "sample string 1",
    "Code": 2,
    "ModelStateErr": [
      "sample string 1",
      "sample string 2"
    ]
  },
  "Request": {
    "PersonId": "sample string 1",
    "SalaryElementExtCode": "sample string 2",
    "DateFrom": "2024-11-21T12:34:51.1427995+01:00",
    "DateTo": "2024-11-21T12:34:51.1427995+01:00",
    "TimeFrom": "2024-11-21T12:34:51.1427995+01:00",
    "TimeTo": "2024-11-21T12:34:51.1427995+01:00",
    "ApproverId": "sample string 7",
    "ApprovalDate": "2024-11-21T12:34:51.1427995+01:00",
    "Status": 9,
    "ActionType": 10,
    "Text": "sample string 11",
    "Description": "sample string 12",
    "ValueDays": 1.1,
    "ValueTime": 1,
    "IntervalBegin": 1,
    "IntervalEnd": 1,
    "InsertForEachDay": 13
  }
}

text/xml

Sample:
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Result>
    <Message>sample string 1</Message>
    <Code>2</Code>
    <ModelStateErr>
      <string>sample string 1</string>
      <string>sample string 2</string>
    </ModelStateErr>
  </Result>
  <Request>
    <PersonId>sample string 1</PersonId>
    <SalaryElementExtCode>sample string 2</SalaryElementExtCode>
    <DateFrom>2024-11-21T12:34:51.1427995+01:00</DateFrom>
    <DateTo>2024-11-21T12:34:51.1427995+01:00</DateTo>
    <TimeFrom>2024-11-21T12:34:51.1427995+01:00</TimeFrom>
    <TimeTo>2024-11-21T12:34:51.1427995+01:00</TimeTo>
    <ApproverId>sample string 7</ApproverId>
    <ApprovalDate>2024-11-21T12:34:51.1427995+01:00</ApprovalDate>
    <Status>9</Status>
    <ActionType>10</ActionType>
    <Text>sample string 11</Text>
    <Description>sample string 12</Description>
    <ValueDays>1.1</ValueDays>
    <ValueTime>1</ValueTime>
    <IntervalBegin>1</IntervalBegin>
    <IntervalEnd>1</IntervalEnd>
    <InsertForEachDay>13</InsertForEachDay>
  </Request>
</Response>