Skip to content

Commit 1e52ab2

Browse files
authored
Merge pull request #53 from formkiq/add-get-document-ocr
added GET /documents/{id}/ocr
2 parents 129f107 + 2afc00f commit 1e52ab2

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

build/dist/es6/formkiq-client-sdk-es6.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/dist/es6/formkiq-client-sdk-es6.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/api/DocumentsApi.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,26 @@ export class DocumentsApi {
314314
return await this.apiClient.fetchAndRespond(url, options);
315315
}
316316

317+
async getDocumentOcr({siteId, documentId, outputType = 'TEXT'}) {
318+
if (!siteId) {
319+
return JSON.stringify({
320+
'message': 'No siteId specified'
321+
});
322+
}
323+
if (!documentId) {
324+
return JSON.stringify({
325+
'message': 'No documentId specified'
326+
});
327+
}
328+
const params = {siteId};
329+
if (outputType) {
330+
params.outputType = outputType
331+
}
332+
const url = `${this.apiClient.host}/documents/${documentId}/ocr${this.apiClient.buildQueryString(params)}`;
333+
const options = this.apiClient.buildOptions('GET');
334+
return await this.apiClient.fetchAndRespond(url, options);
335+
}
336+
317337
async getDocumentVersions({siteId, documentId, limit = null, next = null}) {
318338
if (!siteId) {
319339
return JSON.stringify({

0 commit comments

Comments
 (0)