Jump to content

AOTG API: Get Debtor: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 113:
 
==Check Status==
{{AOTGApiCodeSnippetTab
|Python=
<syntaxhighlight lang="Python">
import requests
 
url = "http://aotg.cloud:8080/api/public/v1/Result/7d472828-b1df-44fe-8a7b-1e737ca09ba5"
 
payload = ""
headers = {
'SOTC_AUTH': "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d",
'cache-control': "no-cache",
}
 
response = requests.request("GET", url, data=payload, headers=headers)
 
print(response.text)
</syntaxhighlight>
|PHPHttp=
<syntaxhighlight lang="PHP">
<?php
 
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Result/7d472828-b1df-44fe-8a7b-1e737ca09ba5');
$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/7d472828-b1df-44fe-8a7b-1e737ca09ba5");
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
 
$curl = curl_init();
 
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Result/7d472828-b1df-44fe-8a7b-1e737ca09ba5",
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;
}
</syntaxhighlight>
}}
 
===Response===
====Response Successful HTTP Request====
200 OK
====Response Successful Body====
Status shows the data is ready for retrieve.
<syntaxhighlight lang="json-object" highlight="3">
{
"RequestId": "7d472828-b1df-44fe-8a7b-1e737ca09ba5",
"Status": "Completed"
}
</syntaxhighlight>
 
==Get Data (Result)==
{{AOTGApiCodeSnippetTab
|Python=
<syntaxhighlight lang="Python">
import requests
 
url = "http://aotg.cloud:8080/api/public/v1/Result/GetDebtor/7d472828-b1df-44fe-8a7b-1e737ca09ba5/result"
 
payload = ""
headers = {
'SOTC_AUTH': "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d",
'cache-control': "no-cache",
}
 
response = requests.request("GET", url, data=payload, headers=headers)
 
print(response.text)
</syntaxhighlight>
|PHPHttp=
<syntaxhighlight lang="PHP">
<?php
 
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Result/GetDebtor/7d472828-b1df-44fe-8a7b-1e737ca09ba5/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/GetDebtor/7d472828-b1df-44fe-8a7b-1e737ca09ba5/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
 
$curl = curl_init();
 
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Result/GetDebtor/7d472828-b1df-44fe-8a7b-1e737ca09ba5/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;
}
</syntaxhighlight>
}}
 
====Response From Result====
=====Response Successful HTTP Request=====
200 OK
=====Response Successful Body=====
<tabber>
Body=
<syntaxhighlight lang="json-object">
{
"RequestId": "7d472828-b1df-44fe-8a7b-1e737ca09ba5",
"RequestName": "GetDebtor",
"HostName": "---",
"IPAddress": "---",
"RequestTypeName": "Debtor",
"ResultJson": "{\"Id\":\"{[!MzAwLUEwMDI!]}\",\"AccNo\":\"300-A002\",\"CompanyName\":\"AutoCount On The Go\",\"RegisterNo\":\"\",\"Description\":\"AOTG\",\"InvoiceAddress\":{\"Contact\":\"Mr.Tan\",\"Fax\":\"\",\"Phone\":\"02111373\",\"Address1\":\"1/2, PINE STREET,\",\"Address2\":\"CENTURY ROAD,\",\"Address3\":\"SELANGOR\",\"Address4\":\"50000 MALAYSIA\"},\"DeliverAddress\":{\"Contact\":\"Mr.Tan\",\"Fax\":\"\",\"Phone\":\"02111373\",\"Address1\":\"1/2, PINE STREET,\",\"Address2\":\"Delivery CENTURY ROAD,\",\"Address3\":\"SELANGOR\",\"Address4\":\"50000 MALAYSIA\"},\"SalesAgent\":\"\",\"CreditTerm\":\"C.O.D.\",\"CreditLimit\":30000.00,\"NatureOfBusiness\":\"\",\"WebURL\":\"\",\"EmailAddress\":\"\",\"Outstanding\":0.0,\"IsActive\":true,\"CurrencyCode\":\"MYR\",\"CurrencySymbol\":\"RM\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":\"\",\"IsTaxRegistered\":false,\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":\"\",\"PriceCategory\":\"\",\"DetailDiscount\":null,\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":[],\"TaxExemptionList\":[]}",
"RequestParamJson": null,
"ResultStream": null,
"ResultTypeName": "PSW.SOTC.Accounting.Provider.Models.DebtorEntity",
"Status": "Completed",
"Version": "1.2.19051.12002",
"AccountBookInfo": "Plug-In 1.9 Test;1.0.9.77",
"AccountBookDBInfo": "1.0.9.77",
"Timestamp": "2019-03-01T07:54:37.2578124Z",
"ResultedTimestamp": "2019-03-01T07:54:37.3147722Z",
"ProcessingInterval": 0.52409549999999994,
"InQueueInterval": 1.6724054,
"ResultFileURL": null
}
</syntaxhighlight>
|-|
Readable of ResultJson=
<syntaxhighlight lang="json-object">
{
"Id": "{[!MzAwLUEwMDI!]}",
"AccNo": "300-A002",
"CompanyName": "AutoCount On The Go",
"RegisterNo": "",
"Description": "AOTG",
"InvoiceAddress": {
"Contact": "Mr.Tan",
"Fax": "",
"Phone": "02111373",
"Address1": "1/2, PINE STREET,",
"Address2": "CENTURY ROAD,",
"Address3": "SELANGOR",
"Address4": "50000 MALAYSIA"
},
"DeliverAddress": {
"Contact": "Mr.Tan",
"Fax": "",
"Phone": "02111373",
"Address1": "1/2, PINE STREET,",
"Address2": "Delivery CENTURY ROAD,",
"Address3": "SELANGOR",
"Address4": "50000 MALAYSIA"
},
"SalesAgent": "",
"CreditTerm": "C.O.D.",
"CreditLimit": 30000,
"NatureOfBusiness": "",
"WebURL": "",
"EmailAddress": "",
"Outstanding": 0,
"IsActive": true,
"CurrencyCode": "MYR",
"CurrencySymbol": "RM",
"BlockExceedCreditLimit": false,
"TaxCode": "",
"TaxRegistrationNo": "",
"IsTaxRegistered": false,
"GSTStatusVerifiedDate": null,
"IsInclusiveTax": false,
"Area": "",
"PriceCategory": "",
"DetailDiscount": null,
"SalesExemptionNo": "",
"SalesExemptionExpiryDate": null,
"BranchList": [],
"TaxExemptionList": []
}
</syntaxhighlight>
</tabber>
 
<br/>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.