DS Server

POST /documentprocessing/document/info

Endpoint

POST https://example.com/documentprocessing/document/info

Description

Returns information about the document and document content.

Authorization

This endpoint supports the OAuth authorization method. DS Server checks the access token only when OAuth is enabled in the admin portal (see Enable OAuth). With OAuth disabled, the default of a new installation, the endpoint accepts requests without a token.

DS Server implements OAuth as the authorization method. Two flows are supported:

  • Authorization Code
  • Client Credentials

To use the Client Credentials flow, switch on Allow “Client Credentials” grant type in the security profile (see OAuth Grant Types).

In both cases, a valid access token returned from the OAuth endpoints must be passed in a Bearer Authorization Header, as a Query Parameter or in a Cookie.

Authorization Header

Header fieldDescription
AuthorizationA Bearer authorization header (also called token authentication) contains the OAuth access token. The authorization method and a space i.e. "Bearer " is then put before your valid access token. For example: Authorization: Bearer 4796E23054E64BC773CACBCAF24AD179DE9A3

Query Parameter

Query parameterDescription
access_tokenThe access token is passed directly in the endpoint URL as a query string. For example: ?access_token=4796E23054E64BC773CACBCAF24AD179DE9A3

Cookie

CookieDescription
access_tokenThe access token is passed in a cookie named access_token. For example: Cookie: access_token=4796E23054E64BC773CACBCAF24AD179DE9A3

Request Payload

TypeValue
StringThe document encoded as a Base64 string.

Success Response

StatusTypeDescription
200DocumentInfoOn success, the HTTP status code in the response header is 200 (OK). The response body contains a DocumentInfo object.

DocumentInfo

NameTypeValueOptional
userDocumentPropertiesDictionary<string, object>Contains all user defined document properties.yes
mergeBlocksMergeBlock[]Contains all merge blocks in the document.yes
mergeFieldsMergeField[]Contains all merge fields in the document.yes
documentKeywordsString[]The document's keywords. The property value is null, if there are no keywords saved in the document.yes
authorStringThe document's author.yes
creationDateDateTime (String)The document's creation date.yes
creatorApplicationStringThe application name that created the document.yes
documentSubjectStringThe document's subject string.yes
documentTitleStringThe document's title string.yes
lastModificationDateDateTime (String)The date the document has last been modified on.yes

MergeBlock

NameTypeValueOptional
nameStringThe name of the MergeBlock.yes
mergeBlocksMergeBlock[]Contains all merge blocks inside of the merge block (excluding blocks inside of nested merge blocks).yes
mergeFieldsMergeField[]Contains all merge fields inside of the merge block (excluding fields inside of nested merge blocks).yes

MergeField

NameTypeValueOptional
dateTimeFormatStringSpecifies a string format which is applied to date / time values.yes
nameStringGets and sets the name of the field.yes
numericFormatStringSpecifies a string format which is applied to numeric values.yes
preserveFormattingBooleanSpecifies whether the formatting is preserved.yes
textStringGets and sets the text of the field.yes
textAfterStringGets and sets the text after the field.yes
textBeforeStringGets and sets the text before the field.yes

Error Response

StatusDescription
401A 401 (Unauthorized) with an empty body is returned, if OAuth is enabled and the request has no valid access token.
400A 400 (Bad Request) is returned, if the body can't be read as a JSON string ("The JSON value could not be converted to System.String."). The body is a problem details object (application/json) with the title "One or more validation errors occurred." and the message per field in errors. This check comes before the license check.
415A 415 (Unsupported Media Type) is returned, if the Content-Type header of a request with a body is not application/json.
405A 405 (Method Not Allowed) with an empty body and the header Allow: POST is returned for any other HTTP method, for example GET.
400A 400 (Bad Request) is returned, if DS Server is not licensed or the license is invalid. On a server that is not registered, the body is the JSON string "DS Server is not registered." (application/json). DS Server checks the license before the parameter values, but after it has read the body and the typed query parameters.
400A 400 (Bad Request) is returned, if no document was found in the body.
400A 400 (Bad Request) is returned, if the uploaded document is not valid.