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
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class DocumentBase64File implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $ContentType=null,
        /** @var string|null */
        public ?string $Content=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContentType'])) $this->ContentType = $o['ContentType'];
        if (isset($o['Content'])) $this->Content = $o['Content'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContentType)) $o['ContentType'] = $this->ContentType;
        if (isset($this->Content)) $o['Content'] = $this->Content;
        return empty($o) ? new class(){} : $o;
    }
}

class GenerateDraftWordDocumentResponse implements IGenerateDraftDocumentResponse, JsonSerializable
{
    public function __construct(
        /** @description Contains the file */
        // @ApiMember(Description="Contains the file")
        /** @var DocumentBase64File|null */
        public ?DocumentBase64File $File=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['File'])) $this->File = JsonConverters::from('DocumentBase64File', $o['File']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->File)) $o['File'] = JsonConverters::to('DocumentBase64File', $this->File);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Generate a new or update a (corporate identity) MS Word document without registration. */
// @Api(Description="Generate a new or update a (corporate identity) MS Word document without registration.")
class GenerateDraftWordDocument implements IGenerateDraftOfficeDocument, JsonSerializable
{
    public function __construct(
        /** @description The DocumentInfo result of the registration wizard. */
        // @ApiMember(Description="The DocumentInfo result of the registration wizard.", IsRequired=true)
        /** @var string */
        public string $DocumentInfo='',

        /** @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. */
        // @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.")
        /** @var string|null */
        public ?string $CustomData=null,

        /** @description The document to update. */
        // @ApiMember(Description="The document to update.")
        /** @var DocumentBase64File|null */
        public ?DocumentBase64File $File=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DocumentInfo'])) $this->DocumentInfo = $o['DocumentInfo'];
        if (isset($o['CustomData'])) $this->CustomData = $o['CustomData'];
        if (isset($o['File'])) $this->File = JsonConverters::from('DocumentBase64File', $o['File']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DocumentInfo)) $o['DocumentInfo'] = $this->DocumentInfo;
        if (isset($this->CustomData)) $o['CustomData'] = $this->CustomData;
        if (isset($this->File)) $o['File'] = JsonConverters::to('DocumentBase64File', $this->File);
        return empty($o) ? new class(){} : $o;
    }
}

PHP GenerateDraftWordDocument DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: dogw.klokgroep.nl 
Accept: application/json
Content-Type: application/json
Content-Length: length

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

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