POST | /api/documentuploads/registerdocuments |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using IDB.API.DTO.Document.Operations;
using IDB.API.DTO.Registrationprofile;
using IDB.API.DTO.Workflow;
namespace IDB.API.DTO.Document.Operations
{
///<summary>
///Register documents queueud for registration in background
///</summary>
[Api(Description="Register documents queueud for registration in background")]
[ApiResponse(Description="All queued documents are linked to a systemtask for background processing", StatusCode=200)]
public partial class AddDocumentsForBackgroundRegistration
{
public AddDocumentsForBackgroundRegistration()
{
Documents = new List<RegisterDocument>{};
}
///<summary>
///List of queued documents to register in background
///</summary>
[ApiMember(Description="List of queued documents to register in background", IsRequired=true)]
public virtual List<RegisterDocument> Documents { get; set; }
}
public partial class AddDocumentsForBackgroundRegistrationResponse
{
public AddDocumentsForBackgroundRegistrationResponse()
{
RegisteredDocumentUploads = new List<RegisteredDocumentUpload>{};
}
public virtual List<RegisteredDocumentUpload> RegisteredDocumentUploads { get; set; }
}
public partial class RegisterDocument
{
public RegisterDocument()
{
Values = new List<RegistrationValue>{};
Processes = new List<Process>{};
}
public virtual Guid RegistrationProfileID { get; set; }
public virtual List<RegistrationValue> Values { get; set; }
public virtual List<Process> Processes { get; set; }
public virtual string DocumentUploadId { get; set; }
public virtual Guid? DocumentId { get; set; }
public virtual Guid? StandardDocumentID { get; set; }
public virtual bool? HasUnsavedChangesInDocument { get; set; }
public virtual bool? IsOpenedFromNonDMSLocation { get; set; }
}
public partial class RegisteredDocumentUpload
{
public virtual int DocumentUploadID { get; set; }
public virtual bool IsSuccess { get; set; }
public virtual string Message { get; set; }
}
}
namespace IDB.API.DTO.Registrationprofile
{
public partial class RegistrationValue
{
public virtual Guid Key { get; set; }
public virtual string Value { get; set; }
public virtual string ShadowValue { get; set; }
}
}
namespace IDB.API.DTO.Workflow
{
public partial class Process
{
public Process()
{
Transitions = new List<Transition>{};
}
public virtual int ID { get; set; }
public virtual string Title { get; set; }
public virtual string Description { get; set; }
public virtual string Note { get; set; }
public virtual string Coordinator { get; set; }
public virtual bool Urgent { get; set; }
public virtual List<Transition> Transitions { get; set; }
}
public partial class Transition
{
public Transition()
{
UserIDs = new List<int>{};
GroupIDs = new List<int>{};
}
public virtual Guid ID { get; set; }
public virtual string Reason { get; set; }
public virtual DateTime? DelayDate { get; set; }
public virtual string DelayReason { get; set; }
public virtual List<int> UserIDs { get; set; }
public virtual List<int> GroupIDs { get; set; }
}
}
C# AddDocumentsForBackgroundRegistration DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: digiofficeapigateway.deltares.nl
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Documents:
[
{
Values:
[
{
Value: String,
ShadowValue: String
}
],
Processes:
[
{
ID: 0,
Title: String,
Description: String,
Note: String,
Coordinator: String,
Urgent: False,
Transitions:
[
{
Reason: String,
DelayDate: 0001-01-01,
DelayReason: String,
UserIDs:
[
0
],
GroupIDs:
[
0
]
}
]
}
],
DocumentUploadId: String,
DocumentId: 00000000-0000-0000-0000-000000000000,
StandardDocumentID: 00000000-0000-0000-0000-000000000000,
HasUnsavedChangesInDocument: False,
IsOpenedFromNonDMSLocation: False
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { RegisteredDocumentUploads: [ { DocumentUploadID: 0, IsSuccess: False, Message: String } ] }