Use Cases
Native Action Use Cases
HTTP Requests
11 min
use http request native actions to get data from or send data to an api endpoint, even if the connector does not exist for the service this gives flexibility in integrating turbine with third party services scenario get users from slack max, a turbine admin, needs to verify a list of slack users via the slack api he uses the http request action to retrieve data from the api using a get request steps to set up a get http request select no authorization under the authentication tab enter the url https //api slack com/methods/users list on the settings tab, ensure that the enable ssl certificate verification toggle is on click apply it's a best practice for get requests to not include a request body conclusion max successfully retrieves the slack user list using the get method, without needing additional configuration scenario virustotal scan to upload a file max wants to scan a file using the virustotal api by sending a file from the playbook's attachments input here’s how he sets up a post request to virustotal using form data to send the file steps to set up a post request for virustotal select post from the request method drop down in the http request action on the authentication tab, select the api key radio button on the parameters tab, enter any key value pairs required by the api (for example, the api key) on the form data tab, enter the following in the key field, enter file , the field expected by the api click the value field and select expression enter the expression $inputs files to scan\[0] to retrieve the first file in the array of attachments ensure enable ssl certificate verification is on in the settings tab click apply conclusion max has successfully configured a post request to submit a specific file to virustotal for scanning scenario send a slack message max needs to send a message to a slack channel using the http request action the api requires a bearer token for authentication, and the message should be sent using a post request here’s how he sets this up steps to set up a post request for slack select post from the request method drop down in the http request action on the authentication tab, select the bearer token radio button on the parameters tab, enter the required key value pairs (e g , the channel name and message text) on the body tab, select the json option and enter the json payload { 	"channel" "#general", 	"text" "hello team, this is an automated message " } ensure enable ssl certificate verification is on in the settings tab click apply conclusion max has successfully configured the http action to send a message to a specified slack channel advanced scenario error handling and response processing handling api responses and errors is critical in production environments below is a generic process for max to handle errors and validate the responses from the api calls steps for response processing after the http request action, add a condition action to check the response status code if response\["statuscode"] equals 200 (success), continue processing the response data if not, add error handling logic like logging the failure or retrying the request to extract data from the response, use the extract property action response\["body"] data this would retrieve data from the api's response body handling errors if the api returns an error (e g , status code 4xx or 5xx), max can add error handling logic to log the error details send a notification or alert retry the http request if needed conclusion with this advanced setup, max can handle errors, validate api responses, and build more robust workflows using http request actions