on ‎2021 Oct 15 12:27 AM
I have good bit of success with REST API calls using Python in the past but not able get a simple get request with basic auth working in Groovy. My final goal is to access Commission REST API from Advanced workflow.
Please share if you have a sample code snippet or point out what I am missing in my code snippet below (I ran variations the following script from my local machine with out much success)
Thanks in advance!
@Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.2')
import groovyx.net.http.RESTClient
RESTClient client = new RESTClient("https://XXXX.callidusondemand.com/api/v2/periods")
client.auth.basic "usename", "password"
// def path = "/api/v2/periods"
// def response
client.get(){ resp, data ->
println resp.status }
Request clarification before answering.
Hi Niranjan,
There is an example in the online documentation that should help: https://help.sap.com/viewer/b7cb13f8b6a04157a722ad9ddfde4a28/2110/en-US/72b1bf207c231014a804993ce404....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Niranjan,
I tried your scenario and here is some code to do so.
Configuration Params:

Util Code to make rest api calls: commissions-functions.txt
Calling Script : get-comm-period-data.txt
Regards, Ajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Niranjan,
Yes you have to maintain in custom parameters..
https://blogs.sap.com/2021/10/15/sap-commissions-rest-api-basic-authentication-from-sap-advanced-wor...
Best Regards, Ajit
sorry. I am not aware of that library. Try googling around that library and see how can it be used..
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.