2021 Nov 25 8:47 AM
Tutorials: https://developers.sap.com/tutorials/cp-aibus-dox-ui-template-custom.html
--------------------------
Hi,
we have created a Custom template for Document Information Extraction . Now we want to call the service API for this Custom Document. We do not see however, how that would work in the POST/Document service.
When using
{
"extraction": {
"headerFields": [
"Description",
"Capacity"
],
"lineItemFields": [
]
},
"clientId": "c_00",
"documentType": "Custom",
"receivedDate": "2020-02-17",
"enrichment": {
"sender": {
"top": 5,
"type": "businessEntity",
"subtype": "supplier"
},
"employee": {
"type": "employee"
}
}
}
We get this error "message": "Not supported document type: Custom".
What are we doing wrong ? There seems also no option to include the template type in the request.
Any help appreciated.
Regards
Marcus
2022 May 04 3:04 AM
Hi Marcus,
When using template for extraction, you need to provide both "schemaId" and "templateId" as input parameters in your payload, as instructed in here:
https://aiservices-trial-dox.cfapps.eu10.hana.ondemand.com/document-information-extraction/v1/
An example payload:
Thank you.
Best regards
Shu Zhen
2021 Nov 25 9:35 AM
Hi Marcus,
For the moment, the Template feature and custom document types are only supported on UI application level (not on API level). You'll need to use the Document feature in the UI application to use the template you created as described in the tutorial.
Best regards,
Juliana
2021 Nov 25 9:39 AM
Hi Juliana,
thanks for clarification. That leaves the service less useful for us since we would need a custom document type. Is there a plan to expose the custom document feature extraction via an API soon?
If you only get the results from the extraction in an UI and need to note them down, what is gained by providing this feature ?
Regards
Marcus
2022 May 02 6:04 PM
Hi Juliana,
Currently I can post a document with templateId and schemaId, my question is that is there any API to retrieve the templateId and schemaId? currently I can get it from UI by debugging.
{
"clientId": "default",
"documentType": "custom",
"templateId": "87d48a21-3660-48bd-a1c8-cd5ccf286399",
"schemaId": "413f9b87-6b22-4dd7-824b-f9824f6f6639"
}
Best Regards,
Gary
2022 May 04 8:51 AM
Hi Gary,
You can retrieve schemaId via running GET document/jobs/{id}, but unfortunately templateId will not be provided there yet.
We may enable this info in the future release for new APIs.
Thanks for the feedback.
Best regards
Shu Zhen
2022 May 04 3:04 AM
Hi Marcus,
When using template for extraction, you need to provide both "schemaId" and "templateId" as input parameters in your payload, as instructed in here:
https://aiservices-trial-dox.cfapps.eu10.hana.ondemand.com/document-information-extraction/v1/
An example payload:
Thank you.
Best regards
Shu Zhen
2022 Jun 23 12:36 AM
Hi Shu Zhen,
Where can we find the schemaId and templateId of custom schemas and templates?
Can we use the current state of APIs to process custom documents based on custom schemas and templates?
Best Regards,
Tejaswi
2022 Jun 23 1:58 AM
Hi Tejaswi,
You can run via GET /templates to get a list of templates and associated schemas.
Yes, you can process custom documents.
Best regards
Shu Zhen
2022 Jun 23 4:05 PM
Hi,
I don't see an endpoint for templates in the API documentation.
https://aiservices-trial-dox.cfapps.eu10.hana.ondemand.com/document-information-extraction/v1/
When do I find the exact service and the endpoint?
And also, I am unable to subscribe to UI service in trial account and as well as enterprise account. Can you please check?
Best Regards,
Tejaswi