/// <summary>
        /// Verify the Document with Barcode Signatures
        /// </summary>
        /// <param name="request">Request. <see cref="PostVerificationBarcodeRequest" /></param>
        /// <returns><see cref="VerifiedDocumentResponse"/></returns>
        public VerifiedDocumentResponse PostVerificationBarcode(PostVerificationBarcodeRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PostVerificationBarcode");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/signature/{name}/verification/barcode";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "password", request.Password);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage);
            var postBody = SerializationHelper.Serialize(request.VerifyOptionsData); // http body (model) parameter
            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "POST",
                postBody,
                null,
                null);

            if (response != null)
            {
                return((VerifiedDocumentResponse)SerializationHelper.Deserialize(response, typeof(VerifiedDocumentResponse)));
            }

            return(null);
        }
Example #2
0
        public void PostVerifyBarcodeTest_Words()
        {
            var file = TestFiles.SignedBarcode_Words01;
            var verifyOptionsData = new WordsVerifyBarcodeOptionsData()
            {
                DocumentPageNumber = 1,
                BarcodeTypeName    = "Code39Standard",
                Text           = "12345678",
                VerifyAllPages = false
            };
            var request = new PostVerificationBarcodeRequest
            {
                Name = file.FileName,
                VerifyOptionsData = verifyOptionsData,
                Password          = null,
                Folder            = file.Folder
            };

            var response = SignatureApi.PostVerificationBarcode(request);

            AssertResponse(response);
        }