AOTG API: General Account Lookup

From AutoCount Resource Center

General Account Lookup

Get a list of GL Account. Result does not include debtor and creditor accounts.

API Method

Http Method: GET
Method: /api/Lookup/GeneralAccountLookup
Content-Type: application/json
Parameters: None


Code Snippets

  • Add header of "SOTC_AUTH", and assign value of AccessToken.


<?php

$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/Lookup/GeneralAccountLookup');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Content-Type' => 'application/json',
  'SOTC_AUTH' => 'SAMs1a36d2-a139-e911-b8b3-000aa03t3d'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

var client = new RestClient("http://aotg.cloud:8080/api/Lookup/GeneralAccountLookup");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("SOTC_AUTH", "SAMs1a36d2-a139-e911-b8b3-000aa03t3d");
IRestResponse response = client.Execute(request);

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "8080",
  CURLOPT_URL => "http://aotg.cloud:8080/api/Lookup/GeneralAccountLookup",
  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(
    "Content-Type: application/json",
    "SOTC_AUTH: SAMs1a36d2-a139-e911-b8b3-000aa03t3d",
    "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/Lookup/GeneralAccountLookup"

payload = ""
headers = {
    'SOTC_AUTH': "SAMs1a36d2-a139-e911-b8b3-000aa03t3d",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)


Response

Response Successful HTTP Request

200 OK

Response Successful Body

  1. Code: Account Code
  2. Description: Description of the account
  3. CurrencyCode: Currency code of the account
[
    {
        "Code": "100-0000",
        "Description": "CAPITAL",
        "CurrencyCode": "MYR"
    },
    {
        "Code": "150-0000",
        "Description": "RETAINED EARNING",
        "CurrencyCode": "MYR"
    },
    {
        "Code": "151-0000",
        "Description": "RESERVES",
        "CurrencyCode": "MYR"
    },
    {
        "Code": "200-2000",
        "Description": "FURNITURES & FITTINGS",
        "CurrencyCode": "MYR"
    },
    {
        "Code": "200-2005",
        "Description": "ACCUM. DEPRN. - FURNITURES & FITTINGS",
        "CurrencyCode": "MYR"
    }
]



See Also AOTG API


Go to menu

Go to top
Resources For AutoCount Software Developers