SAS API released

SAS stands for Sistem Aplikasi Satker (Satuan Kerja) created by the General Directorate of Treasury, Ministry of Finance, the Republic of Indonesia. In short, this is an accounting software, desktop-based, running on Windows, supports standalone and client-server mode.

In the last three month, we’re developing a web-based system to monitor the allocated budget, spending plans, as well as the real spending. It focuses mainly on tracking where the money goes, and how much money left we are allowed to spend.

To achieve this goal, we developed Application Programming Interface for SAS (SAS API) utilizing the SAS database. By this mean, we don’t need to manually input the budget and spending history as it’s already in the SAS. It uses MySQL as its database engine. However, it has huge number of tables which are most of them are not relevant to our needs. To simplify, we develop an API using Go to get data we will use for our app. 

The API will access POST requests, both for returning the current year’s budget and for spending history. 

Retrieving budget allocation:
parameters: action: pagu token: YourToken

Retrieving spending: parameters: action: realisasi token: YourToken startDate: YYYY-MM-DD endDate: YYYY-MM-DD

You can use Postman to test the API. Don’t forget to use application/
x-www-form-urlencoded as the content type.

alt text
retrieving pagu (budget allocation)
alt text
retrieving realisasi (spending) 

I’ve done benchmarking to test the response time of this API. This is the benchmark result with 10000 requests with 100 concurrency


Requests per second: 205.99 #/sec
Time per request: 485.460 ms
Time per request: 4.855 [ms] (mean, across all concurrent requests)
Transfer rate: 31.38 [Kbytes/sec] received
57.53 kb/s sent
88.91 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 83 377 790.8 233 11471
Processing: 21 106 171.6 80 4938
Waiting: 10 79 172.7 49 4938
Total: 130 483 839.6 325 11662
Percentage of the requests served within a certain time (ms)
50% 325
66% 374
75% 416
80% 457
90% 630
95% 979
98% 3093
99% 4863
100% 11662 (longest request)

The source code of this project is available on GitHub.

Please follow and like us: