So i have a post CURL object and I keep getting an error when I pass a variable to it. When i hard code it in, the CURL post works just fine. What am I doing wrong? I know the variable is set, because when i echo it to the screen it displays the value.
$tVA = "false";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://xyzservice.com",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{
"folderName":"folder name 1028-1",
"templateIds":[54909],
"fields":
{
"VA":$tVA
},
The above code throws the error:
Trying to get property 'embeddedSigningSessions' of non-object
Trying to get property 'embeddedSessionURL' of non-object in
but when i hard code the value in, it works just fine. No errors.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://xyzservice.com",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{
"folderName":"folder name 1028-1",
"templateIds":[54909],
"fields":
{
"VA":"false"
},
The above works fine. Why isn't my variable working? Should I be wrapping it in something? I cant figure out why it will not allow me to pass a variable into the object. Thank you for any help.