REST API: view
12.11.2022
414

Returns a single record via GET request

Returns a single record via GET request.

 

Arguments

table

the table name.

action

view

editid1, editid2, editid3

 

Sample request URL

curl "https://sureqrapp.nizamer.com/api/v1.php?table=facategory&action=view&editid1=21"


Sample request URL with multiple key columns:

curl "https://sureqrapp.nizamer.com/api/v1.php?table=outward_letters&action=view&editid1=Cert-91264&editid2=45&editid3=1"

 

Sample response

{  
data: {  
date: "2022-11-05",  
letterno: "Cert-91264",
doctype: "1"
subject: "Certificate of Appreciation",  
to_org: "5002",  
from_person: "1007",  
to_person: "Andrew Jhon",  
outward_no: "367",  
uid: "5d27293ad87d4eb0551aca37079f8f304f624c093a0170165fecadde03d78c84",  
realqrcode: "http://sureqrapp.nizamer.com/doc_view.php?editid1=5d27293ad87d4eb0551aca37079f8f304f624c093a0170165fecadde03d78c84",  
userid: "45",  
qrpng: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG...",  
qrsvg: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS..."
},  
success: true  
}  

 

Sample code

This code retrieves the record with letterno=Cert-91264 and userid=45 from outward_letters table

PHP:

<?php

$headers = [
 'X-Auth-Token: f75sk32s29f5ag4j4s6z',
];

 

$curl = curl_init();
curl_setopt_array($curl, array(
 CURLOPT_URL => "https://sureqrapp.nizamer.com/api/v1.php?table=outward_letters&action=view&editid1=Cert-91264&editid2=45&editid3=1",
 CURLOPT_HTTPHEADER => $headers,
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_ENCODING => "",
 CURLOPT_MAXREDIRS => 10,
 CURLOPT_TIMEOUT => 0,
 CURLOPT_FOLLOWLOCATION => true,
 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>


C# (RestSharp):

  var client = new RestClient("https://sureqrapp.nizamer.com/api/v1.php?table=outward_letters&action=view&editid1=Cert-91264&editid2=45&editid3=1");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);


JavaScript (jQuery):

var settings = {
"url""https://sureqrapp.nizamer.com/api/v1.php?table=outward_letters&action=view&editid1=Cert-91264&editid2=45&editid3=1",
"method""GET",
"timeout": 0,
}; 
$.ajax(settings).done(function (response) {
console.log(response);
});

 

Was this article helpful?Yes (0)No (0)Thank you for your feedback!