How to get invoice info from URL for invoice parser API in PowerShell and PDF.co Web API
Follow this simple tutorial to learn get invoice info from URL to have invoice parser API in PowerShell
We regularly create and update our sample code library so you may quickly learn invoice parser API and the step-by-step process in PowerShell. PDF.co Web API was designed to assist invoice parser API in PowerShell. PDF.co Web API is the Rest API that provides set of data extraction functions, tools for documents manipulation, splitting and merging of pdf files. Includes built-in OCR, images recognition, can generate and read barcodes from images, scans and pdf.
The SDK samples displayed below below explain how to quickly make your application do invoice parser API in PowerShell with the help of PDF.co Web API. This sample code in PowerShell is all you need. Just copy-paste it to the code editor, then add a reference to PDF.co Web API and you are ready to try it! Use of PDF.co Web API in PowerShell is also described in the documentation given along with the product.
Trial version of ByteScout is available for free download from our website. This and other source code samples for PowerShell and other programming languages are available.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
GetInvoiceInfoFromUrl.ps1
# The authentication key (API Key). # Get your own by registering at https://app.pdf.co/documentation/api $API_KEY = "***********************************" # Direct URL of PDF file to get information $SourceFileURL = "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-json/sample.pdf" # Prepare URL for `Invoice Parser` API call $query = "https://api.pdf.co/v1/pdf/invoiceparser" # Prepare request body (will be auto-converted to JSON by Invoke-RestMethod) # See documentation: https://apidocs.pdf.co $body = @{ "url" = $SourceFileURL "inline" = True } | ConvertTo-Json try { # Execute request $response = Invoke-WebRequest -Method Post -Headers @{ "x-api-key" = $API_KEY; "Content-Type" = "application/json" } -Body $body -Uri $query $jsonResponse = $response.Content | ConvertFrom-Json if ($jsonResponse.error -eq $false) { # Display PDF document information Write-Host $jsonResponse.body } else { # Display service reported error Write-Host $jsonResponse.message } } catch { # Display request error Write-Host $_.Exception }
run.bat
@echo off powershell -NoProfile -ExecutionPolicy Bypass -Command "& .\GetInvoiceInfoFromUrl.ps1" echo Script finished with errorlevel=%errorlevel% pause
VIDEO
ON-PREMISE OFFLINE SDK
See also:
ON-DEMAND REST WEB API
Get Your API Key
See also:
PDF-co-Web-API-PowerShell-Get-Invoice-Info-From-URL.pdf