Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Use the admin account to call the Time off api to apply leave on behalf of the employee

raysun1
Member
0 Kudos

Hi all.

We are trying to use the administrator account to take out leave for an employee by calling the Time off api, but the status of the request is directly in the auto-approved status, and we want the request to be approved by the employee's supervisor, so how should we do?

The following is the request message:

curl --location
'https://api15.sapsf.cn/odata/v2/EmployeeTime?%24format=JSON' <br>--header 'Authorization: Basic xxxxxxxxxx'<br>--header 'Content-Type: application/json' <br>--data '{ "__metadata" : {
"uri" : "<a href="https://api15.sapsf.cn/odata/v2/EmployeeTime">https://api15.sapsf.cn/odata/v2/EmployeeTime</a>",
"type": "SFOData.EmployeeTime"}, "startDate":
"/Date(1687482000000)/", "endDate": "/Date(1687514400000)/",
"externalCode": "systemcode_1", "userIdNav": {
"__metadata": { "uri": "<a href="https://api15.sapsf.cn/odata/v2/User%28'/''user111'/''%29">https://api15.sapsf.cn/odata/v2/User('\''user111'\'')</a>",<br>"type": "SFOData.User" }}, "timeTypeNav": {
"__metadata": { "uri": "<a href="https://api15.sapsf.cn/odata/v2/TimeType%28'/''2000'/''%29">https://api15.sapsf.cn/odata/v2/TimeType('\''2000'\'')</a>",
"type": "SFOData.TimeType" } } }'
  • SAP Managed Tags:
1 REPLY 1

jsysel
Participant
0 Kudos

You are creating employee time entry directly, which is approved only. Based on my understanding there is no option to create time off entry with approval as of now.

  • SAP Managed Tags: