Thanks for your response Joey,
Here is what i have after following your conversation with someone else you were conversing with… but not working… In your conversation the other gentleman mentions the need for base 64 in the password… I don’t have any of that do I need to try that… Thanks
indent preformatted text by 4 spaces
<?php
// echo “This is basic-api.php
”;
// Documentation Disaster - #5 by adam.clark
$loginname = ‘???seopr_crm’; // Login name of your API user
$password = ‘???goZulu911@’; // This is the password of the API user
$siteurl = ‘???seopremium/Mautic/’;
$email = ‘???tom@cox.net’;
$firstname = ‘Tom’;
$lastname = ‘Chambers’;
$tag = ‘purchased’;
// This is our curl call:
$curl = curl_init();
// Set some options - we are passing in a user agent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => “https://” . $loginname . “:” . $password . “@” . $siteurl . “/api/contactsnew/”,
CURLOPT_USERAGENT => ‘Wesleys Secret App’,
CURLOPT_POST => 1,
// posting the payload
CURLOPT_POSTFIELDS => array(
‘firstname’ => ‘Mickey’,
‘lastname’ => ‘Mouse’,
‘email’ => ‘tobo@gogo.com’,
‘tags’ => ‘Purchased’
)
));
curl_exec($curl);
?>
To run this php gives a blank page output with absolutely nothing on it…
If I un-remark the line at the top // echo “This is basic-api.php
”; it prints that fine… so suggests there may not be any obvious php errors…
Note:Line 45 is this — ‘email’ => ‘tobo@gogo.com’,
Error shown in the php error logs.
[18-May-2021 19:06:40 UTC] PHP Parse error: syntax error, unexpected ‘https’ (T_STRING), expecting ‘;’ or ‘,’ in /home/idxseopremium/public_html/_test1/basic-api.php on line 45
<?php
// echo "This is basic-api.php<br>";
// https://forum.mautic.org/t/documentation-disaster/18201/5
$loginname = '???seopr_crm'; // Login name of your API user
$password = '???goZulu911@'; // This is the password of the API user
$siteurl = '???seopremium/Mautic/';
$email = '???tom@cox.net';`
Not sure what the https complaint is since the closest https is on line 32 not 45.
Line 32. Is the closest https
Line 45. ‘email’ => ‘tobo@gogo.com’,