Using connector shape response scripts
Introduction
How it works
<?php
/**
* Handler function.
*
* @param array $data [
* 'payload' => (string|null) the payload as a string|null
* 'variables' => (array[string]string) any variables as key/value
* 'meta' => (array[string]string) any meta as key/value
* 'flow' => (array[mixed]) current flow data, including variables
* 'response' => [
* 'headers' => ['Content-Type' => 'application/json', .......],
* 'body' => '....',
* 'status' => 200
* ]
* ]
*
* @return array $data Structure as above, plus 'logs' => (array[string]) Logs to be written to flow run log after script execution
*/
function handle($data)
{
return $data;
}Implementing a response script
Step 1: Write & deploy your response script
Response code
Value
Notes
Message
Example
Step 2: Apply the response script

Examples
Scenario 1
Scenario 2
Related pages
Last updated
Was this helpful?