REST API: delete
12.11.2022
262

Deletes a record via POST request

Deletes a record via POST request.

 

Arguments

table

 the table name.

action

 delete

editid1, editid2, editid3

 key column values

 

Sample request URL

curl -X POST "https://sureqrapp.nizamer.com/api/v1.php?table=falocation&action=delete&editid1=24"  


Sample request URL with multiple key columns:

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

 

Sample code

Delete a record from falocation table where key column value is 24.

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=falocation&action=delete&editid1=24",
 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 => "POST",
));
 
$response = curl_exec($curl);
 
curl_close($curl);
echo $response;
 
?>  


C# (RestSharp):

var client = new RestClient("https://sureqrapp.nizamer.com/api/v1.php?table=falocation&action=delete&editid1=24");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);


JavaScript (jQuery):

var settings = {
"url""https://sureqrapp.nizamer.com/api/v1.php?table=falocation&action=delete&editid1=24",
"method""POST",
"timeout": 0,
};
 
$.ajax(settings).done(function (response) {
 console.log(response);
});

 

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