ScannerVision Web Server

<back to all web services

ScanSettingsRequest

Requires Authentication
The following routes are available for this service:
POST/{Brand}/scansettings/{TemplateGuid}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ScannerVision.WebService.ServiceModel;
using ScannerVision.Template;
using ScannerVision.Web.Types;
using ScannerVision.SystemTypes.SvMain.Interfaces;
using ScannerVision.Template.Interfaces;
using ScannerVision.CSCommon.Types.Interfaces;
using ScannerVision.Types;

namespace ScannerVision.CSCommon.Types.Interfaces
{
    public partial interface IValidator
    {
        IValidationErrors ValidationErrors { get; set; }
        bool IsValid { get; set; }
    }

}

namespace ScannerVision.SystemTypes.SvMain.Interfaces
{
    public partial interface IClientQuestion
        : ITemplateQuestion
    {
        string QuestionGuid { get; set; }
        string ValueDisplayed { get; set; }
        string ValueReturned { get; set; }
        bool Answered { get; set; }
        bool RegexMatches { get; set; }
        string RegexHint { get; set; }
    }

    public partial interface IClientTemplate
    {
        string Description { get; set; }
        byte[] Icon { get; set; }
        ITemplateModificationInfo ModificationInfo { get; set; }
        string Name { get; set; }
        IEnumerable<IClientQuestion> Questions { get; set; }
        ITemplate Template { get; set; }
        string TemplateGuid { get; set; }
    }

    public partial interface ITemplateModificationInfo
    {
        string Guid { get; set; }
        DateTime TemplateModificationDateTime { get; set; }
        DateTime IconModificationDateTime { get; set; }
    }

}

namespace ScannerVision.Template
{
    public enum NotificationType
    {
        FailureOnly,
        SuccessOnly,
        Always,
    }

    public enum PdfLoadResolution
    {
        Default,
        Dpi100,
        Dpi150,
        Dpi200,
        Dpi300,
        Dpi400,
        Dpi500,
        Dpi600,
    }

    public enum ScanColour
    {
        BlackAndWhite,
        Greyscale,
        Colour,
        Auto,
    }

    public enum ScanOrientation
    {
        Portrait,
        Landscape,
    }

    public enum ScanResolution
    {
        Dpi100,
        Dpi200,
        Dpi300,
        Dpi400,
        Dpi600,
    }

    public enum ScanSide
    {
        Simplex,
        Duplex,
    }

    public enum ScanSize
    {
        Auto,
        A3,
        A4,
        A5,
        B4,
        B5,
        Letter,
        Legal,
        Executive,
        Folio,
        AutoLong,
        A4R,
        A5R,
        A6R,
        B6R,
    }

    public enum ScanSource
    {
        Adf,
        Glass,
        Auto,
    }

    public enum ScanType
    {
        Text,
        Photo,
        TextAndPhoto,
    }

    public enum TemplateScheduleType
    {
        Interval,
        Fixed,
    }

    public enum TemplateType
    {
        Workflow,
        FreeForm,
    }

}

namespace ScannerVision.Template.Interfaces
{
    public partial interface IBadDocumentRejection
        : IStatus
    {
        string RejectionPath { get; set; }
        ICredentials ShareCredentials { get; set; }
    }

    public partial interface ICapture
        : IInterface
    {
        ReadOnlyCollection<ICaptureSource> CaptureSources { get; set; }
    }

    public partial interface ICaptureSource
        : IStatus
    {
    }

    public partial interface ICredentials
        : IInterface
    {
        string Username { get; set; }
        string Password { get; set; }
    }

    public partial interface IGeneral
        : IInterface
    {
        string Name { get; set; }
        string Description { get; set; }
        string Icon { get; set; }
        ITemplateSchedule Schedule { get; set; }
        IRejection Rejection { get; set; }
        IBadDocumentRejection BadDocumentRejection { get; set; }
        PdfLoadResolution? PdfLoadResolution { get; set; }
    }

    public partial interface INotification
        : IStatus
    {
        string Description { get; set; }
        string To { get; set; }
        string Subject { get; set; }
        string Body { get; set; }
        string Cc { get; set; }
        string Bcc { get; set; }
        NotificationType? NotificationType { get; set; }
    }

    public partial interface INotifications
        : IStatus
    {
        ReadOnlyCollection<INotification> Notifications { get; set; }
    }

    public partial interface IRejection
    {
        int? RejectAfter { get; set; }
        string RejectionPath { get; set; }
        ICredentials ShareCredentials { get; set; }
    }

    public partial interface IStringMetadata
        : IMetadata
    {
        bool? IsSecure { get; set; }
        string SampleValue { get; set; }
        string Value { get; set; }
    }

    public partial interface ITemplate
        : IStatus
    {
        string TemplateVersion { get; set; }
        string ScannerVisionVersion { get; set; }
        string Guid { get; set; }
        string BeginScript { get; set; }
        string EndScript { get; set; }
        TemplateType TemplateType { get; set; }
        IGeneral General { get; set; }
        ICapture Capture { get; set; }
        IXmlMetadataImport XmlMetadataImport { get; set; }
        INotifications Notifications { get; set; }
        IValidator Validator { get; set; }
    }

    public partial interface ITemplateSchedule
        : IInterface
    {
        TimeSpan? Time { get; set; }
        TimeSpan? EndTime { get; set; }
        bool? NoEndTime { get; set; }
        TemplateScheduleType? Type { get; set; }
    }

    public partial interface IXmlMetadataImport
        : IStatus
    {
        string SampleDocumentName { get; set; }
        ReadOnlyCollection<IXmlMetadataImportTagMapping> TagMappings { get; set; }
        ReadOnlyCollection<IXmlMetadataImportNamespaceMapping> NamespaceMappings { get; set; }
    }

    public partial interface IXmlMetadataImportNamespaceMapping
        : IInterface
    {
        string Prefix { get; set; }
        string Name { get; set; }
    }

    public partial interface IXmlMetadataImportTagMapping
        : IInterface
    {
        string XPathExpression { get; set; }
        IStringMetadata Metadata { get; set; }
    }

}

namespace ScannerVision.Types
{
    public partial interface IValidationError
    {
        string Property { get; set; }
        string ErrorMessage { get; set; }
    }

    public partial interface IValidationErrors
    {
        ReadOnlyCollection<IValidationError> Errors { get; set; }
    }

}

namespace ScannerVision.Web.Types
{
    public enum BoolSetting
    {
        True,
        False,
    }

}

namespace ScannerVision.WebService.ServiceModel
{
    public enum Brand
    {
        Desktop,
        Hp,
        Kyocera,
        NeaScan,
        Samsung,
        FujiXerox,
        Ta,
        Utax,
        Epson,
        ScanFront400,
        Sharp,
        Ricoh,
        FujiFilm,
    }

    public partial class DtoBase
    {
        public virtual Brand Brand { get; set; }
    }

    public partial class GetTemplateResponse
        : ScanResponseBase
    {
        public virtual string ServerAddress { get; set; }
        public virtual int ServerPort { get; set; }
    }

    public partial class RequestBase
        : DtoBase
    {
    }

    public partial class ResponseBase
        : DtoBase
    {
        public virtual string SelectedUiLanguage { get; set; }
        public virtual string svSession { get; set; }
        public virtual string Title { get; set; }
        public virtual string PageTip { get; set; }
        public virtual bool NewBrowser { get; set; }
        public virtual bool ScanFront400TA { get; set; }
        public virtual bool ScanFront400UTAX { get; set; }
    }

    public partial class ScanResponseBase
        : ResponseBase
    {
        public virtual IClientTemplate Template { get; set; }
        public virtual IEnumerable<IClientQuestion> GlobalQuestions { get; set; }
        public virtual bool CanEnableScanButton { get; set; }
    }

    public partial class ScanSettingsRequest
        : RequestBase
    {
        public virtual string TemplateGuid { get; set; }
        public virtual ScanColour SelectedColour { get; set; }
        public virtual ScanOrientation SelectedOrientation { get; set; }
        public virtual ScanResolution SelectedResolution { get; set; }
        public virtual ScanSide SelectedSides { get; set; }
        public virtual ScanSize SelectedSize { get; set; }
        public virtual ScanSource SelectedSource { get; set; }
        public virtual ScanType SelectedType { get; set; }
        public virtual BoolSetting SelectedScanContinuously { get; set; }
        public virtual BoolSetting SelectedMixedSizes { get; set; }
    }

}

C# ScanSettingsRequest 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 /{Brand}/scansettings/{TemplateGuid} HTTP/1.1 
Host: buildmax.org 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"TemplateGuid":"String","SelectedColour":"BlackAndWhite","SelectedOrientation":"Portrait","SelectedResolution":"Dpi100","SelectedSides":"Simplex","SelectedSize":"Auto","SelectedSource":"Adf","SelectedType":"Text","SelectedScanContinuously":"True","SelectedMixedSizes":"True","Brand":"Desktop"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ServerAddress":"String","ServerPort":0,"CanEnableScanButton":true,"SelectedUiLanguage":"String","svSession":"String","Title":"String","PageTip":"String","NewBrowser":false,"ScanFront400TA":false,"ScanFront400UTAX":false,"Brand":"Desktop"}