Skip to main content

HTTP Request

Interact with any RESTful API by specifying the endpoint URL, selecting the desired HTTP method, including request headers (in JSON format), providing an optional request body, and optionally attaching a file.

Application

  • Generic REST API

Inputs (what you have)

NameDescriptionData TypeRequired?Example
EndpointThe URL of the API endpoint to access.URLYeshttps://api.example.com/users
MethodThe HTTP method to be used for the request.Predefined Choice ListYesGET
Request headersAdditional headers to include in the request in JSON format.Text (Long)No{"Content-Type": "application/json"}
Request bodyThe data to be included in the request body.Text (Long)No{"name": "John", "age": 25}
FileA file to be included in the request.FileNoexample.png

Note: the value of inputs can either be a set value in the configuration of the Wrk Action within the Wrkflow, or a variable from the Data library section. These variables in the Data library section are the outputs of previous Wrk Actions in the Wrkflow.

Outputs (what you get)

NameDescriptionData TypeRequiredExample
Response status codeThe HTTP status code returned in the response.IntegerRequired200
Response headersAdditional information provided in the response headers.Text (Long)OptionalContent-Type: application/json
Response bodyThe main content of the response.Text (Long)Optional{"message": "Success"}
Downloaded fileA file that is downloaded as part of the response.FileOptionalexample.pdf

Note: The "Fields to Capture" input feature can be used to create new outputs for the Wrk Action with the value of the corresponding key name in the first-level JSON output of the Wrk Action.

Example: If the "Response Body" output is equal to {"message": "Success"} Then you are able to add a "Fields to capture" input with the name "message" that will add an output to the Wrk Action called "message" which will have the value "Success"

Outcomes

NameDescription
SuccessThis status is selected in the event of that the API call returns with a status between 200-399
UnsuccessfulThis status is selected in the event of that the API call returns with a status of 400+
Impossible to CompleteThis status is selected in the event of the following scenario:Couldn't resolve hostname

Requirements

  • N/A