Hi Guys,
Im trying to create a snippet where I pass the snippet variables into a JSON array.
Need some basic guidance.
My Snippet Call will be
[[!callSnippet? &fileLocation=`http://file.com`]]
Below is my attempt at the snippet. When executed it calls another class and sends an API request.
<?php
require_once("/class.php");
$fileLocation = isset($fileLocation)? $fileLocation : '';
$new_job = new ProcessJob('
{
"api_key": "xxxxxxxxxxxxxxxxx",
"input": "[color=red]$fileLocation[/color]",
"outputs": [
{
"label": "web"
}
]
}
');
The red part is currently failing and the variable isn’t going from the snippet to the Json.
Assistance appreciated....
Stuart