SAP Knowledge Base Article - Public

3388522 - How to configure the Clock In Clock Out REST API for Deletion of Time Events?

Symptom

You would like to know how to configure the Clock In Clock Out REST API for Deletion of Time Events.

Environment

SAP SuccessFactors Time Tracking – Clock In Clock Out

Resolution

To configure the Clock In Clock Out REST API for Deletion of Time Events, please consider the below steps as the documentation guide: REST API to Perform Mass Deletion of Time Events:

     

1. Create the API key to create the OAuth token

1.1 Registering Your OAuth2 Client Application

Go to 'Admin Center > Manage OAuth2 Client Applications' to create the OAuth2 Client Applications for the CICO REST API.
To fill the required entries, consider the below table and the documentation guide: Registering Your OAuth2 Client Application:

CompanyThe name of your company (SuccessFactorors Company ID)
Application NameA unique name of your OAuth client
DescriptionA description of your application (Optional)
API KeyInitially leave it as empty. It will be generated once the X.509 Certificate is created
Application URLAPI of your SuccessFactorors instance
Bind to UsersMark the flag
User IDsSuccessFactors user which will perform the deletion of the Time Events. Please do not use technical user TECHNICAL_USER_CICOTERMINAL_9D3F8AC1

      

Click in 'Generate X.509 Certificate', fill the Common Name(CN) as your SuccessFactorors Company ID, and click in 'Generate'. The API Key will be generated.

Click in 'Download', and save the Private Key (it will be needed later).

A sample configuration is shown as below:

      

1.2 Generating the API key

Open any API Platform (Postman, Insomnia, RapidAPI...), create one HTTP Request, and fill the Header Content-Type as 'application/x-www-form-urlencoded'.

To the HTTP Method and URI call refer to the below table:

HTTP MethodPOST
URI<API-SERVER-URL>/oauth/idp

    

In the payload Body, please consider:

client_idAPI Key in the OAuth Client Application under 'Admin Center > Manage OAuth2 Client Applications'
company_idThe name of your company (SuccessFactorors Company ID)
token_url<API-SERVER-URL>/oauth/token
private_keyPrivate Key under the 'BEGIN ENCRYPTED KEY' download in the X.509 Certificate
user_idSuccessFactors user which will perform the deletion of the Time Events. Please do not use technical user TECHNICAL_USER_CICOTERMINAL_9D3F8AC1

     

A sample configuration is shown as below:

          

2. Create the OAuth token

In the API Platform, create a new HTTP Request, and fill the Header Content-Type as 'application/x-www-form-urlencoded'.

To the HTTP Method and URI call refer to the below table:

HTTP MethodPOST
URI<API-SERVER-URL>/oauth/token

     

In the payload Body, please consider:

client_idAPI Key in the OAuth Client Application under 'Admin Center > Manage OAuth2 Client Applications'
company_idThe name of your company (SuccessFactorors Company ID)
grant_typeurn:ietf:params:oauth:grant-type:saml2-bearer
assertionAPI Key generated in step 1.2 above

     

A sample configuration is shown as below:

    

3. REST API to Perform Mass Deletion of Time Events

3.1 Permissions

Ensure that the user has the following permissions in 'Admin Center > Manage Permission Roles':

  • Administrator Permissions > Manage Clock In Clock Out > Delete Time Events created using Terminal
  • Administrator Permissions > Manage Clock In Clock Out > Delete Time Events created manually
  • Administrator Permissions > Manage Clock In Clock Out > Delete Time Events created using Clock Time

      

3.2 REST API to Delete Time Events

In the API Platform, create a new HTTP Request, and fill the Header Content-Type as 'application/merge-patch+json'.

To the HTTP Method and URI call refer to the below table:

HTTP MethodPATCH
URI<API-SERVER-URL>/rest/timemanagement/timeeventprocessing/clockinclockout/v1/timeevents

        

In the Bearer, fill it with the OAuth token generated in step 2 above.

    

   

In the payload Body, choose JSON format. This Body has two parameters: 

  • id --> Unique Time Event ID of the Time Event to be deleted.
  • deleted --> Defines if a Time Event should be deleted or not. Valid values are true or false. Set to true for deletion.

A sample call too delete two Time Events is as below: 

{
    "value": [
        {
            "id": "d0b5b4844cb94f518765741e3aae95e3",
            "deleted": true
        },
              {
            "id": "749737223b4a441397f68edf414b0626",
            "deleted": true
        }
    ]
}

   

3.3 Sample Scenario

Consider the below test case employee with the following Time Events, and Time Event IDs:

     

Execute the API Call via the configurated CICO REST API:

   

The Time Events were sucessefully deleted:

See Also

1. SAP Documentation Guide

Registering Your OAuth2 Client Application

REST API to Perform Mass Deletion of Time Events

REST API for Sending Time Events from Terminal to Clock In Clock Out

2. SAP KBAs

3145716 - OAuth Token got expired --> No more Time Events are integrated from the External Terminal to SAP SuccessFactors Clock In Clock Out

3146142 - Integration of API for SAP SuccessFactors Time Tracking Clock In Clock Out

Keywords

CICO, Clock In Clock Out, CICO REST API, REST API, API, Deletion of Time Events, Delete Time Events, Time Events, Deletion, Delete, Mass Deletion, Mass, REST API to Perform Mass Deletion of Time Events, API key, OAuth Token, Time Event ID, Permission, Delete Time Events created using Terminal, Delete Time Events created manually, Delete Time Events created using Clock Time, /rest/timemanagement/timeeventprocessing/clockinclockout/v1/timeevents, 2H 2023, b2311, TIM-39076. , KBA , LOD-SF-TTR-CIO , Clock In/ Clock Out , LOD-SF-TTR , Time Tracking , How To

Product

SAP SuccessFactors HCM Suite all versions ; SAP SuccessFactors Time Tracking all versions

Attachments

Pasted image.png
Pasted image.png