Rest ExecutePut
Use this command to put or update data to a resource using a restful HTTP PUT method. You may also use this command in conjunction with the REST GETRESPONSESTATUS command to retrieve additional information regarding the status of the request.
Syntax:
REST EXECUTEPUT url USING Source TO Target [Timeout]
where:
- url is the resource where the data will be put.
- Source is the data to put. Source can be a variable or a document name.
- Target is the variable or document that will contain the response.
- Timeout is the time to wait, in seconds, for the total request.
Syntax example:
CREATE VARIABLE TestPutResponse as String
CREATE VARIABLE TestPut as String
SET VARIABLE TestPut = "$MyRequest$"
REST EXECUTEPUT "https://jsonplaceholder.typicode.com/posts/1" USING TestPut TO TestPutResponse
EXPORTVARIABLE TestPutResponse TestPutResponse.xml
Using password attributes in REST EXECUTEPUT command
You can use password attributes to securely pass sensitive values in REST EXECUTEPUT commands. Reference a password attribute using this syntax:
[[Password,<system password attribute name>]]
For example, you could use this function in the REST body when connecting to an external REST API:
client_secret=[[Password,ASTestPassword]]
Password attributes are resolved server-side at execution time in two scenarios:
- Run using an event
- In batch mode when connected with a service account user
In both cases, the actual secret value is sent to the external endpoint without passing through the client, and password values are never exposed in client-facing output or logs.