<?php
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'SOTC_AUTH' => 'SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d',
'Content-Type' => 'application/json'
));
$request->setBody('{
"FromDateTime": "2019-02-01T01:45:08.269Z",
"ToDateTime": "2019-02-28T01:45:08.269Z"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
AOTG API: Get List of AR Invoice: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
==Get List of AR Invoice== |
==Get List of AR Invoice== |
||
Get the list of AR Invoice in a specific date range. |
Get the list of AR Invoice in a specific date range. |
||
{{AOTGApiMethodsSpec|POST|/api/public/v1/ARInvoice/GetARInvoiceList|Params=FromDateTime, ToDateTime<br/>Document date range.}} |
{{AOTGApiMethodsSpec|POST|/api/public/v1/ARInvoice/GetARInvoiceList|Params=FromDateTime, ToDateTime<br/>''Document date range.''}} |
||
==API Request Flow== |
==API Request Flow== |
||
Line 20: | Line 20: | ||
|Python= |
|Python= |
||
<syntaxhighlight lang="Python"> |
<syntaxhighlight lang="Python"> |
||
import requests |
|||
url = "http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList" |
|||
payload = "{\r\n \"FromDateTime\": \"2019-02-01T01:45:08.269Z\",\r\n \"ToDateTime\": \"2019-02-28T01:45:08.269Z\"\r\n}" |
|||
headers = { |
|||
'Content-Type': "application/json", |
|||
'SOTC_AUTH': "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d", |
|||
'cache-control': "no-cache", |
|||
} |
|||
response = requests.request("POST", url, data=payload, headers=headers) |
|||
print(response.text) |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
|PHPHttp= |
|PHPHttp= |
||
<syntaxhighlight lang="PHP"> |
<syntaxhighlight lang="PHP"> |
||
<?php |
|||
$request = new HttpRequest(); |
|||
$request->setUrl('http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList'); |
|||
$request->setMethod(HTTP_METH_POST); |
|||
$request->setHeaders(array( |
|||
'cache-control' => 'no-cache', |
|||
'SOTC_AUTH' => 'SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d', |
|||
'Content-Type' => 'application/json' |
|||
)); |
|||
$request->setBody('{ |
|||
"FromDateTime": "2019-02-01T01:45:08.269Z", |
|||
"ToDateTime": "2019-02-28T01:45:08.269Z" |
|||
}'); |
|||
try { |
|||
$response = $request->send(); |
|||
echo $response->getBody(); |
|||
} catch (HttpException $ex) { |
|||
echo $ex; |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
|RestSharp= |
|RestSharp= |
||
<syntaxhighlight lang="C#"> |
<syntaxhighlight lang="C#"> |
||
var client = new RestClient("http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList"); |
|||
var request = new RestRequest(Method.POST); |
|||
request.AddHeader("cache-control", "no-cache"); |
|||
request.AddHeader("SOTC_AUTH", "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d"); |
|||
request.AddHeader("Content-Type", "application/json"); |
|||
request.AddParameter("undefined", "{\r\n \"FromDateTime\": \"2019-02-01T01:45:08.269Z\",\r\n \"ToDateTime\": \"2019-02-28T01:45:08.269Z\"\r\n}", ParameterType.RequestBody); |
|||
IRestResponse response = client.Execute(request); |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
|PHPcURL= |
|PHPcURL= |
||
<syntaxhighlight lang="PHP"> |
<syntaxhighlight lang="PHP"> |
||
<?php |
|||
$curl = curl_init(); |
|||
curl_setopt_array($curl, array( |
|||
CURLOPT_PORT => "8080", |
|||
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList", |
|||
CURLOPT_RETURNTRANSFER => true, |
|||
CURLOPT_ENCODING => "", |
|||
CURLOPT_MAXREDIRS => 10, |
|||
CURLOPT_TIMEOUT => 30, |
|||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
|||
CURLOPT_CUSTOMREQUEST => "POST", |
|||
CURLOPT_POSTFIELDS => "{\r\n \"FromDateTime\": \"2019-02-01T01:45:08.269Z\",\r\n \"ToDateTime\": \"2019-02-28T01:45:08.269Z\"\r\n}", |
|||
CURLOPT_HTTPHEADER => array( |
|||
"Content-Type: application/json", |
|||
"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> |
</syntaxhighlight> |
||
}} |
}} |
||
Line 36: | Line 112: | ||
200 OK |
200 OK |
||
====Response Successful Body==== |
====Response Successful Body==== |
||
'''Id''' can be used for checking the status of result. |
|||
'''Id''' and '''Name''' are required to retrieve result (data). |
'''Id''' and '''Name''' are required to retrieve result (data). |
||
<syntaxhighlight lang="json-object" highlight="2,3"> |
<syntaxhighlight lang="json-object" highlight="2,3"> |
||
{ |
|||
"Id": "f5175ac-8d11-4593-96ce-ccd36085d0d1", |
|||
"Name": "GetARInvoiceList", |
|||
"StartTimestamp": "2019-03-04T03:21:02.3896767Z", |
|||
"EndTimestamp": "2019-03-04T03:21:02.3896767Z" |
|||
} |
|||
</syntaxhighlight> |
|||
<br/> |
|||
==Check Status before get data (result)== |
|||
===Code Snippets=== |
|||
{{AOTGApiCodeSnippetTab |
|||
|Python= |
|||
<syntaxhighlight lang="Python"> |
|||
import requests |
|||
url = "http://aotg.cloud:8080/api/public/v1/Result/f5175ac-8d11-4593-96ce-ccd36085d0d1" |
|||
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/f5175ac-8d11-4593-96ce-ccd36085d0d1'); |
|||
$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/f5175ac-8d11-4593-96ce-ccd36085d0d1"); |
|||
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/f5175ac-8d11-4593-96ce-ccd36085d0d1", |
|||
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 Successful HTTP Request==== |
|||
200 OK |
|||
====Response Successful Body==== |
|||
Status '''"Completed"''' indicates that the data is ready for retrieve. |
|||
<syntaxhighlight lang="json-object"> |
|||
{ |
|||
"RequestId": "f5175ac-8d11-4593-96ce-ccd36085d0d1", |
|||
"Status": "Completed" |
|||
} |
|||
</syntaxhighlight> |
|||
<br/> |
|||
==Get data (result)== |
|||
===Code Snippets=== |
|||
{{AOTGApiCodeSnippetTab |
|||
|Python= |
|||
<syntaxhighlight lang="Python"> |
|||
</syntaxhighlight> |
|||
|PHPHttp= |
|||
<syntaxhighlight lang="PHP"> |
|||
</syntaxhighlight> |
|||
|RestSharp= |
|||
<syntaxhighlight lang="C#"> |
|||
</syntaxhighlight> |
|||
|PHPcURL= |
|||
<syntaxhighlight lang="PHP"> |
|||
</syntaxhighlight> |
|||
}} |
|||
====Response Successful HTTP Request==== |
|||
200 OK |
|||
====Response Successful Body==== |
|||
<syntaxhighlight lang="json-object"> |
|||
</syntaxhighlight> |
</syntaxhighlight> |
Revision as of 04:08, 4 March 2019
<DRAFT>
Incompleted!
Get List of AR Invoice
Get the list of AR Invoice in a specific date range.
API Method
Http Method: POST
Method: /api/public/v1/ARInvoice/GetARInvoiceList
Content-Type: application/json
Parameters: FromDateTime, ToDateTime
Document date range.
API Request Flow
- Submit GetARInvoiceList request to retrieve a range of AR Invoice in account book.
- Check the successful request status, if the data is completed (ready).
- Retrieve the data with Result method.
Code Snippets
- Add header of "SOTC_AUTH", and assign value of AccessToken.
var client = new RestClient("http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("SOTC_AUTH", "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\r\n \"FromDateTime\": \"2019-02-01T01:45:08.269Z\",\r\n \"ToDateTime\": \"2019-02-28T01:45:08.269Z\"\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\r\n \"FromDateTime\": \"2019-02-01T01:45:08.269Z\",\r\n \"ToDateTime\": \"2019-02-28T01:45:08.269Z\"\r\n}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"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;
}
import requests
url = "http://aotg.cloud:8080/api/public/v1/ARInvoice/GetARInvoiceList"
payload = "{\r\n \"FromDateTime\": \"2019-02-01T01:45:08.269Z\",\r\n \"ToDateTime\": \"2019-02-28T01:45:08.269Z\"\r\n}"
headers = {
'Content-Type': "application/json",
'SOTC_AUTH': "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d",
'cache-control': "no-cache",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
Reponse
Response Successful HTTP Request
200 OK
Response Successful Body
Id can be used for checking the status of result. Id and Name are required to retrieve result (data).
{
"Id": "f5175ac-8d11-4593-96ce-ccd36085d0d1",
"Name": "GetARInvoiceList",
"StartTimestamp": "2019-03-04T03:21:02.3896767Z",
"EndTimestamp": "2019-03-04T03:21:02.3896767Z"
}
Check Status before get data (result)
Code Snippets
<?php
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Result/f5175ac-8d11-4593-96ce-ccd36085d0d1');
$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;
}
var client = new RestClient("http://aotg.cloud:8080/api/public/v1/Result/f5175ac-8d11-4593-96ce-ccd36085d0d1");
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);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Result/f5175ac-8d11-4593-96ce-ccd36085d0d1",
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;
}
import requests
url = "http://aotg.cloud:8080/api/public/v1/Result/f5175ac-8d11-4593-96ce-ccd36085d0d1"
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)
Response Successful HTTP Request
200 OK
Response Successful Body
Status "Completed" indicates that the data is ready for retrieve.
{
"RequestId": "f5175ac-8d11-4593-96ce-ccd36085d0d1",
"Status": "Completed"
}
Get data (result)
Code Snippets
Response Successful HTTP Request
200 OK
Response Successful Body
See Also AOTG API
- Introduction to AOTG API
- Begin AutoCount Accounting Integration via AOTG API
- AOTG API Authenticate (Get AccessToken)
Debtor |
AR Invoice |
Item |
Create |
Update |
GL/AR/AP |
General |
Go to top
|
Resources For AutoCount Software Developers
|