Service interface of the dox42 Server

Prev Next

This article describes the dox42 Server service interface:

The dox42 Server is accessible via a SOAP and a REST web service interface.

Interface

URL

SOAP

http://<www.YourDomain.com>/dox42service.asmx

WSDL: http://<www.YourDomain.com>/dox42service.asmx?WSDL

REST

http://<www.YourDomain.com>/dox42RestService.ashx

Operations

GenerateDocument/GenerateSlides

The operation can be performed using the following parameters:

Parameter name

Type

Description

DocTemplate

String

Specifies the path to the document template.

Example:

C:\doctemplates\solar_subsidy.docx, C:\doctemplates\salesreport.pptx

InputParams

Key-Value String/String

Specifies the list of the input parameters and values:

  • ParamName: name of the parameter (not case-sensitive)

  • Value: value of the parameter

PostGenActions

Specifies the list of PostGenerateActions to process after generating the document:

  • ActionName: name of the Output Action (e.g. SaveAction), not case-sensitive

  • Paramsparameter of the action (like InputParams)

GenerateSpreadSheet

The operation can be performed using the following parameters:

Parameter name

Type

Description

DataMap

String

Specifies the path to the data map.

Example:

C:\doctemplates\salesreport.dm

InputParams

Key-Value String/String

Specifies the list of the input parameters and values:

  • ParamName:  name of the parameter (not case-sensitive)

  • Value: value of the parameter

PostGenActions

Specifies the list of PostGenerateActions to process after generating the document:

  • ActionName: name of the Output Action (e.g. SaveAction), not case-sensitive

  • Paramsparameter of the action (like InputParams)

Refer to the parameter descriptions of the individual dox42 Server Output Actions.

REST Interface Parameters

The parameters and output actions for the REST and the SOAP interface are identical. The REST interface uses the following URL parameter syntax. Starting from version 3.6.3 you can also pass all parameters via POST:

Parameter

Requirement

Description

Operation

mandatory

Specifies the operation to call:

  • GenerateDocument

  • GenerateSpreadSheet

  • GenerateSlides

DocTemplate

mandatory if Operation=GenerateDocument or Operation=GenerateSlides

Specifies the path of the document template.

DataMap

mandatory if
Operation= GenerateSpreadSheet

Specifies the path of the data map.

InputParam.<ParameterName>

For each input parameter

Specifies the values for input parameters.

Example: InputParam.CustomerID=42

<OutputAction>.<ParameterName>

For each parameter of each Output Action

Specifies the values for Output Action parameters

Example: ReturnAction.Format=pdf

ReturnAction.disp

optional

Controls how the web browser handles the returned document:

Values:

  • Inline

  • attachment

ReturnAction.Mode

optional

Uses text to render the content of the generated document directly in the browser as text. This text may be HTML.

Values:

  • File (default)

  • Text

ReturnAction.fileName

optional, only if ReturnAction.disp=attachment

Specifies the name of the returned document.

RedirectURL

optional, only without ReturnAction

Redirects to this page after generation.

ReturnSavedFileInfo

optional

If true, REST calls return information about saved files as JSON.

Use URL-Encoding!

Example: „Customer.Name=Müller" => „Customer.Name=M%C3%BCller"

See http://www.w3schools.com/tags/ref_urlencode.asp for more information.

Note

Use the syntax <%datasource.datafield%> as a placeholder for dynamic values in your calls.

Sample for a REST call

https://mydox42tenant.dox42.online?
Operation=GenerateDocument&
DocTemplate=https%3A%2F%2FmySharePoint%2FTemplates%2FSalesReport.docx&
InputParam.SelectEmployee=5&
InputParam.SelectYear=&
ReturnAction.Format=PDF&
ReturnAction.Filename=SalesReport_%3C%25EmployeeName%25%3E.pdf

Note

You can easily configure your dox42 calls with our dox42 Service Designer application, which you can download from our website.

HTTP Request Body

In case you need to transfer lots of data to the dox42 Server you better do that as POST parameters or in the request body. To extract the request body you need to define an InputParameter of the name “request body” in your data map. The data from the HTTP request body is stored in this InputParameter and can be processed using, for example, an XML/JSON data source.

Service Header

A service header secures the dox42 SOAP service. This header contains the username and the password. Use the web.config file to configure the utilisation of the service header (see configuration options for the web.config file.)

Entra ID Header

The dox42 service can process an authorization header, containing an Entra ID token.

JavaScript Example:

xhttp.setRequestHeader("Authorization", 'Bearer ' + token);

HTTP Metadata Header and Base64 Metadata Header

Starting from version 4.6 you can send a custom string containing data fields in a dedicated dox42 HTTP header called dox42MetaData. Here is an example of such a string. The header will be returned with data fields replaced:

{"sender": "<%User.mail%>"
"receiver": "<%Customer.mail%>"
"subject": "Here is your document. <%quote.number%>"}

Note

Starting from version 4.6.4 you can also use dox42MetaDataBeaderBase64 to send base64 encoded metadata in your header.