?
Solved

I can't connect to Resellerclub API

Posted on 2012-08-23
2
Medium Priority
?
2,479 Views
Last Modified: 2012-08-24
Hi,  I am trying to connect from a PHP script to Resellerclub.com API, but It display the following message:

"couldn't connect to host"

I have already read API guide, my Server IP  Address (virtual hosting with dedicated IP) is registered in Settings-> API -> Accessing the API, and I am running the script from my server. I test https://test.httpapi.com and https://httpapi.com but it not works.

My code is:

<?php

$url =
'https://test.httpapi.com/api/domains/search.json?auth-userid=111111&auth-password=mypass&no-of-records=10&page-no=1';
$ch = curl_init($url);

curl_exec($ch);

if(!curl_errno($ch))
{
 $info = curl_getinfo($ch);

 echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];
}
else
echo curl_error ($ch);
curl_close($ch);
?>

https://test.httpapi.com/api/domains/search.json?auth-userid=0&auth-password=password&no-of-records=10&page-no=1 

Please help me! Thanks
0
Comment
Question by:csimbana
2 Comments
 
LVL 35

Accepted Solution

by:
gr8gonzo earned 2000 total points
ID: 38328994
Sounds like you put the wrong IP into their system.

Create a script on your dedicated server that does this:

<?php
if(preg_match("/REMOTE_ADDR....td..td class=.v..([0-9\.]+)</",file_get_contents("http://hosting.iptcom.net/phpinfo.php"),$matches))
      echo "External IP: " . $matches[1];
else
      echo "IP not found!";
?>

...and run it once, and delete it afterwards (just a quick fix thing - you should only need it once and that script probably won't be usable forever).

The script should tell you your server's IP address that you should register with resellerclub.
0
 

Author Comment

by:csimbana
ID: 38329591
Yes, the problem was in the IP Address. I write in resellerclub control panel the main IP Address from my virtual hosting and connection is successful. Thanks
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Integration Management Part 2
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question