API Reference

You are here:
API Connector Reference

We offer API Connector libraries that authenticate through oAuth service, get a session key, send API request to the API service and receive response written for C#, Java, JavaScript and PHP. You can download the libraries from API Libraries. Also, you can find the source codes at the bottom of this page.

You will need to add one of these libraries to your project as a first step, depending on your project development platform.

API Session Support

API Connection can be made either stateless or session-based. The default action is to connect to the server without sessions. If you would like to enable session-based connections, you need to set the session parameter to “true”.

Authentication

Applications accessed via API can be public or private. If the application is private, you must get the API Key and API Password from SpreadsheeetWEB Control Panel and add them to your code.

API Object
.NET
SpreadsheetWebAPI Object
Properties
Name
Description
ClientIdentifieroptionalAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
ClientSecretoptionalAPI Password obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
SupportSessionoptionalUsed for enabling or disabling session-based connections. Default value is “false”. Assigned at object creation.
APIServiceURLrequiredEnd-point of SpreadsheetWEB API service.
OAuthServiceURLrequiredEnd-point of SpreadsheetWEB Authorization service.
ApiRequest Object
Properties
Name
Type
Description
authTokenstringAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
appIdstringApplication ID of the calculation engine.
appKeystringApplication Key of the calculation engine.
recordIdstringID of record to save output results to.
usernamestringUsername who saves the result.
inputListIDictionary<string, List<string>>Inputs sent to calculation engine for calculations.
outputListIList<string>Outputs to be received after calculations are done.
sessionIDstringUser session ID.
savebooleanWhether to save the result to database or not.
ApiEmailRequest Object
Properties
Name
Type
Description
authTokenstringAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
subjectstringSubject of email.
bodystringBody of email.
fromstringSender of email.
tostringReceiver of email.
ccstringCc of email.
bccstringBcc of email.
attachmentsIList<string>Email attachment files data as string.
fileNamesIList<string>Email attachment file names.
filesToConvertPdfIList<int>Email attachment files that are pdf format.
hostUrlstringEmail sender server URL.
fitToPagestringWhether to set pdf file attachments if any to fit into page.
sizestringSize for pdf file attachments if any.
orientationstringOrientation for pdf file attachments if any.
ApiPdfRequest Object
Properties
Name
Type
Description
authTokenstringAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
htmlCodestringHtml code that will be converted into pdf.
titlestringTitle of pdf document.
hostUrlstringHost URL of the server containing images, styles, javascript files and other external resources.
fitToPagestringWhether to set pdf file attachments if any to fit into page.
orientationstringOrientation for pdf file attachments if any.
ApiPdfRangeRequest Object
Properties
Name
Type
Description
authTokenstringAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
appIdstringApplication ID of the calculation engine.
appKeystringApplication Key of the calculation engine.
sessionIdstringUser session ID.
pageIndexstringPage number where the export ranges are set from Wizard.
inputsstringInputs sent to calculation engine for calculations.
ApiGenerateDocumentRequest Object
Properties
Name
Type
Description
authTokenstringAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
documentKeystringKey generated in the Control Panel UI for the specific document.
mappingsIDictionary<string, string>A dictionary of <string, string>, where key is text to replace and value is text to be replaced with.
outputModeDocumentOutputModeEnum value for what to do with the document after it is generated:

[0: ReturnDocument]: Return the document as a byte array in the $.parseJSON(response).Document.

[1: StoreInFileSystem]: Store the file on the server and return a guid receipt for merge

printModeDocumentPrintModeEnum value for what format the output should be returned as:

[0: PDF]: Document will be returned as PDF document.

[1: Word]: Document will be returned as a Word (.DOCX document).

ApiMergeDocumentsRequest Object
Properties
Name
Type
Description
authTokenstringAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
cacheKeysIList<string>List of cache keys corresponding to the receipts from running GenerateDocument with OutputMode = StoreInFileSystem.
printModeDocumentPrintModeEnum value for what format the output should be returned as:

[0: PDF]: Document will be returned as PDF document.

[1: Word]: Document will be returned as a Word (.DOCX document).

deleteCachedFilesbooleanEnum value for what to do with the document after it is generated:

[0: ReturnDocument]: Return the document as a byte array in the $.parseJSON(response).Document.

[1: StoreInFileSystem]: Store the file on the server and return a guid receipt for merge

Methods

GetResult()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

GetRecord()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

SendMail()

Parameter
Type
Description
requestApiEmailRequestIncludes all properties of request.

ExportPdf()

Parameter
Type
Description
requestApiPdfRequestIncludes all properties of request.

ExportPdfByRange()

Parameter
Type
Description
requestApiPdfRangeRequestIncludes all properties of request.

GenerateDocument()

Parameter
Type
Description
requestApiGenerateDocumentRequestIncludes all properties of request.

MergeDocuments()

Parameter
Type
Description
requestApiMergeDocumentsRequestIncludes all properties of request.

Java

SpreadsheetWebAPI Object
Properties
Name
Description
ClientIdentifieroptionalAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
ClientSecretoptionalAPI Password obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
SupportSessionoptionalUsed for enabling or disabling session-based connections. Default value is “false”. Assigned at object creation.
APIServiceURLrequiredEnd-point of SpreadsheetWEB API service.
OAuthServiceURLrequiredEnd-point of SpreadsheetWEB Authorization service.
Methods

GetResult()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

GetRecord()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

SendMail()

Parameter
Type
Description
requestApiEmailRequestIncludes all properties of request.

ExportPdf()

Parameter
Type
Description
requestApiPdfRequestIncludes all properties of request.

ExportPdfByRange()

Parameter
Type
Description
requestApiPdfRangeRequestIncludes all properties of request.
GenerateDocument()
Parameter
Type
Description
requestApiGenerateDocumentRequestIncludes all properties of request.
MergeDocuments()
Parameter
Type
Description
requestApiMergeDocumentsRequestIncludes all properties of request.
PHP
SswebAPI Object
Properties
Name
Description
ClientIdentifieroptionalAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
ClientSecretoptionalAPI Password obtained for SpreadsheetWEB Control Panel. Used if the application is private. Assigned at object creation.
SupportSessionoptionalUsed for enabling or disabling session-based connections. Default value is “false”. Assigned at object creation.
APIServiceURLrequiredEnd-point of SpreadsheetWEB API service.
OAuthServiceURLrequiredEnd-point of SpreadsheetWEB Authorization service.
Methods

GetResult()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

GetRecord()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

SendMail()

Parameter
Type
Description
requestApiEmailRequestIncludes all properties of request.

ExportPdf()

Parameter
Type
Description
requestApiPdfRequestIncludes all properties of request.

ExportPdfByRange()

Parameter
Type
Description
requestApiPdfRangeRequestIncludes all properties of request.

GenerateDocument()

Parameter
Type
Description
requestApiGenerateDocumentRequestIncludes all properties of request.

MergeDocuments()

Parameter
Type
Description
requestApiMergeDocumentsRequestIncludes all properties of request.
JavaScript
Parameters
Name
Description
ClientIdentifierAPI Key obtained for SpreadsheetWEB Control Panel. Used if the application is private.
ClientSecretAPI Password obtained for SpreadsheetWEB Control Panel. Used if the application is private.
SupportSessionUsed for enabling or disabling session-based connections.
APIServiceURLEnd-point of SpreadsheetWEB API service.
OAuthServiceURLEnd-point of SpreadsheetWEB Authorization service.
AuthTokenInternal variable to hold the AuthToken key when OAuth authentication is used for a private application
SessionIDInternal variable to hold SessionID value when SupportSession input is TRUE
OutputHolds the json output received from Web API service
Methods

GetResult()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

GetRecord()

Parameter
Type
Description
requestApiRequestIncludes all properties of request.

SendMail()

Parameter
Type
Description
requestApiEmailRequestIncludes all properties of request.

ExportPdf()

Parameter
Type
Description
requestApiPdfRequestIncludes all properties of request.

ExportPdfByRange()

Parameter
Type
Description
requestApiPdfRangeRequestIncludes all properties of request.

GenerateDocument()

Parameter
Type
Description
requestApiGenerateDocumentRequestIncludes all properties of request.

MergeDocuments()

Parameter
Type
Description
requestApiMergeDocumentsRequestIncludes all properties of request.