Technical Articles
SAP Commissions [Rest API] > Part 4 – How to call RestAPI v2 through Postman
Hi All,
Welcome to part 4 of this blog series that covers how to call RestAPI through PostMan. To understand how this call is been made with user access having Rest API role
please look into the first two parts of this series.
Part 1: How to create RestAPI role from SAP Commissions Portal
Part 2: How to assign RestAPI role to a user
Part 3: SAP Commission API Documentation Portal
Part 4: How to call RestAPI v2 through Postman
In this blog, we explain the possibilities of how to authenticate, consume Auth token and other endpoints
To Set Auth Type – Select Basic Authentication from User Administration in SAP Commissions
Pre-requisites to initiate
- SAP Commission Tenant
- Rest API Role Configured
- User Assigned with API role
- Postman
- Auth token to call other endpoints
List of API call methods available in Postman:
Fig 1: List of Methods
Step 1: Now, you will initiate the call to get the Auth Token
Request Method: POST
Request URL: https://<tenantid>.callidusondemand.com/CallidusPortal/services/v2/Tokenization/access_token
Refer below Fig2. User should update username and Password
Fig 2 User Authorization
Step 2: you have to update the JSON payload in the Body tab ( as shown in Fig 3)
{
"username": "ABCDEFH",
"password": "Password"
}
Fig 3: JSON Payload
Step 4: In the below screenshot, you will verify with updated values to make a call
Fig 4: follow the steps with a circled number to initiate a call to get the Auth token
Note: Auth token will expire after 60mins (1hr) from the time auth token is initiated
Now let’s make one endpoint call from referring API Documentation(Part 3) to see if the results are shown through retrieved auth token
Fig 5: JSON results are shown from the GET method call for Participant endpoint request URL
Conclusion: To make the RestAPI call, the user should have an API role and auth token for JSON results output. Users can make integration between any application using the above methods.
Developer/User can make use of the SAP API Business HUB for integrations as an API Management tool.
Hi Yogananda Muthaiah
thanks very much for this tutorial!
When calling the REST service /CallidusPortal/services/v2/Tokenization/access_token on our tenant I am receiving a "com.callidus.ws.exception.UserAuthenticationException" as response. I tried with other user too. Both have the role "RestAPIv2". I set the request headers "Authorization" and "Content-Type" according to the apiDoc. Do you have any advice?
Thanks & Regards
Christopher
Hi Chris,
You must have API role to your UserID
You can refer part 1 to 3 of SAP Commission RestAPI articles..
Hi Yogananda,
yes the user does have the API role "RestAPIv2" and also "RestAPI" as shown in the screenshot https://blogs.sap.com/wp-content/uploads/2020/05/2020-05-02_20-15-51.png. I created and assigned them before. What else might be causing the exception (HTTP Response 401)? In the documentation only responses "200 OK", "400 Bad request" and "406 Not Acceptable" are mentioned.
It might be user is created in User Administration not through Commissions > User Workspace
Hi Yogananda Muthaiah,
Just reviewing the Basic Auth vs Bearer tokens situation, and my team are wondering of the pros and cons between the two specifically for the SAP Commissions product. Are you able to elaborate please?
EDIT: I've just seen your fresh article on JWT, no need for a reply for now... I will review that... I think this is better than the bearer token stuff listed above.