# Is anyone willing to share a template to allow me to communicate with the Mautic APi for $100?

**URL:** <https://forum.mautic.org/t/is-anyone-willing-to-share-a-template-to-allow-me-to-communicate-with-the-mautic-api-for-100/19473>\
**Category:** Commercial\
**Created:** [May 16, 2021, 4:02am UTC](https://forum.mautic.org/t/is-anyone-willing-to-share-a-template-to-allow-me-to-communicate-with-the-mautic-api-for-100/19473 "2021-05-16T04:02:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tommytx123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tommytx123/32/833_2.png) [@tommytx123](https://forum.mautic.org/u/tommytx123)\
**Post date:** [May 18, 2021, 7:43pm UTC](https://forum.mautic.org/t/is-anyone-willing-to-share-a-template-to-allow-me-to-communicate-with-the-mautic-api-for-100/19473/4 "2021-05-18T19:43:28Z")

</div>

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](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’;  
$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’,

---

_[View the full topic](https://forum.mautic.org/t/is-anyone-willing-to-share-a-template-to-allow-me-to-communicate-with-the-mautic-api-for-100/19473)._
