awdrifter Posted May 3, 2011 Share Posted May 3, 2011 I'm doing a school project, and basically I'm trying to get these APIs to work. What I need is to when a customer fills out a form on my website, their email is automatically added to the contact list on BenchmarkEmail. ttp://www.benchmarkemail.com/API/Examples I tried to edit their sample code with my account info and just running the php file, just to see if it'll add the email address to the contact list. But I couldn't get it to work. Any help or links to may some better samples would help. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/235459-need-some-help-with-api-newb-questions/ Share on other sites More sharing options...
cssfreakie Posted May 3, 2011 Share Posted May 3, 2011 this is not a html question. moving to this to "Other Libraries and Frameworks". btw, show us what you tried, it might very well help, solve what you mean with "not working" Quote Link to comment https://forums.phpfreaks.com/topic/235459-need-some-help-with-api-newb-questions/#findComment-1210144 Share on other sites More sharing options...
awdrifter Posted May 4, 2011 Author Share Posted May 4, 2011 I tried to do some trouble shooting by myself, I got down to basically it's not able to connect to their API for some reason. Here's the simplest simple code I've found on their website, it's just getting a token. But when I ran it I got a blank screen, no error code, not even the "Your Token Is:" text. I have Xampp installed btw, which should have all the PHP stuff required. http://www.benchmarkemail.com/API/Start/Login <?php /** * * This Example shows how to authenticate a user using XML-RPC. * Note that we are using the PEAR XML-RPC client and recommend others do as well. */ require_once 'XML/RPC2/Client.php'; // Account Settings $USERNAME = 'my actual username'; $PASSWORD = 'my actual password'; $API_URL = 'http://api.benchmarkemail.com/1.0'; try { // Create the XML RPC Object $client = XML_RPC2_Client::create($API_URL); // Authenticate the user $token = $client->login($USERNAME, $PASSWORD); // Print the token echo "Your Token is :" . $token; } catch (XML_RPC2_FaultException $e){ echo "ERROR:" . $e->getFaultString() ."(" . $e->getFaultCode(). ")"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/235459-need-some-help-with-api-newb-questions/#findComment-1210201 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.