AOTG API: Delete Debtor: Difference between revisions

No edit summary
Line 179:
 
 
==GetUse RESULT method to get the failed reason of DELETE request==
 
{{AOTGApiCodeSnippetTab
|PHPHttp=
<syntaxhighlight lang="PHP">
<?php
 
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Result/DeleteDebtor/f0268032-c161-4548-a74a-adb7143274a6/result');
$request->setMethod(HTTP_METH_GET);
 
$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/Result/DeleteDebtor/f0268032-c161-4548-a74a-adb7143274a6/result");
var request = new RestRequest(Method.GET);
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>
}}
 
$curl = curl_init();
 
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Result/DeleteDebtor/f0268032-c161-4548-a74a-adb7143274a6/result",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
====Response Successful HTTP Request====
200 OK
====Response Successful Body====
<syntaxhighlight lang="json-object">
{
"RequestId": "87e028c2-f9f1-40ef-8b76-e3fd82d298ae",
"Status": "Completed"
}
</syntaxhighlight>
}}
 
===Response Successful from HTTP RESULT===
====Response Successful HTTP Request====
200 OK
====Response Successfulof Body=Failed reason===
====Debtor record not found====
<syntaxhighlight lang="json-object">
{
"RequestId": "11eaf086-6f26-4f47-9352-6b72b94fe320",
"Status": "Failed"
</syntaxhighlight>
 
===Use Result to find reason of failed===
 
{
"RequestId": "11eaf086-6f26-4f47-9352-6b72b94fe320",
Line 243 ⟶ 271:
"ResultFileURL": null
}
</syntaxhighlight>
 
====Account in use, can't delete debtor====
 
<syntaxhighlight lang="json-object">
 
 
{
"RequestId": "f0268032-c161-4548-a74a-adb7143274a6",
Line 267 ⟶ 295:
"ResultFileURL": null
}
</syntaxhighlight>
 
 
<br/>