DigiOffice API Services Services

<back to all web services

AddDocumentsForBackgroundRegistration

Register documents queueud for registration in background

Requires Authentication
The following routes are available for this service:
POST/api/documentuploads/registerdocuments
<?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 RegisteredDocumentUpload implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DocumentUploadID=0,
        /** @var bool|null */
        public ?bool $IsSuccess=null,
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

class AddDocumentsForBackgroundRegistrationResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<RegisteredDocumentUpload>|null */
        public ?array $RegisteredDocumentUploads=null
    ) {
    }

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

class RegistrationValue implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Key='',
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $ShadowValue=null
    ) {
    }

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

class Transition implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ID='',
        /** @var string|null */
        public ?string $Reason=null,
        /** @var DateTime|null */
        public ?DateTime $DelayDate=null,
        /** @var string|null */
        public ?string $DelayReason=null,
        /** @var array<int>|null */
        public ?array $UserIDs=null,
        /** @var array<int>|null */
        public ?array $GroupIDs=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['DelayDate'])) $this->DelayDate = JsonConverters::from('DateTime', $o['DelayDate']);
        if (isset($o['DelayReason'])) $this->DelayReason = $o['DelayReason'];
        if (isset($o['UserIDs'])) $this->UserIDs = JsonConverters::fromArray('int', $o['UserIDs']);
        if (isset($o['GroupIDs'])) $this->GroupIDs = JsonConverters::fromArray('int', $o['GroupIDs']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->DelayDate)) $o['DelayDate'] = JsonConverters::to('DateTime', $this->DelayDate);
        if (isset($this->DelayReason)) $o['DelayReason'] = $this->DelayReason;
        if (isset($this->UserIDs)) $o['UserIDs'] = JsonConverters::toArray('int', $this->UserIDs);
        if (isset($this->GroupIDs)) $o['GroupIDs'] = JsonConverters::toArray('int', $this->GroupIDs);
        return empty($o) ? new class(){} : $o;
    }
}

class Process implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $Coordinator=null,
        /** @var bool|null */
        public ?bool $Urgent=null,
        /** @var array<Transition>|null */
        public ?array $Transitions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['Coordinator'])) $this->Coordinator = $o['Coordinator'];
        if (isset($o['Urgent'])) $this->Urgent = $o['Urgent'];
        if (isset($o['Transitions'])) $this->Transitions = JsonConverters::fromArray('Transition', $o['Transitions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->Coordinator)) $o['Coordinator'] = $this->Coordinator;
        if (isset($this->Urgent)) $o['Urgent'] = $this->Urgent;
        if (isset($this->Transitions)) $o['Transitions'] = JsonConverters::toArray('Transition', $this->Transitions);
        return empty($o) ? new class(){} : $o;
    }
}

class RegisterDocument implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $RegistrationProfileID='',
        /** @var array<RegistrationValue>|null */
        public ?array $Values=null,
        /** @var array<Process>|null */
        public ?array $Processes=null,
        /** @var string|null */
        public ?string $DocumentUploadId=null,
        /** @var string|null */
        public ?string $DocumentId=null,
        /** @var string|null */
        public ?string $StandardDocumentID=null,
        /** @var bool|null */
        public ?bool $HasUnsavedChangesInDocument=null,
        /** @var bool|null */
        public ?bool $IsOpenedFromNonDMSLocation=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RegistrationProfileID'])) $this->RegistrationProfileID = $o['RegistrationProfileID'];
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('RegistrationValue', $o['Values']);
        if (isset($o['Processes'])) $this->Processes = JsonConverters::fromArray('Process', $o['Processes']);
        if (isset($o['DocumentUploadId'])) $this->DocumentUploadId = $o['DocumentUploadId'];
        if (isset($o['DocumentId'])) $this->DocumentId = $o['DocumentId'];
        if (isset($o['StandardDocumentID'])) $this->StandardDocumentID = $o['StandardDocumentID'];
        if (isset($o['HasUnsavedChangesInDocument'])) $this->HasUnsavedChangesInDocument = $o['HasUnsavedChangesInDocument'];
        if (isset($o['IsOpenedFromNonDMSLocation'])) $this->IsOpenedFromNonDMSLocation = $o['IsOpenedFromNonDMSLocation'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RegistrationProfileID)) $o['RegistrationProfileID'] = $this->RegistrationProfileID;
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('RegistrationValue', $this->Values);
        if (isset($this->Processes)) $o['Processes'] = JsonConverters::toArray('Process', $this->Processes);
        if (isset($this->DocumentUploadId)) $o['DocumentUploadId'] = $this->DocumentUploadId;
        if (isset($this->DocumentId)) $o['DocumentId'] = $this->DocumentId;
        if (isset($this->StandardDocumentID)) $o['StandardDocumentID'] = $this->StandardDocumentID;
        if (isset($this->HasUnsavedChangesInDocument)) $o['HasUnsavedChangesInDocument'] = $this->HasUnsavedChangesInDocument;
        if (isset($this->IsOpenedFromNonDMSLocation)) $o['IsOpenedFromNonDMSLocation'] = $this->IsOpenedFromNonDMSLocation;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Register documents queueud for registration in background */
// @Api(Description="Register documents queueud for registration in background")
// @ApiResponse(Description="All queued documents are linked to a systemtask for background processing", StatusCode=200)
class AddDocumentsForBackgroundRegistration implements JsonSerializable
{
    public function __construct(
        /** @description List of queued documents to register in background */
        // @ApiMember(Description="List of queued documents to register in background", IsRequired=true)
        /** @var array<RegisterDocument>|null */
        public ?array $Documents=null
    ) {
    }

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

PHP AddDocumentsForBackgroundRegistration DTOs

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

HTTP + XML

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

POST /api/documentuploads/registerdocuments HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AddDocumentsForBackgroundRegistration xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document.Operations">
  <Documents>
    <RegisterDocument>
      <DocumentId>00000000-0000-0000-0000-000000000000</DocumentId>
      <DocumentUploadId>String</DocumentUploadId>
      <HasUnsavedChangesInDocument>false</HasUnsavedChangesInDocument>
      <IsOpenedFromNonDMSLocation>false</IsOpenedFromNonDMSLocation>
      <Processes xmlns:d4p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Workflow">
        <d4p1:Process>
          <d4p1:Coordinator>String</d4p1:Coordinator>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:ID>0</d4p1:ID>
          <d4p1:Note>String</d4p1:Note>
          <d4p1:Title>String</d4p1:Title>
          <d4p1:Transitions>
            <d4p1:Transition>
              <d4p1:DelayDate>0001-01-01T00:00:00</d4p1:DelayDate>
              <d4p1:DelayReason>String</d4p1:DelayReason>
              <d4p1:GroupIDs xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d8p1:int>0</d8p1:int>
              </d4p1:GroupIDs>
              <d4p1:ID>00000000-0000-0000-0000-000000000000</d4p1:ID>
              <d4p1:Reason>String</d4p1:Reason>
              <d4p1:UserIDs xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d8p1:int>0</d8p1:int>
              </d4p1:UserIDs>
            </d4p1:Transition>
          </d4p1:Transitions>
          <d4p1:Urgent>false</d4p1:Urgent>
        </d4p1:Process>
      </Processes>
      <RegistrationProfileID>00000000-0000-0000-0000-000000000000</RegistrationProfileID>
      <StandardDocumentID>00000000-0000-0000-0000-000000000000</StandardDocumentID>
      <Values xmlns:d4p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Registrationprofile">
        <d4p1:RegistrationValue>
          <d4p1:Key>00000000-0000-0000-0000-000000000000</d4p1:Key>
          <d4p1:ShadowValue>String</d4p1:ShadowValue>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:RegistrationValue>
      </Values>
    </RegisterDocument>
  </Documents>
</AddDocumentsForBackgroundRegistration>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AddDocumentsForBackgroundRegistrationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document.Operations">
  <RegisteredDocumentUploads>
    <RegisteredDocumentUpload>
      <DocumentUploadID>0</DocumentUploadID>
      <IsSuccess>false</IsSuccess>
      <Message>String</Message>
    </RegisteredDocumentUpload>
  </RegisteredDocumentUploads>
</AddDocumentsForBackgroundRegistrationResponse>