Angel Posted December 16, 2017 Share Posted December 16, 2017 @einet I have an idea. You & I could make some documentation for the API Client Area you made (to make it easier for others to get started), and we could put up a GitHub repository for it so people can open issues and we can make it better. Quote Link to comment Share on other sites More sharing options...
mike Posted December 16, 2017 Share Posted December 16, 2017 10 hours ago, Angel said: @einet I have an idea. You & I could make some documentation for the API Client Area you made (to make it easier for others to get started), and we could put up a GitHub repository for it so people can open issues and we can make it better. I believe documentation already exist for what einet sent you. Quote Link to comment Share on other sites More sharing options...
weytar Posted December 16, 2017 Share Posted December 16, 2017 i want use mofh api Quote Link to comment Share on other sites More sharing options...
Angel Posted December 16, 2017 Share Posted December 16, 2017 6 hours ago, mike said: I believe documentation already exist for what einet sent you. Well, yes, but it's only one page telling you how to connect the API to the client. Quote Link to comment Share on other sites More sharing options...
einet Posted December 17, 2017 Share Posted December 17, 2017 On 15/12/2017 at 9:06 PM, Angel said: Puse el nombre de usuario y la contraseña de la API y lo cargué en mi sitio, Chrome devuelve un error de 500, ¿estoy haciendo algo mal? remember to use a PHP version 5.3 or higher in your test hosting to avoid code errors Quote Link to comment Share on other sites More sharing options...
einet Posted December 17, 2017 Share Posted December 17, 2017 15 hours ago, mike said: I believe documentation already exist for what einet sent you. @mike is right there is already a project created in GitHub only that the one that exists there does not include the complete script (composer) and its libraries and I would like to participate in such a project but I do not have free time Quote Link to comment Share on other sites More sharing options...
einet Posted December 17, 2017 Share Posted December 17, 2017 On 15/12/2017 at 0:21 AM, Hostingaj said: Hi. Can you send it to me too? My email is [email protected] Thx. sent message (Y) Quote Link to comment Share on other sites More sharing options...
einet Posted December 17, 2017 Share Posted December 17, 2017 13 hours ago, weytar said: i want use mofh api send me a private message with your email because I can not send mp in the forum I do not have permission Quote Link to comment Share on other sites More sharing options...
weytar Posted December 17, 2017 Share Posted December 17, 2017 mail : [email protected] Quote Link to comment Share on other sites More sharing options...
einet Posted December 21, 2017 Share Posted December 21, 2017 On 17/12/2017 at 4:38 AM, weytar said: mail : [email protected] you other email no found the server reboot message Message send to new email please load you email Quote Link to comment Share on other sites More sharing options...
weytar Posted December 21, 2017 Share Posted December 21, 2017 18 hours ago, einet said: you other email no found the server reboot message Message send to new email please load you email kararhosting.tk/panel not working ? Quote Link to comment Share on other sites More sharing options...
einet Posted December 28, 2017 Share Posted December 28, 2017 On 21/12/2017 at 3:02 PM, weytar said: kararhosting.tk/panel not working ? no you panel or empty no found Quote Link to comment Share on other sites More sharing options...
InfinityFree Posted December 29, 2017 Author Share Posted December 29, 2017 14 hours ago, PlanetCloud said: Hi, I've created the Client Area simmiliar to InfinityFree but a bit Noober because Im new with this but I don't know how to use the API Provided because I am not very experienced with PHP. All I need was someone to guide me to make the cPanel and Login stuff working because now It's just a templete. Also I need the API to be able to retrive user account. And @InfinityFree is the user account information was stored on iFastNet/Byte or on your own server? Thanks for your reply in advance The API doesn't really allow you to search or get information about accounts, so storing the account details in your own database is the only option IMO. There is no way to "retrieve" an account through the API, so you should probably store at least your own 8 character username and the host_12345678 username. Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 1 hour ago, PlanetCloud said: Hi, I keep getting this error : Parse error: syntax error, unexpected '-', expecting ',' or ';' in C:\wamp64\www\other-project\mofh-api\index.php on line 5 Can somebody help me out? My code : <?php require_once(vendor\autoload.php); use vendor\hansadema\mofh-client\src\Client.php; // Create a new API client with your API credentials. $client = Client::create([ 'apiUsername' => 'your_api_username', 'apiPassword' => 'your_api_password', 'plan' => 'my_plan', // Optional, you can define it here or define it with the createAccount call. ]); // Create a request object to create the request. $request = $client->createAccount([ 'username' => 'abcdefgh', // A unique, 8 character identifier of the account. 'password' => 'password123', // A password to login to the control panel, FTP and databases. 'domain' => 'userdomain.example.com', // Can be a subdomain or a custom domain. 'email' => '[email protected]', // The email address of the user. 'plan' => 'my_plan', // Optional, you can submit a hosting plan here or with the Client instantiation. ]); // Send the API request and keep the response. $response = $request->send(); // Check whether the request was successful. if ($response->isSuccessful()) { echo 'You can login as: ' . $response->getVpUsername(); } else { echo 'Failed to create account: ' . $response->getMessage(); } ?> try to use the one that I just sent to the email remember to read the instructions and that the php version of your localhost is 5.4 or higher Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 3 minutes ago, PlanetCloud said: Hi, I've tested your code and it gave me this error : oquei you placed your username and password of your client reseller in $ client = new \ HansAdema \ MofhClient \ Client ('API Username', 'API Password'); and you added the ip of the team where you are executing the script inside the folder there are some images and a txt with instructions Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 2 minutes ago, Hostingaj said: @einet ¿me puedes enviar el ejemplo también? [email protected] Gracias I can help you set up the api but you would have to look for a chat or where you can write them message send your email Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 10 minutes ago, Hostingaj said: Thanks, got the email. 16 minutes ago, einet said: oquei you placed your username and password of your client reseller in $ client = new \ HansAdema \ MofhClient \ Client ('API Username', 'API Password'); and you added the ip of the team where you are executing the script inside the folder there are some images and a txt with instructions Local test with the script working. In this case, testing if the google.com domain exists in my reseller server. Showing 1 indicates that the domain is available in my reseller server logically is to verify if a domain or sub domain of your reseller hosting exists or not a basic example. If you were able to perform this test without any error, indicate that the usename and password are well added remember to add the ip from where you are doing tests Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 2 minutes ago, PlanetCloud said: I added my API and Password also my IP. When I put it on my website, it shows ERROR 500https://api.planetcloudhosting.cf/mofh complete/mofh/?i=2 Why not? We could chat thru Email or WhatsApp if you wanted to update the php version from your hosting cpanel where you test a version higher than 5.4 eh sent another message to the indicated mail Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 1 minute ago, PlanetCloud said: PHP 7.0 still the same. How to check my server IP? Is it correct to Google "What Is My IP" for my computer? And is it correct to use Google Dig Tool to search "www.planetcloudhosting.cf" IP? if you are going to carry out local tests from your pc, you must indicate the ip of your computer, the one indicated by https://www.cualesmiip.com/ if you are going to execute the script from your web server, you must indicate the ip of your web server in the api reseller Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 10 minutes ago, einet said: if you are going to carry out local tests from your pc, you must indicate the ip of your computer, the one indicated by https://www.cualesmiip.com/ if you are going to execute the script from your web server, you must indicate the ip of your web server in the api reseller can also activate the error log in alter php config to see with more details the errors shown by the php when the ip is incorrectly configured shows the address from where the script is running on your hosting Quote Link to comment Share on other sites More sharing options...
mike Posted January 3, 2018 Share Posted January 3, 2018 I'm working on a non composer version, "simple" php. It's "working" , but I'm not finished, so anything could go wrong. Quote Link to comment Share on other sites More sharing options...
einet Posted January 3, 2018 Share Posted January 3, 2018 14 hours ago, PlanetCloud said: <?php include 'vendor/autoload.php'; // In [API username and API password] go the data of your reseller account that the data gives you here https://panel.myownfreehost.net/panel/index2.php?option=api $client = new \HansAdema\MofhClient\Client('ZbzVk5V3JxXnFK50tmB8reIBSSCir9UrdMwi', 'SFZb6XH4VW2Ii9SyIKQFq0bi0'); //example 1 domain exist? $domain = $_GET['domain']; // We check if the sub-domain is available echo $client->availability($domain); // Create a user account ('User8charactersmax', 'password','email','Domainorsub-domain','planName') //echo $client->createAccount('username8charmax', 'password', 'email', 'domainexample.com', 'plan_one'); // Suspend user account must be the same as example registry name ('username8charmax', 'Suspension message') //echo $client->suspend('username8charmax', 'Towards a test with a script in php'); // Change account password example('username8charmax', 'newpassword') //echo $client->password('username8charmax', '123456as'); // Reactivate account suspended Need only the example user name (username8charmax) //echo $client->unsuspend('username8charmax'); // One example live in create account //echo $client->createAccount('x3bugger', '123456asxl', '[email protected]', 'x3bugger.domain.com', 'standar'); That is my code (Of course I changed the Password and Username!. Do I need to modify anything?? if you have placed the user and password of your reseller api mas IP in the panel of the api reseller does not need to do anything else can perform tests with functions that are disabled with // for example: // echo $ client-> availability ($ domain); // echo $ client-> createAccount (''); // echo $ client-> suspend (''); // echo $ client-> password (''); // echo $ client-> unsuspend (''); // echo $ client-> createAccount (''); are the only ones you can use with the script uncheck the line you want to use since it is currently active is echo $ client-> availability ($ domain); to verify if a domain name exists in your reseller Quote Link to comment Share on other sites More sharing options...
einet Posted January 5, 2018 Share Posted January 5, 2018 17 hours ago, PlanetCloud said: De acuerdo, ¿cómo agregar el parámetro sobre qué dominio verificar? to verify a domain you can do it from a search form or by POST or GET method in the example that I add to verify the domain was by get in the url when ending like this? domaim = the examplenameofexample.com and in this case use the function $ client-> availability ($ domain); showing answer of 1 if the domain is available and 0 or nothing if it is already registered I will make a simpler example to make it easier Quote Link to comment Share on other sites More sharing options...
einet Posted January 5, 2018 Share Posted January 5, 2018 https://i.imgur.com/QUyxqx1.png Here I leave a clearer example to verify a domain with a form and the function plus the working library I remind you that the file should go next to the index since it requires the library that you spent last remember to add the user and pass of your reseller panel to the file that happened to them I apologize if I wrote with spelling errors and if my English is not understood ice a quick example THE FILE >> CHECK DOMAIN FILE Quote Link to comment Share on other sites More sharing options...
Angel Posted January 20, 2018 Share Posted January 20, 2018 Sorry to bother you again @einet, but I lost the API client download link. Could you resend it to me: [email protected] Quote Link to comment 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.