During SAP SuccessFactors Time Tracking implementation is very common to make some test on how an external terminal could work in integration with the time tracking module.One of the easiest ways we have found is through Postman.
Here is a step by step on how to send time events with Postman that is API platform.1. Go to “Manage OAuth2 Client Applications” transaction.
2. Then go to “Register Client Application” to create a new OAuth2 client.
A new screen like the below will appear, introduce the following values
Application Name: Introduce a label for you to identify this client in the client list
Application URL: https://api2preview.sapsf.eu/rest/timemanagement/timeeventprocessing/v1/TimeEvents
3. Go to Generate X.509 Certificate
A new screen will appear, insert a common Name. Any reference label.
a screen like the below will appears:
Select: “bind to Users”
Insert the Technical user: TECHNICAL_USER_CICOTERMINAL_9D3F8AC1
Ok, why this user?SfSf has pre-configured users for the OAuth authentication. This was something hard to crack for me, but if you want more info please refer to the following SAP Help |
5. Click Register
6. Copy the X.509 Certificate that you will need during the Postman configuration.
At this point, you have already downloaded an installed the Postman software.
A. In collections go to the pus icon and select “blank collection”
B. Select Authorization and “OAuth 2.0”
C. Into the Authorization tab set as follow.
D. In the side panel select the first request.
E. In the Headers tab insert:
Method: POST
URL: https://api2preview.sapsf.eu/oauth/idp
Content-Type : application/x-www-form-urlencoded
F. Go to the Body tab and insert the following values:
Client_id : here insert the API Key obtained in "Manage OAuth2 Client Applications"
Company_id: yours
User_id : TECHNICAL_USER_CICOTERMINAL_9D3F8AC1
token_url : https://api2preview.sapsf.eu/oauth/idp
private_key : The on e obtained in the X.509 Certificate in the “Manage OAuth2 Client Applications” SfSf transaction
grant_type : urn:ietf:params:oauth:grant-type:saml2-bearer
With these values make a POST call and as a result you Will obtain a Token that Will be used in the next call.
G. The next step is to change the service for https://api2preview.sapsf.eu/oauth/token and introduce a new key called “assertion” where is introduced the token of the previous call.
As a result is obtained a token to be used in the OAUTH call. This token spires in 24 hours.
The last step:
I recommend you to copy the request as shown below:
Then in the Headers tab, insert:
Authorization: Bearer “white space” and the token_oauth
Content-Type: application/json
Accept: application/json
Like below:
And in the Body Tab insert the following sentence
[ { "id": "1", "assignmentId": "USERID", "typeCode": "P10", "timestamp": "2024-01-18T08:00:21+02:00", "terminalId": "the string that represents the terminal (no validation for this value)", "timeTypeCode": "yours time type code" } ] |
As a result is obtained a message like below.
Hope this blog helps!
Special thanks to @daniel_villegas postman and integrations spec!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |