DigiOffice Gateway Web Services

<back to all web services

GenerateDraftWordDocument

Generate a new or update a (corporate identity) MS Word document without registration.

Requires Authentication
The following routes are available for this service:
POST/api/documentgenerator/word/generatedraftdocument
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentBase64File:
    content_type: Optional[str] = None
    content: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GenerateDraftWordDocumentResponse(IGenerateDraftDocumentResponse):
    # @ApiMember(Description="Contains the file")
    file: Optional[DocumentBase64File] = None
    """
    Contains the file
    """


# @Api(Description="Generate a new or update a (corporate identity) MS Word document without registration.")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GenerateDraftWordDocument(IGenerateDraftOfficeDocument):
    """
    Generate a new or update a (corporate identity) MS Word document without registration.
    """

    # @ApiMember(Description="The DocumentInfo result of the registration wizard.", IsRequired=true)
    document_info: Optional[str] = None
    """
    The DocumentInfo result of the registration wizard.
    """


    # @ApiMember(Description="Hier kan de (dynamische) data voor het document geplaatst worden, de data kan middels tekstblokken en placeholders worden geplaatst.Het formaat binnen CustomData staat vrij maar vereist een 'root' element.")
    custom_data: Optional[str] = None
    """
    Hier kan de (dynamische) data voor het document geplaatst worden, de data kan middels tekstblokken en placeholders worden geplaatst.Het formaat binnen CustomData staat vrij maar vereist een 'root' element.
    """


    # @ApiMember(Description="The document to update.")
    file: Optional[DocumentBase64File] = None
    """
    The document to update.
    """

Python GenerateDraftWordDocument DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/documentgenerator/word/generatedraftdocument HTTP/1.1 
Host: doapigw.baasbv.nl 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"DocumentInfo":"String","CustomData":"String","File":{"ContentType":"String","Content":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"File":{"ContentType":"String","Content":"String"}}