This REST API allows us to extract document’s fields defined in a template object passed as a method parameter by using LLM.
The following example demonstrates how to extract data from a source document by a user-defined template and modern well updated LLM.
Resource
The following GroupDocs.Parser Cloud REST API resource has been used in the AI Parse example.
cURL example
# First get JSON Web Token# Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications.# The client credentials are taken from environment variables.curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"# cURL example to parse a document using LLMcurl -v "https://api.groupdocs.cloud/v1.0/parser/aiparse"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer $JWT_TOKEN"\
-d '{
"FileInfo": {
"FilePath": "Invoice.xlsx"
},
"Template": {
"InvoiceNum": "",
"Date": "",
"Email": ""
}
}'
# First get JSON Web Token# Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications.# The client credentials are taken from environment variables.curl.exe-v"https://api.groupdocs.cloud/connect/token"`-XPOST`-d"grant_type=client_credentials&client_id=$env:CLIENT_ID&client_secret=$env:CLIENT_SECRET"`-H"Content-Type: application/x-www-form-urlencoded"`-H"Accept: application/json"# cURL example to parse a document using LLMcurl.exe-v"https://api.groupdocs.cloud/v1.0/parser/aiparse"`-XPOST`-H"Content-Type: application/json"`-H"Accept: application/json"`-H"Authorization: Bearer $env:JWT_TOKEN"`-d'{
"FileInfo": {
"FilePath": "Invoice.xlsx"
},
"Template": {
"InvoiceNum": "",
"Date": "",
"Email": ""
}
}'
REM First get JSON Web TokenREM Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications.REM The client credentials are taken from environment variables.curl.exe -v "https://api.groupdocs.cloud/connect/token"^
-X POST ^
-d "grant_type=client_credentials&client_id=%CLIENT_ID%&client_secret=%CLIENT_SECRET%"^
-H "Content-Type: application/x-www-form-urlencoded"^
-H "Accept: application/json"REM cURL example to parse a document using LLMcurl.exe -v "https://api.groupdocs.cloud/v1.0/parser/aiparse"^
-X POST ^
-H "Content-Type: application/json"^
-H "Accept: application/json"^
-H "Authorization: Bearer %JWT_TOKEN%"^
-d "{\"FileInfo\":{\"FilePath\":\"Invoice.xlsx\"},\"Template\":{\"InvoiceNum\":\"\",\"Date\":\"\",\"Email\":\"\"}}"
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it hides the Parser API calls and lets you use GroupDocs Cloud features in a native way for your preferred language.
stringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudstringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyAppSid,MyAppKey);varapiInstance=newParseApi(configuration);varoptions=newAIParseOptions{FileInfo="Invoice.xlsx",Template=new{InvoiceNum="",Date="",Email=""}};varrequest=newAIParseRequest(options);varresult=ParseApi.AIParse(request);
// For complete examples and data files, please go to https://github.com/groupdocs-parser-cloud/groupdocs-parser-cloud-java-samples
StringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
StringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyAppSid,MyAppKey);ParseApiapiInstance=newParseApi(configuration);AIParseOptionsoptions=newAIParseOptions();FileInfofileInfo=newFileInfo();fileInfo.setFilePath("Invoice.xlsx");options.setFileInfo(fileInfo);AIParseTemplatetemplate=newAIParseTemplate();options.setTemplate(template);AIParseRequestrequest=newAIParseRequest(options);Objectresult=parseApi.aIParse(request);
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.