From 9da744cb694e702038425ca1c1652babddc3aca5 Mon Sep 17 00:00:00 2001 From: Sebastian Carmona <83849194+Kaevan89@users.noreply.github.com> Date: Thu, 22 Jun 2023 11:05:28 -0500 Subject: [PATCH 1/2] Add v8 examples to README.md --- README.md | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f552708..828e3d3 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,31 @@ using Veryfi; using var client = new HttpClient(); var api = new VeryfiApi("username", "apiKey", "clientId", client); +// Get Documents +var documentsResponse = await api.DocumentsAsync(); + +// Process Document URL. +var documentResponse = await api.Documents2Async( + new DocumentPOSTJSONRequest + { + File_url = url + }); + +// Process Document Base64 +var documentResponse = await api.Documents2Async( + new DocumentPOSTJSONRequest + { + File_name = file.FileName, + File_data = Convert.ToBase64String(file.AsBytes()), + }); +``` + +## Usage V7 + +```cs + // Process Base64 -var document = await api.ProcessDocumentAsync( +var document = await api.ProcessDocumentAsyncV7( new DocumentUploadOptions { File_name = "fileName.jpg", @@ -43,14 +66,14 @@ var document = await api.ProcessDocumentAsync( }); // Process url -var document = await api.ProcessDocumentAsync( +var document = await api.ProcessDocumentAsyncV7( new DocumentUploadOptions { File_url = "https://raw.githubusercontent.com/veryfi/veryfi-csharp/master/src/tests/Veryfi.IntegrationTests/Assets/receipt_public.jpg", }); // Process urls -var document = await api.ProcessDocumentAsync( +var document = await api.ProcessDocumentAsyncV7( new DocumentUploadOptions { File_urls = new [] { @@ -59,7 +82,7 @@ var document = await api.ProcessDocumentAsync( }); // Process stream -var document = await api.ProcessDocumentFileAsync( +var document = await api.ProcessDocumentFileAsyncV7( new Stream(), new DocumentUploadOptions { @@ -67,7 +90,7 @@ var document = await api.ProcessDocumentFileAsync( }); // Process bytes -var document = await api.ProcessDocumentFileAsync( +var document = await api.ProcessDocumentFileAsyncV7( new byte[0], new DocumentUploadOptions { @@ -75,7 +98,7 @@ var document = await api.ProcessDocumentFileAsync( }); // Process path -var document = await api.ProcessDocumentFileAsync( +var document = await api.ProcessDocumentFileAsyncV7( "C:/invoice.png", new DocumentUploadOptions { From a99955c25a02c69801e1f41f9cb0d66657cce940 Mon Sep 17 00:00:00 2001 From: Sebastian Carmona <83849194+Kaevan89@users.noreply.github.com> Date: Thu, 22 Jun 2023 11:06:23 -0500 Subject: [PATCH 2/2] Update README.md Fix example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 828e3d3..90dd01a 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ var documentResponse = await api.Documents2Async( new DocumentPOSTJSONRequest { File_name = file.FileName, - File_data = Convert.ToBase64String(file.AsBytes()), + File_data = Convert.ToBase64String(file.AsBytes()) }); ```