Sign In

AppSynergy REST API

The AppSynergy REST API allows you to make RESTful calls to your account from any application. Note that you can call these API methods using AppSynergy's SQL/REST feature (i.e. from triggers and stored procedures).

Actions for PDF document activities:

Actions for SQL database activities:

YOUR_API_KEY and its assigned Security Role determine access rights (see Tools > API Keys...). YOUR_API_KEY can be provided as a URL parameter (as shown below) or alternatively as an HTTP header in Bearer Authentication format.

Note that all actions:

HTML2PDF – PDF Generation

Generates a PDF document from the provided HTML and stores it in your database storage bucket. The response contains a reference to that document in AppSynergy Document Field format.

Request

POST https://www.appsynergy.com/api?action=HTML2PDF&apiKey=YOUR_API_KEY { "html": "<html><body><h1>Hello World</h1></body></html>" "filename": "HelloWorld.pdf", }

Response

{ "status": "OK", "errorMessage": "", "errorCode": "", "data": { "documentField": "HelloWorld.pdf;1048;1598992707098;database/files/a655f610-febd-4f6a-b11d-6bcd696f5456.pdf" } }

PDF_AUTOFILL – Programmatically Fill a PDF Document

Given a fillable PDF document and a list of field names and values, this method fills in the PDF fields creating a new filled PDF document.

Request

POST https://www.appsynergy.com/api?action=PDF_AUTOFILL&apiKey=YOUR_API_KEY { "sourcePdf": "MyFillableTemplate.pdf;1048;1598992707098;database/files/a655f610-febd-4f6a-b11d-6bcd696f5456.pdf", "dataFields": { "field1":"value1", "field2":"value2" }, "outputFilename": "MyNewDoc.pdf", "ignoreMissingFields": true, "flattenFields": "NONE" }

Response

{ "status": "OK", "errorMessage": "", "errorCode": "", "data": { "filledPdf": "MyNewDoc.pdf;12048;1598992709098;database/files/a655f610-febd-4f6a-b11d-6bcd696f5466.pdf", // DocumentField format "acroFieldNames": [ "FirstName", "LastName" ] } }

PDF_MERGE – Merge Multiple PDFs into A Single Document

Merges multiple PDFs into a single document.

Request

POST https://www.appsynergy.com/api?action=PDF_MERGE&apiKey=YOUR_API_KEY { "outputFilename": "MyNewDoc.pdf", "sourcePdfs": [ "Doc1.pdf;10428;1598992706098;database/files/a655f610-febd-4f6a-b11d-6bcd696f5456.pdf", "Doc2.pdf;21048;1598992507098;database/files/a655f610-febd-4f6a-b11d-6bcd696f6bcd.pdf", "Doc3.pdf;90148;1598992737098;database/files/a655f610-febd-4f6a-b11d-6bcd696f4f6a.pdf" ] }

Response

{ "status": "OK", "errorMessage": "", "errorCode": "", "data": { "mergedPdf": "MyMergedDoc.pdf;91048;1598992709098;database/files/a655f610-febd-4f6a-b11d-6bcd696f5466.pdf" } }

EXEC_QUERY – Execute an SQL Query

Executes an SQL query and returns the results in either JSON or CSV format. You can execute an SQL command like SHOW TABLES to see which tables are available.

Request

POST https://www.appsynergy.com/api?action=EXEC_QUERY&apiKey=YOUR_API_KEY { "sqlCmd": "SELECT * FROM MyTable", "responseFormat": "JSON" }

Response

If responseFormat was CSV:

Customer_ID,Name 1000,"Company A" 1001,"Company B"

If responseFormat was JSON:

{ "status": "OK", "errorMessage": "", "errorCode": "", "data": { "columns": [ { "tableName": "Customers", "columnName": "Customer_ID", "datatype": "BIGINT" }, { "tableName": "Customers", "columnName": "Name", "datatype": "VARCHAR" } ], "rows": [ { "values": [ { "value": "1000" }, { "value": "Company A" } ] }, { "values": [ { "value": "1001" }, { "value": "Company B" } ] } ] } }

EXEC_DML – Execute an SQL DML Statement

Executes an SQL DML statement (e.g. INSERT, UPDATE, DELETE) and returns the number of rows affected.

Request

POST https://www.appsynergy.com/api?action=EXEC_DML&apiKey=YOUR_API_KEY { "sqlCmd": "UPDATE MyTable SET MyCol = 123 WHERE ID = 100" }

Response

{ "status": "OK", "errorMessage": "", "errorCode": "", "data": { "rowsAffected": 1 } }