DigiOffice Gateway Web Services

<back to all web services

GenerateDocument

Generate custom Document (Don't use from inside VSTO's)

Requires Authentication
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports IDB.DocumentGenerator.SDK.Operations.General
Imports IDB.API.Entities
Imports IDB.API.DocumentGenerator
Imports IDB.DocumentGenerator.SDK.DTO
Imports IDB.API.Common
Imports IDB.DocumentGenerator.SDK.DTO.General

Namespace Global

    Namespace IDB.API.Common

        Public Partial Class Field
            Public Overridable Property Name As String
            Public Overridable Property OldValue As String
            Public Overridable Property Value As String
            Public Overridable Property Title As String
        End Class
    End Namespace

    Namespace IDB.API.DocumentGenerator

        Public Partial Class Attachment
            Public Overridable Property Name As String
            Public Overridable Property AttachmentData As AttachmentData
        End Class

        Public Partial Class AttachmentData
            Public Overridable Property ContentType As String
            '''<Summary>
            '''Data base64-encoded zonder padding.
            '''</Summary>
            Public Overridable Property Data As String
        End Class

        Public Partial Class ConfigurationSource
            '''<Summary>
            '''Document genereren op basis van een DocGenDocument.
            '''</Summary>
            Public Overridable Property DocumentgeneratorDocument As DocumentgeneratorDocumentReference
            '''<Summary>
            '''Document genereren op basis van een RegistratieProfiel.
            '''</Summary>
            Public Overridable Property RegistrationProfile As RegistrationProfileReference
            '''<Summary>
            '''Use existing document registration.
            '''</Summary>
            Public Overridable Property RegisteredDocument As DocumentReference
            '''<Summary>
            '''Use draft document registration.
            '''</Summary>
            Public Overridable Property DraftDocumentRegistration As MessageQueueReference
            Public Overridable Property DocumentgeneratorType As Type
            '''<Summary>
            '''DocumentgeneratorType voor bijvoorbeeld Word of Email.
            '''</Summary>
            Public Overridable Property DocumentgeneratorTypeName As String
            Public Overridable Property TemplateExtension As String
            Public Overridable Property OutputExtension As String
        End Class

        Public Enum Direction
            Left2Right = 0
            UpLeft2DownRight = 45
            Up2Down = 90
            UpRight2DownLeft = 135
            Right2Left = 180
            DownRight2UpLeft = 225
            Down2Up = 270
            DownLeft2UpRight = 315
        End Enum

        Public Partial Class Signer
            Public Sub New()
                Signature = New List(Of String)
            End Sub

            Public Overridable Property User As UserReference
            Public Overridable Property Person As PersonReference
            Public Overridable Property Relation As RelationReference
            Public Overridable Property ContactPerson As ContactPersonReference
            Public Overridable Property RegisteredDocument As DocumentReference
            Public Overridable Property Type As SignerType
            Public Overridable Property ClosingSentence As String
            Public Overridable Property Name As String
            Public Overridable Property Subsidiary As String
            Public Overridable Property [Function] As String
            Public Overridable Property Department As String
            Public Overridable Property PhoneNumber As String
            Public Overridable Property FaxNumber As String
            Public Overridable Property MobileNumber As String
            Public Overridable Property Email As String
            Public Overridable Property CustomText As String
            Public Overridable Property Signature As List(Of String)
            Public Overridable Property SignatureVisible As Nullable(Of Boolean)
            Public Overridable Property Visible As Nullable(Of Boolean)
        End Class

        Public Enum SignerType
            MainSigner
            AdditionalSigner
            ConfirmationDeclarant
            AdditionalConfirmationDeclarant
        End Enum

        Public Partial Class SubProject
            Public Overridable Property Project As ProjectReference
        End Class

        Public Enum VersioningType
            New
            Change
            Primary
            Secondary
        End Enum

        Public Partial Class Watermark
            Public Overridable Property Text As String
            Public Overridable Property FontFamilyText As String
            Public Overridable Property FontFamily As FontFamily
            Public Overridable Property Direction As Nullable(Of Direction)
            Public Overridable Property StrokeColorText As String
            Public Overridable Property StrokeColor As Color
            Public Overridable Property FillColorText As String
            Public Overridable Property FillColor As Color
        End Class
    End Namespace

    Namespace IDB.API.Entities

        Public Partial Class CommonEntityBaseReference
            Implements IEntityReference
            Public Overridable Property ID As String
            Public Overridable Property ExternalID As String
            Public Overridable Property GlobalID As Nullable(Of Guid)
        End Class

        Public Partial Class CompanyReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property Number As Nullable(Of Integer)
            Public Overridable Property GlobalID As Nullable(Of Guid)
            Public Overridable Property ExternalID As String
        End Class

        Public Partial Class ContactPersonReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property GlobalID As Nullable(Of Guid)
            Public Overridable Property ExternalID As String
            Public Overridable Property RelationID As Nullable(Of Integer)
            Public Overridable Property PersonID As Nullable(Of Integer)
        End Class

        Public Partial Class DocumentgeneratorDocumentReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Guid)
            Public Overridable Property Name As String
            Public Overridable Property GlobalID As Nullable(Of Guid)
        End Class

        Public Partial Class DocumentReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Guid)
            Public Overridable Property Code As String
            Public Overridable Property VersionCode As String
            Public Overridable Property RootDocID As Nullable(Of Guid)
            Public Overridable Property InternalInvoiceCode As String
            Public Overridable Property CompanyNumber As Nullable(Of Integer)
            Public Overridable Property DocumentTypeID As String
            Public Overridable Property InvoiceType As Nullable(Of Integer)
            Public Overridable Property RegProfCatID As Nullable(Of Integer)
            Public Overridable Property GlobalID As Nullable(Of Guid)
            Public Overridable Property ExternalID As String
            Public Overridable Property ExternNr As String
            Public Overridable Property InternNummer As String
        End Class

        Public Partial Class MessageQueueReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property GlobalID As Nullable(Of Guid)
        End Class

        Public Partial Class PersonReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property Number As Nullable(Of Integer)
            Public Overridable Property GlobalID As Nullable(Of Guid)
            Public Overridable Property ExternalID As String
        End Class

        Public Partial Class ProjectReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property Code As String
            Public Overridable Property TypeExternalID As String
            Public Overridable Property CompanyNumber As Nullable(Of Integer)
            Public Overridable Property GlobalID As Nullable(Of Guid)
            Public Overridable Property ExternalID As String
        End Class

        Public Partial Class RegistrationProfileReference
            Implements IEntityReference
            Public Overridable Property ID As Guid
            Public Overridable Property GlobalID As Nullable(Of Guid)
        End Class

        Public Partial Class RelationReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property CreditorNumber As Nullable(Of Integer)
            Public Overridable Property DebtorNumber As Nullable(Of Integer)
            Public Overridable Property GlobalLocationNumber As String
            Public Overridable Property GlobalID As Nullable(Of Guid)
            Public Overridable Property ExternalID As String
        End Class

        Public Partial Class UserReference
            Implements IEntityReference
            Public Overridable Property ID As Nullable(Of Integer)
            Public Overridable Property LoginName As String
            Public Overridable Property UserPrincipalName As String
            Public Overridable Property FullName As String
            Public Overridable Property EmailAddress As String
            Public Overridable Property GlobalID As Nullable(Of Guid)
        End Class
    End Namespace

    Namespace IDB.DocumentGenerator.SDK.DTO

        Public Partial Class RegistrationMetaData
            Public Sub New()
                SubProjects = New List(Of SubProject)
                Signers = New List(Of Signer)
                Fields = New List(Of Field)
                Attachments = New List(Of Attachment)
            End Sub

            '''<Summary>
            '''Hoe moet het versiebeheer worden toegepast?
            '''</Summary>
            <ApiMember(Description:="Hoe moet het versiebeheer worden toegepast?")>
            Public Overridable Property Versioning As Nullable(Of VersioningType)

            '''<Summary>
            '''Previous document will be used for registration of a new version.
            '''</Summary>
            <ApiMember(Description:="Previous document will be used for registration of a new version.")>
            Public Overridable Property PreviousDocument As DocumentReference

            '''<Summary>
            '''Company
            '''</Summary>
            <ApiMember(Description:="Company")>
            Public Overridable Property Company As CompanyReference

            '''<Summary>
            '''Relation
            '''</Summary>
            <ApiMember(Description:="Relation")>
            Public Overridable Property Relation As RelationReference

            '''<Summary>
            '''Person
            '''</Summary>
            <ApiMember(Description:="Person")>
            Public Overridable Property Person As PersonReference

            '''<Summary>
            '''Project
            '''</Summary>
            <ApiMember(Description:="Project")>
            Public Overridable Property Project As ProjectReference

            '''<Summary>
            '''Sub projects
            '''</Summary>
            <ApiMember(AllowMultiple:=true, Description:="Sub projects")>
            Public Overridable Property SubProjects As List(Of SubProject)

            '''<Summary>
            '''Signers
            '''</Summary>
            <ApiMember(AllowMultiple:=true, Description:="Signers")>
            Public Overridable Property Signers As List(Of Signer)

            '''<Summary>
            '''Bevat velden die gebruikt worden als additionele metadata voor het document, naast de vaste koppelingen zoals gebruiker, project en relatie.
            '''</Summary>
            <ApiMember(AllowMultiple:=true, Description:="Bevat velden die gebruikt worden als additionele metadata voor het document, naast de vaste koppelingen zoals gebruiker, project en relatie.")>
            Public Overridable Property Fields As List(Of Field)

            '''<Summary>
            '''Attachments die aan de documentregistratie gekoppeld moet worden.
            '''</Summary>
            <ApiMember(AllowMultiple:=true, Description:="Attachments die aan de documentregistratie gekoppeld moet worden.")>
            Public Overridable Property Attachments As List(Of Attachment)
        End Class
    End Namespace

    Namespace IDB.DocumentGenerator.SDK.DTO.General

        Public Partial Class GenerateDocumentResponse
            Implements IGenerateDocumentResponse
            '''<Summary>
            '''Contains the registration ID of the generated (corporate identity) document
            '''</Summary>
            <ApiMember(Description:="Contains the registration ID of the generated (corporate identity) document", IsRequired:=true)>
            Public Overridable Property DocumentID As Guid
        End Class
    End Namespace

    Namespace IDB.DocumentGenerator.SDK.Operations.General

        '''<Summary>
        '''Generate custom Document (Don't use from inside VSTO's)
        '''</Summary>
        <Api(Description:="Generate custom Document (Don't use from inside VSTO's)")>
        Public Partial Class GenerateDocument
            Implements IGenerateDocument
            '''<Summary>
            '''DigiOffice user
            '''</Summary>
            <ApiMember(Description:="DigiOffice user")>
            Public Overridable Property User As UserReference

            '''<Summary>
            '''Send the generated e-mail via the e-mail queue.
            '''</Summary>
            <ApiMember(Description:="Send the generated e-mail via the e-mail queue.")>
            Public Overridable Property SendMail As Boolean

            '''<Summary>
            '''ConfigurationSource: DocumentgeneratorDocument of RegistratieProfiel.
            '''</Summary>
            <ApiMember(Description:="ConfigurationSource: DocumentgeneratorDocument of RegistratieProfiel.", IsRequired:=true)>
            Public Overridable Property ConfigurationSource As ConfigurationSource

            '''<Summary>
            '''Set references to bind with Registration profile
            '''</Summary>
            <ApiMember(Description:="Set references to bind with Registration profile", IsRequired:=true)>
            Public Overridable Property RegistrationMetaData As RegistrationMetaData

            '''<Summary>
            '''Entity instance used as data source parent, if not exists default is Document registration instance.
            '''</Summary>
            <ApiMember(Description:="Entity instance used as data source parent, if not exists default is Document registration instance.")>
            Public Overridable Property DataSourceEntity As CommonEntityBaseReference

            '''<Summary>
            '''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.
            '''</Summary>
            <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.")>
            Public Overridable Property CustomData As String

            '''<Summary>
            '''Insert a watermark into the document.
            '''</Summary>
            <ApiMember(Description:="Insert a watermark into the document.")>
            Public Overridable Property Watermark As Watermark

            '''<Summary>
            '''Type van het gegenereerde document, bijvoorbeeld: Doc, Docx, Pdf.
            '''</Summary>
            <ApiMember(Description:="Type van het gegenereerde document, bijvoorbeeld: Doc, Docx, Pdf.")>
            Public Overridable Property OutputType As String

            '''<Summary>
            '''Should update the document file.
            '''</Summary>
            <ApiMember(Description:="Should update the document file.")>
            Public Overridable Property ShouldUpdateDocumentFile As Boolean
        End Class
    End Namespace
End Namespace

VB.NET GenerateDocument 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 /csv/reply/GenerateDocument HTTP/1.1 
Host: digiofficeapigateway.deltares.nl 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"User":{"ID":0,"LoginName":"String","UserPrincipalName":"String","FullName":"String","EmailAddress":"String","GlobalID":"00000000-0000-0000-0000-000000000000"},"SendMail":false,"ConfigurationSource":{"DocumentgeneratorDocument":{"ID":"00000000-0000-0000-0000-000000000000","Name":"String"},"RegistrationProfile":{},"RegisteredDocument":{"ID":"00000000-0000-0000-0000-000000000000","Code":"String","VersionCode":"String","RootDocID":"00000000-0000-0000-0000-000000000000","InternalInvoiceCode":"String","CompanyNumber":0,"DocumentTypeID":"String","InvoiceType":0,"RegProfCatID":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"DraftDocumentRegistration":{"ID":0},"DocumentgeneratorType":null,"TemplateExtension":"String","OutputExtension":"String"},"RegistrationMetaData":{"Versioning":"New","PreviousDocument":{"ID":"00000000-0000-0000-0000-000000000000","Code":"String","VersionCode":"String","RootDocID":"00000000-0000-0000-0000-000000000000","InternalInvoiceCode":"String","CompanyNumber":0,"DocumentTypeID":"String","InvoiceType":0,"RegProfCatID":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"Company":{"ID":0,"Number":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"Relation":{"ID":0,"CreditorNumber":0,"DebtorNumber":0,"GlobalLocationNumber":"String","GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"Person":{"ID":0,"Number":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"Project":{"ID":0,"Code":"String","TypeExternalID":"String","CompanyNumber":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"SubProjects":[{"Project":{"ID":0,"Code":"String","TypeExternalID":"String","CompanyNumber":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"}}],"Signers":[{"User":{"ID":0,"LoginName":"String","UserPrincipalName":"String","FullName":"String","EmailAddress":"String","GlobalID":"00000000-0000-0000-0000-000000000000"},"Person":{"ID":0,"Number":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"Relation":{"ID":0,"CreditorNumber":0,"DebtorNumber":0,"GlobalLocationNumber":"String","GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"ContactPerson":{"ID":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String","RelationID":0,"PersonID":0},"RegisteredDocument":{"ID":"00000000-0000-0000-0000-000000000000","Code":"String","VersionCode":"String","RootDocID":"00000000-0000-0000-0000-000000000000","InternalInvoiceCode":"String","CompanyNumber":0,"DocumentTypeID":"String","InvoiceType":0,"RegProfCatID":0,"GlobalID":"00000000-0000-0000-0000-000000000000","ExternalID":"String"},"Type":"MainSigner","ClosingSentence":"String","Name":"String","Subsidiary":"String","Function":"String","Department":"String","PhoneNumber":"String","FaxNumber":"String","MobileNumber":"String","Email":"String","CustomText":"String","Signature":["String"],"SignatureVisible":false,"Visible":false}],"Fields":[{"Name":"String","OldValue":"String","Value":"String","Title":"String = String -> String"}],"Attachments":[{"Name":"String","AttachmentData":{"ContentType":"String","Data":"String"}}]},"DataSourceEntity":{"ID":"String","ExternalID":"String","GlobalID":"00000000-0000-0000-0000-000000000000"},"CustomData":"String","Watermark":{"Text":"String","FontFamilyText":null,"Direction":"Left2Right","StrokeColorText":null,"FillColorText":null},"OutputType":"String","ShouldUpdateDocumentFile":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"DocumentID":"00000000-0000-0000-0000-000000000000"}