DigiOffice API Services Services

<back to all web services

AddDocument

Requires Authentication
<?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};


// @DataContract
class MetaDataField implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string|null */
        public ?string $ID=null,

        // @DataMember
        /** @var string|null */
        public ?string $DocumentVeldID=null,

        // @DataMember
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember
        /** @var string|null */
        public ?string $Label=null,

        // @DataMember
        /** @var string|null */
        public ?string $Datatype=null,

        // @DataMember
        /** @var string|null */
        public ?string $PrintLabel=null,

        // @DataMember
        /** @var string|null */
        public ?string $Entity=null,

        // @DataMember
        /** @var string|null */
        public ?string $PrintValue=null,

        // @DataMember
        /** @var string|null */
        public ?string $RegistrationValue=null,

        // @DataMember
        /** @var string|null */
        public ?string $SPSiteColumnName=null,

        // @DataMember
        /** @var string|null */
        public ?string $ShadowName=null,

        // @DataMember
        /** @var string|null */
        public ?string $ShadowDatatype=null,

        // @DataMember
        /** @var string|null */
        public ?string $ShadowSPSiteColumnName=null,

        // @DataMember
        /** @var string|null */
        public ?string $ShadowSPSiteColumnRegistrationValue=null,

        // @DataMember
        /** @var string|null */
        public ?string $ShadowRegistrationValue=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $IsKeyField=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $KopierenBijNieuweVersie=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['DocumentVeldID'])) $this->DocumentVeldID = $o['DocumentVeldID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Datatype'])) $this->Datatype = $o['Datatype'];
        if (isset($o['PrintLabel'])) $this->PrintLabel = $o['PrintLabel'];
        if (isset($o['Entity'])) $this->Entity = $o['Entity'];
        if (isset($o['PrintValue'])) $this->PrintValue = $o['PrintValue'];
        if (isset($o['RegistrationValue'])) $this->RegistrationValue = $o['RegistrationValue'];
        if (isset($o['SPSiteColumnName'])) $this->SPSiteColumnName = $o['SPSiteColumnName'];
        if (isset($o['ShadowName'])) $this->ShadowName = $o['ShadowName'];
        if (isset($o['ShadowDatatype'])) $this->ShadowDatatype = $o['ShadowDatatype'];
        if (isset($o['ShadowSPSiteColumnName'])) $this->ShadowSPSiteColumnName = $o['ShadowSPSiteColumnName'];
        if (isset($o['ShadowSPSiteColumnRegistrationValue'])) $this->ShadowSPSiteColumnRegistrationValue = $o['ShadowSPSiteColumnRegistrationValue'];
        if (isset($o['ShadowRegistrationValue'])) $this->ShadowRegistrationValue = $o['ShadowRegistrationValue'];
        if (isset($o['IsKeyField'])) $this->IsKeyField = $o['IsKeyField'];
        if (isset($o['KopierenBijNieuweVersie'])) $this->KopierenBijNieuweVersie = $o['KopierenBijNieuweVersie'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->DocumentVeldID)) $o['DocumentVeldID'] = $this->DocumentVeldID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Datatype)) $o['Datatype'] = $this->Datatype;
        if (isset($this->PrintLabel)) $o['PrintLabel'] = $this->PrintLabel;
        if (isset($this->Entity)) $o['Entity'] = $this->Entity;
        if (isset($this->PrintValue)) $o['PrintValue'] = $this->PrintValue;
        if (isset($this->RegistrationValue)) $o['RegistrationValue'] = $this->RegistrationValue;
        if (isset($this->SPSiteColumnName)) $o['SPSiteColumnName'] = $this->SPSiteColumnName;
        if (isset($this->ShadowName)) $o['ShadowName'] = $this->ShadowName;
        if (isset($this->ShadowDatatype)) $o['ShadowDatatype'] = $this->ShadowDatatype;
        if (isset($this->ShadowSPSiteColumnName)) $o['ShadowSPSiteColumnName'] = $this->ShadowSPSiteColumnName;
        if (isset($this->ShadowSPSiteColumnRegistrationValue)) $o['ShadowSPSiteColumnRegistrationValue'] = $this->ShadowSPSiteColumnRegistrationValue;
        if (isset($this->ShadowRegistrationValue)) $o['ShadowRegistrationValue'] = $this->ShadowRegistrationValue;
        if (isset($this->IsKeyField)) $o['IsKeyField'] = $this->IsKeyField;
        if (isset($this->KopierenBijNieuweVersie)) $o['KopierenBijNieuweVersie'] = $this->KopierenBijNieuweVersie;
        return empty($o) ? new class(){} : $o;
    }
}

class Bookmark implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $Order=0
    ) {
    }

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

class Mailings implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

class AttachmentMailing implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

interface IInformationMessages
{
}

class DocumentResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $DocumentID='',
        /** @var string|null */
        public ?string $DocumentNr=null,
        /** @var string */
        public string $RootDocumentID='',
        /** @var array<MetaDataField>|null */
        public ?array $MetaData=null,
        /** @var array<Bookmark>|null */
        public ?array $Bookmarks=null,
        /** @var Mailings|null */
        public ?Mailings $Mailings=null,
        /** @var array<AttachmentMailing>|null */
        public ?array $AttachmentsMailings=null,
        /** @var IInformationMessages|null */
        public ?IInformationMessages $Messages=null,
        /** @var string|null */
        public ?string $SourceDocumentPath=null,
        /** @var string|null */
        public ?string $DestinationDocumentPath=null,
        /** @var string|null */
        public ?string $SharePointContentTypeName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DocumentID'])) $this->DocumentID = $o['DocumentID'];
        if (isset($o['DocumentNr'])) $this->DocumentNr = $o['DocumentNr'];
        if (isset($o['RootDocumentID'])) $this->RootDocumentID = $o['RootDocumentID'];
        if (isset($o['MetaData'])) $this->MetaData = JsonConverters::fromArray('MetaDataField', $o['MetaData']);
        if (isset($o['Bookmarks'])) $this->Bookmarks = JsonConverters::fromArray('Bookmark', $o['Bookmarks']);
        if (isset($o['Mailings'])) $this->Mailings = JsonConverters::from('Mailings', $o['Mailings']);
        if (isset($o['AttachmentsMailings'])) $this->AttachmentsMailings = JsonConverters::fromArray('AttachmentMailing', $o['AttachmentsMailings']);
        if (isset($o['Messages'])) $this->Messages = JsonConverters::from('IInformationMessages', $o['Messages']);
        if (isset($o['SourceDocumentPath'])) $this->SourceDocumentPath = $o['SourceDocumentPath'];
        if (isset($o['DestinationDocumentPath'])) $this->DestinationDocumentPath = $o['DestinationDocumentPath'];
        if (isset($o['SharePointContentTypeName'])) $this->SharePointContentTypeName = $o['SharePointContentTypeName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DocumentID)) $o['DocumentID'] = $this->DocumentID;
        if (isset($this->DocumentNr)) $o['DocumentNr'] = $this->DocumentNr;
        if (isset($this->RootDocumentID)) $o['RootDocumentID'] = $this->RootDocumentID;
        if (isset($this->MetaData)) $o['MetaData'] = JsonConverters::toArray('MetaDataField', $this->MetaData);
        if (isset($this->Bookmarks)) $o['Bookmarks'] = JsonConverters::toArray('Bookmark', $this->Bookmarks);
        if (isset($this->Mailings)) $o['Mailings'] = JsonConverters::to('Mailings', $this->Mailings);
        if (isset($this->AttachmentsMailings)) $o['AttachmentsMailings'] = JsonConverters::toArray('AttachmentMailing', $this->AttachmentsMailings);
        if (isset($this->Messages)) $o['Messages'] = JsonConverters::to('IInformationMessages', $this->Messages);
        if (isset($this->SourceDocumentPath)) $o['SourceDocumentPath'] = $this->SourceDocumentPath;
        if (isset($this->DestinationDocumentPath)) $o['DestinationDocumentPath'] = $this->DestinationDocumentPath;
        if (isset($this->SharePointContentTypeName)) $o['SharePointContentTypeName'] = $this->SharePointContentTypeName;
        return empty($o) ? new class(){} : $o;
    }
}

enum DocInfoSilentMode : string
{
    case Off = 'Off';
    case AllowUserInteraction = 'AllowUserInteraction';
    case DoNotAllowUserInteraction = 'DoNotAllowUserInteraction';
}

class AddDocument implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $RegistrationProfileID='',
        /** @var string|null */
        public ?string $DocumentID=null,
        /** @var string|null */
        public ?string $RootDocumentID=null,
        /** @var int|null */
        public ?int $AssignToUserID=null,
        /** @var int|null */
        public ?int $AssignToGroupID=null,
        /** @var array<MetaDataField>|null */
        public ?array $MetaData=null,
        /** @var Mailings|null */
        public ?Mailings $Mailings=null,
        /** @var array<AttachmentMailing>|null */
        public ?array $AttachmentsMailings=null,
        /** @var string|null */
        public ?string $FileID=null,
        /** @var DocInfoSilentMode|null */
        public ?DocInfoSilentMode $SilentMode=null,
        /** @var bool|null */
        public ?bool $updateStorageSystem=null,
        /** @var int|null */
        public ?int $MessageQueueId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RegistrationProfileID'])) $this->RegistrationProfileID = $o['RegistrationProfileID'];
        if (isset($o['DocumentID'])) $this->DocumentID = $o['DocumentID'];
        if (isset($o['RootDocumentID'])) $this->RootDocumentID = $o['RootDocumentID'];
        if (isset($o['AssignToUserID'])) $this->AssignToUserID = $o['AssignToUserID'];
        if (isset($o['AssignToGroupID'])) $this->AssignToGroupID = $o['AssignToGroupID'];
        if (isset($o['MetaData'])) $this->MetaData = JsonConverters::fromArray('MetaDataField', $o['MetaData']);
        if (isset($o['Mailings'])) $this->Mailings = JsonConverters::from('Mailings', $o['Mailings']);
        if (isset($o['AttachmentsMailings'])) $this->AttachmentsMailings = JsonConverters::fromArray('AttachmentMailing', $o['AttachmentsMailings']);
        if (isset($o['FileID'])) $this->FileID = $o['FileID'];
        if (isset($o['SilentMode'])) $this->SilentMode = JsonConverters::from('DocInfoSilentMode', $o['SilentMode']);
        if (isset($o['updateStorageSystem'])) $this->updateStorageSystem = $o['updateStorageSystem'];
        if (isset($o['MessageQueueId'])) $this->MessageQueueId = $o['MessageQueueId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RegistrationProfileID)) $o['RegistrationProfileID'] = $this->RegistrationProfileID;
        if (isset($this->DocumentID)) $o['DocumentID'] = $this->DocumentID;
        if (isset($this->RootDocumentID)) $o['RootDocumentID'] = $this->RootDocumentID;
        if (isset($this->AssignToUserID)) $o['AssignToUserID'] = $this->AssignToUserID;
        if (isset($this->AssignToGroupID)) $o['AssignToGroupID'] = $this->AssignToGroupID;
        if (isset($this->MetaData)) $o['MetaData'] = JsonConverters::toArray('MetaDataField', $this->MetaData);
        if (isset($this->Mailings)) $o['Mailings'] = JsonConverters::to('Mailings', $this->Mailings);
        if (isset($this->AttachmentsMailings)) $o['AttachmentsMailings'] = JsonConverters::toArray('AttachmentMailing', $this->AttachmentsMailings);
        if (isset($this->FileID)) $o['FileID'] = $this->FileID;
        if (isset($this->SilentMode)) $o['SilentMode'] = JsonConverters::to('DocInfoSilentMode', $this->SilentMode);
        if (isset($this->updateStorageSystem)) $o['updateStorageSystem'] = $this->updateStorageSystem;
        if (isset($this->MessageQueueId)) $o['MessageQueueId'] = $this->MessageQueueId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP AddDocument DTOs

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

HTTP + JSV

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

POST /jsv/reply/AddDocument HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	DocumentID: 00000000-0000-0000-0000-000000000000,
	RootDocumentID: 00000000-0000-0000-0000-000000000000,
	AssignToUserID: 0,
	AssignToGroupID: 0,
	MetaData: 
	[
		{
			ID: 00000000-0000-0000-0000-000000000000,
			DocumentVeldID: 00000000-0000-0000-0000-000000000000,
			Name: String,
			Label: String,
			Datatype: String,
			PrintLabel: String,
			Entity: String,
			PrintValue: String,
			RegistrationValue: String,
			SPSiteColumnName: String,
			ShadowName: String,
			ShadowDatatype: String,
			ShadowSPSiteColumnName: String,
			ShadowSPSiteColumnRegistrationValue: String,
			ShadowRegistrationValue: String,
			IsKeyField: False,
			KopierenBijNieuweVersie: False
		}
	],
	Mailings: {},
	AttachmentsMailings: 
	[
		{
			
		}
	],
	FileID: 00000000-0000-0000-0000-000000000000,
	SilentMode: Off,
	updateStorageSystem: False,
	MessageQueueId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	DocumentNr: String,
	MetaData: 
	[
		{
			ID: 00000000-0000-0000-0000-000000000000,
			DocumentVeldID: 00000000-0000-0000-0000-000000000000,
			Name: String,
			Label: String,
			Datatype: String,
			PrintLabel: String,
			Entity: String,
			PrintValue: String,
			RegistrationValue: String,
			SPSiteColumnName: String,
			ShadowName: String,
			ShadowDatatype: String,
			ShadowSPSiteColumnName: String,
			ShadowSPSiteColumnRegistrationValue: String,
			ShadowRegistrationValue: String,
			IsKeyField: False,
			KopierenBijNieuweVersie: False
		}
	],
	Bookmarks: 
	[
		{
			RemoveLastBreak: False,
			ReplaceOnChange: False
		}
	],
	Mailings: {},
	AttachmentsMailings: 
	[
		{
			
		}
	],
	SourceDocumentPath: String,
	DestinationDocumentPath: String,
	SharePointContentTypeName: String
}