Using rest plugin form

pkjoshi

Active Member
I am trying to use the form plugin rest, but getting a blank page.

I am using it for domain availability check.

the post request to be made is like this:
PHP:
https://testapi.internet.bs/Domain/Check?Domain=example.com&ApiKey=testapi&Password=testpass

and the request response I am getting like this:
HTML:
transactid=07d7f5fbd5070a66af8086a2c7d031c6 status=AVAILABLE domain=sambalpur.com minregperiod=1Y maxregperiod=10Y registrarlockallowed=YES privatewhoisallowed=YES realtimeregistration=YES
My setting are attached as image
domain_availability.JPG

rest_map_key.JPG
 
Testing this now.

I've not used the Rest plugin before, so this is a Voyage of Discovery for me too.

-- hugh
 
I'm not entirely sure the Rest plugin is what you need.

What are you trying to do? Simply find out if a given domain name is available or not?

-- hugh
 
the rest plugin is for sending post/put requests to a rest application so that it can insert data.

Here it looks like you want a validation on the element, that reminded me that I had already done something similar with Open Provider in fabrik 2.0. I've copied that code over to 3.0 and its now it the github repository - might be worth your while to take a look at that.
 
Thanks Rob,
I have downloaded the latest GITHUB and attempted to try the open provider plugin, but when I select the plugin - no options show up for the plugin and when I try to save it - it says - Please wait - still loading.
 
Rob,
Actually I am trying to check & register domain names through my website using domain registrar API.

I have also used php form plugin to check the domain, which works well in a stand alone php file.

The Json response which is shown from the php file is like this:
mywebsolutions.com status available classkey domcno

but nothing is shown as response when I am using the same code in php form plugin.

How can I show the response on the form page and store date from the response in the database.
Thanks.
 
The code I am using in the form plugin and stand alone php file for testing is like this

PHP:
$request = "";
$param['auth-userid'] = 'id';
$param['api-key'] = 'apikey';
$param['domain-name'] ='mywebsolutions';
$param['tlds']='com';
foreach ($param as $key => $val) {$request.= $key ."=".urlencode($val);    
$request .="&";}$request=substr($request,0,strlen($request)- 1 );
$url = "https://test.httpapi.com/api/domains/available.json?".$request;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, $true );
$result = curl_exec($ch); 
curl_close($ch);
 
Code:
[COLOR=#000000][COLOR=#0000BB]curl_setopt[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#0000BB]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]CURLOPT_RETURNTRANSFER[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$true [/COLOR][COLOR=#007700]);[/COLOR][/COLOR]
should be

Code:
[COLOR=#000000][COLOR=#0000BB]curl_setopt[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#0000BB]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]CURLOPT_RETURNTRANSFER[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]true [/COLOR][COLOR=#007700]);[/COLOR][/COLOR]

I would think.

but nothing is shown as response when I am using the same code in php form plugin.
Where would you want it to show? As the form redirects at the end of submission you will need to perhaps enqueue a message in the JApplication object.

How can I show the response on the form page .
Enque a message in the JApplication object:

Code:
$app = JFactory::getApplication();
$app->enqueuMessage('this is a test message');
I think its that anyway

and store date from the response in the database
theres examples of that on the wiki page for the form php plugin:
http://fabrikar.com/wiki/index.php/Form_plugin_php

-Rob
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top