Making a POST request via a button or anything

Hello,
I am trying to input something into 2 textboxes, click submit and send a POST request using that information and have the information retrieved from the server put into a small text box. To give a little background, this api is supposed to call from a criminal records system and bring back the information into the site, the textboxes would be the first name and last nameAny help is appreciated. Here is what I was provided from the API. I am open to any suggestions on how I could do this.

Thanks in advance,
Jonathan

Sample CURL Request

curl -d
‘{
“credentials”: {
“account_id”: “123456”,
“api_key”: “EGi5e7caJioM49lOXMANJZCoum”
},
“product”: “federal_criminal”,
“data”: {
“FirstName”: “Jack”,
“LastName”: “Graham”,
“MiddleName”: “A”,
“Limit”: 25
}
}’ https://api.imsasllc.com/v3/

Sample PHP Request

<?php function postJSON($data){ $url = 'https://api.imsasllc.com/v3/ '; $data_string = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); curl_close($ch); return $result; } $data=array(); $data['credentials']=array( 'account_id'=>'123456', 'api_key'=>'EGi5e7caJioM49lOXMANJZCoum' ); $data['product']='federal_criminal'; $data['data']=array( 'FirstName' => 'John', // search by first name 'John' 'LastName' => 'Smith', // search by last name 'Smith' 'MiddleName'=> 'A', // search by middle name 'A' 'Limit' => 25 // limit the number of results to 25 ); $json_response = postJSON($data); header('Content-type: application/json'); echo $json_response; ?>

Any ideas?

Have you tried the API Connector plugin?

You may need to add a header for “Content-type”, similar to the PHP request.

Did you ever figure out the curl request? I’m having a similar challenge