
a.bab.u00002iq4TP.20220328134228 (Partner) asked a question.
Problem with inserting a "parameterized" header in the "REST Web Service" node of the workflow.
I need to contact an API via a REST call that requires a header (RSA_AUTHENTICATION_TOKEN: {123456..N}). However, this token is obtained from a previous API call. How can I insert the value I receive from the previous call into the header of the next REST call?
I try to retrive the {PublicData_RSA_AUTHENTICATION_TOKEN} from the Public scope of workflow, but something gone wrong.
What GL version are you using?
I understand the first screenshot.
Is the 2nd screenshot from header configuration of the REST node?
Do you see what is the error the 2nd REST node is failing with?
When you configure response variable as PUBLIC scope, you should reference the variable in the following manner: ${jobUserData_PUBLICDATA_testparam}
Hi,
yes the secondo screenshot is the insert of a parametrized header, like that. If I insert like that what value is filled in the header "RSA_AUTHENTICATION_TOKEN"? The variable associated with ${jobUserData_AuthToken} or the string "${jobUserData_AuthToken}". Is there a possibility to insert in a REST Web Service workflow tool, a parametrized header?
It should be the value which the variable holds.
I didn't test it, but it should be possible to use parameter in the header.
Did you test it, and it doesn't work?
I test it,
but i dont know how to debug it because I dont see the request after worflow is running. I’m assuming that it’s not working because the request should return a specific XML that I save in a response variable, but that variable is always empty, so it doesn’t return the expected value.
Do you know any tools or methods I can use to print the request I've done ?
I’ll add another piece of information: if I run the cURL command with the same data that I send through the web REST service, the cURL returns the correct value:
curl -vk -X POST -H 'content-type: application/xml' -H 'RSA_AUTHENTICATION_TOKEN:xxxxxx' -H 'Accept:*/*' -d '<mobileUserRequest email="test.test@mail"/>' http://api-endpoint-amis:8443/am8/mobile/user
I've just tested it on v8 P3 with this service - https://beeceptor.com/
Here is a simple workflow, with SQL Select node to initialize a parameter with value
A REST node to send an API to my end point, with a header that has a parameter
At the API's endpoint, I can see the header with a parameter being sent
To troubleshoot, enable DEBUG for the following 2 classes:
com.aveksa.server.workflow.scripts.nodes.RESTWebServiceNode
com.aveksa.server.workflow.webservices.rest.client.RestClient
You should see the following in the log:
03/26/2025 08:48:22.737 DEBUG (Worker_actionq#Normal#jdbc/avdb_7443) [com.aveksa.server.workflow.webservices.rest.client.RestClient] RestClient(Get): Header: key: CustomHeader, value: somevaluefortoke
Thank you so much! You’ve been incredibly helpful. I debugged my error, and it wasn’t in the variable but in the endpoint—I had mistakenly written the domain incorrectly.
Glad to hear you were able to resolve it.