AOTG API: Delete Debtor: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 9:
==Code Snippets==
{{AOTGApiCodeSnippetTab
|PHPHttp=
<syntaxhighlight lang="PHP">
<?php
 
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Debtor/{[%21MzAwLUEwMDE%21]}');
$request->setMethod(HTTP_METH_DELETE);
 
$request->setHeaders(array(
'cache-control' => 'no-cache',
'SOTC_AUTH' => 'SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d'
));
 
try {
$response = $request->send();
 
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
</syntaxhighlight>
|RestSharp=
<syntaxhighlight lang="C#">
var client = new RestClient("http://aotg.cloud:8080/api/public/v1/Debtor/{[%21MzAwLUEwMDE%21]}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("SOTC_AUTH", "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d");
IRestResponse response = client.Execute(request);
</syntaxhighlight>
|PHPcURL=
<syntaxhighlight lang="PHP">
<?php
</syntaxhighlight>
 
|PHPHttp=
$curl = curl_init();
<syntaxhighlight lang="PHP">
 
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Debtor/{[%21MzAwLUEwMDE%21]}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"SOTC_AUTH: SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d",
"cache-control: no-cache"
),
));
 
$response = curl_exec($curl);
$err = curl_error($curl);
 
curl_close($curl);
 
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
</syntaxhighlight>
}}
 
===Response===
AOTG Cloud Server returns successful response when the request has been performed.<br/>
But this response does not indicate the status of the delete.<br/>
As such, use '''RESULT''' method to acquire the status.
====Response Successful HTTP Request====
200 OK
Line 26 ⟶ 82:
<syntaxhighlight lang="json-object">
{
"Id": "f0268032-c161-4548-a74a-adb7143274a6",
"Name": "DeleteDebtor",
"StartTimestamp": "2019-02-28T05:02:28.7462812Z",
"EndTimestamp": "2019-02-28T05:02:28.7462812Z"
}
</syntaxhighlight>
 
==Get Status of the DELETE==
 
===Response===
====Response Successful HTTP Request====