SAP Knowledge Base Article - Public

3288045 - API UPSERT call to EmployeeTime

Symptom

You wish to know how to perform an isolated API call for the EmployeeTime object. This may be particularly relevant in automation scenarios, where a leave may need to be cancelled or approved from a 3rd party software outside SAP SuccessFactors.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors OData API

Cause

How-to

Resolution

1. SCENARIO: Rejected leave

Payload sample:

https://api68sales.successfactors.com/odata/v2/upsert

{
    "__metadata": {
        "uri": "EmployeeTime('0d111d2b8cf24208a2d8ff97091fcd25')",
        "type": "SFOData.EmployeeTime"
    },
 "externalCode": "0d111d2b8cf24208a2d8ff97091fcd25",
"approvalStatus": "REJECTED",
"endDate": "/Date(1444003200000)/",
"timeType": "SALARY_NOR",
"userId": "102034",
"startDate": "/Date(1444003200000)/"
  }




 

2. SCENARIO: Approved leave

Payload sample:

https://api68sales.successfactors.com/odata/v2/upsert

{
    "__metadata": {
        "uri": "EmployeeTime('0d111d2b8cf24208a2d8ff97091fcd25')",
        "type": "SFOData.EmployeeTime"
    },
 "externalCode": "0d111d2b8cf24208a2d8ff97091fcd25",
"approvalStatus": "APPROVED",
"endDate": "/Date(1444003200000)/",
"timeType": "SALARY_NOR",
"userId": "102034",
"startDate": "/Date(1444003200000)/"
  }
 
 
 
 

3. SCENARIO: Cancelled leave

Payload sample:

https://api68sales.successfactors.com/odata/v2/upsert

{
    "__metadata": {
        "uri": "EmployeeTime('0d111d2b8cf24208a2d8ff97091fcd25')",
        "type": "SFOData.EmployeeTime"
    },
 "externalCode": "0d111d2b8cf24208a2d8ff97091fcd25",
"approvalStatus": "CANCELLED",
"endDate": "/Date(1444003200000)/",
"timeType": "SALARY_NOR",
"userId": "102034",
"startDate": "/Date(1444003200000)/"
  }
 

See Also

SAP SuccessFactors HXM Suite OData API: Reference Guide (V2)

SAP SuccessFactors HXM Suite OData API: Developer Guide (V2)

Keywords

EmployeeTime, Employee Time, time, API, Odata API, odata, odata v2, v2, upsert, cancelled, rejected, approved, declined , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM Core all versions ; SAP SuccessFactors HCM Suite all versions