Property | Value |
Framework | ASP.NET Web API 2 |
Base URL | /api/{controller} |
Serialization | XML (XmlSerializer) |
Encoding | URL-encoded XML |
Controllers | 3 resource controllers |
Auth Mechanism | DBAUTH request header |
Header | Required | Format | Description |
DBAUTH | REQUIRED | URL-encoded XML | Contains DatabaseCredentials XML. Decoded via UrlWork.DecodeXml() then deserialized using XmlSerializer. |
ACTION | CONDITIONAL | string | Required for POST /Vouchers. Must be one of: DELETE, CLEAR, RESET, PROCESSED. |
The DBAUTH header value is decoded via UrlWork.DecodeXml() then deserialized using XmlSerializer into a DatabaseCredentials object before being passed to the repository layer. |
GET /api/Connectivity HTTP/1.1 Host: your-server.com DBAUTH: <?xml version="1.0"?><DatabaseCredentials> <Server>SQLSRV01</Server> <Database>RAM_DB</Database> <Username>ramuser</Username> <Password>secret</Password> </DatabaseCredentials> Content-Type: text/xml |
config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); |
The {id} route parameter must match the method parameter name exactly in the controller action. GetLineStatus receives id in PURCHASE_ORDER-LINE_NO format (e.g. PO-12345-3) which is split internally on the last '-' character. |
HTTP Method | URL Pattern | Controller Action |
GET | /api/Connectivity | ConnectivityController.Get() |
GET | /api/Vouchers | VouchersController.GetVouchers() |
GET | /api/Vouchers/{id} | VouchersController.GetLineStatus(id) |
POST | /api/Vouchers | VouchersController.Post() |
POST | /api/GeneralJournal | GeneralJournalController.Post() |
HTTP Status | Reason Phrase | Trigger Condition |
400 Bad Request | No Credentials | DBAUTH header is missing or empty |
400 Bad Request | Invalid License | Server license file is not valid; checked on every request |
400 Bad Request | Invalid Action | ACTION header is missing or not in the allowed list |
400 Bad Request | No XML | POST body is empty when an XML payload is required |
400 Bad Request | Error | Unhandled exception from the repository or database layer |
~/Errors/ folder inside the application directory, named by date: Errors\MM-DD-YYYY.txt (e.g., Errors\5-5-2026.txt). Errors are appended with a timestamp and separator. On your server this would be something like:
GET | /api/Connectivity | ConnectivityController |
Header | Type | Required | Description |
DBAUTH | XML string | YES | URL-encoded XML containing DatabaseCredentials |
Status | Description |
200 OK | Returns boolean true — connection established successfully |
400 Bad Request | Connection failed, invalid credentials, or license error |
GET /api/Connectivity HTTP/1.1 DBAUTH: [URL-encoded DatabaseCredentials XML] |
true |
GET | /api/Vouchers | GetVouchers |
Header | Type | Required | Description |
DBAUTH | XML string | YES | URL-encoded XML containing DatabaseCredentials |
Status | Description |
200 OK | XML-serialized List<Voucher> — all vouchers with Status = "New" |
400 Bad Request | Credentials invalid or database error |
<ArrayOfVoucher> <Voucher> <PurchaseOrder>PO-12345</PurchaseOrder> <Lines> <VoucherLine> <LineNo>1</LineNo> <Status>New</Status> </VoucherLine> </Lines> </Voucher> </ArrayOfVoucher> |
GET | /api/Vouchers/{id} | GetLineStatus |
Parameter | Type | Format | Example | Description |
id | string | PO_NUMBER-LINE_NO | PO-12345-3 | Split on last '-': PO=PO-12345, Line=3 |
Header | Type | Required | Description |
DBAUTH | XML string | YES | URL-encoded XML containing DatabaseCredentials |
Status | Description |
200 OK | Status string (e.g. "New", "Processing", "Processed") |
400 Bad Request | Invalid credentials or database error |
GET /api/Vouchers/PO-12345-3 HTTP/1.1 DBAUTH: [URL-encoded DatabaseCredentials XML] |
POST | /api/Vouchers | Action-driven |
Performs a state-changing operation on voucher lines. The specific operation is controlled by the ACTION request header. Different actions require different request body formats.
Header | Type | Required | Description |
DBAUTH | XML string | YES | URL-encoded XML containing DatabaseCredentials |
ACTION | string | YES | One of: DELETE, CLEAR, RESET, PROCESSED |
ACTION Value | Body Required | Effect |
DELETE | YES — PO-LINE string | Resets the PO-Line RAM column to "New" (used when a record is deleted from RAM) |
CLEAR | YES — PO-LINE string | Sets the PO-Line RAM column to empty string |
RESET | NO | Resets all asset RAM columns to their default state |
PROCESSED | YES — List<ProcessedVoucher> XML | Marks the specified voucher lines as "Processing" status |
PO-12345-3 |
<ArrayOfProcessedVoucher> <ProcessedVoucher> <PurchaseOrder>PO-12345</PurchaseOrder> <LineNo>3</LineNo> </ProcessedVoucher> </ArrayOfProcessedVoucher> |
Status | Description |
200 OK | Returns boolean true — operation completed successfully |
400 Bad Request | Missing body, invalid ACTION value, or database error |
POST | /api/GeneralJournal | GeneralJournalController |
Header | Type | Required | Description |
DBAUTH | XML string | YES | URL-encoded XML containing DatabaseCredentials. Newlines stripped before decoding. |
<ArrayOfGeneralJournal> <GeneralJournal> <JournalDate>2026-05-05</JournalDate> <AccountCode>1000-100</AccountCode> <Debit>1500.00</Debit> <Credit>0.00</Credit> <Description>Asset depreciation</Description> </GeneralJournal> </ArrayOfGeneralJournal> |
Status | Description |
200 OK | Returns integer — number of records successfully posted. Returns -1 on a handled exception. |
400 Bad Request | Body is empty ("No XML"), credentials invalid, or database error |