hcd-integrations | Posts: 14

Ability to send 2 DOCX files with a single payload for Text Tag Extraction

0 votes

Is it possible with text tag extraction to send two PDF documents with the payload? If so, can you share an example - we are not finding any examples? We are using the OSS ReST API to send payload data.


Duo_Liang | Posts: 3776

Reply to: Ability to send 2 DOCX files with a single payload for Text Tag Extraction

0 votes

Hi there,

 

Thanks for your post!

Yes, you can use text tags extraction on PDF and DOCX files (see attachments), and it's achievable to send multiple documents in a single call. The raw request body could look like below:
 

POST /api/packages HTTP/1.1

Authorization: Basic YkJxxxxxUg==

Accept: application/json

Content-Type: multipart/form-data; boundary=--------------------------398426008899708081112834

User-Agent: PostmanRuntime/7.28.4

Cache-Control: no-cache

Postman-Token: 6145bd2e-9584-41ae-ad4f-471ce7feeb76

Host: sandbox.esignlive.com

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

Content-Length: 53606

 

----------------------------398426008899708081112834

Content-Disposition: form-data; name="payload"

{

"documents": [

{

"id": "document1",

"name": "document1",

"extract": true,

"extractionTypes": [

"TEXT_TAGS"

]

},

{

"id": "document2",

"name": "document2",

"extract": true,

"extractionTypes": [

"TEXT_TAGS"

]

}

],

"status": "DRAFT",

"type": "PACKAGE",

"roles": [

{

"id": "Signer1",

"type": "SIGNER",

"signers": [

{

"email": "[email protected]",

"firstName": "John",

"lastName": "Smith",

"id": "Signer1"

}

],

"name": "Signer1"

}

],

"name": "Text Tags Example Package"

}

----------------------------398426008899708081112834

Content-Disposition: form-data; name="file"; filename="text tag.docx"

<text tag.docx>

----------------------------398426008899708081112834

Content-Disposition: form-data; name="file"; filename="SampleDocTextTagsNew.pdf"

<SampleDocTextTagsNew.pdf>

----------------------------398426008899708081112834--

 

 

Duo


Attachments
hcd-integrations | Posts: 14

Reply to: Ability to send 2 DOCX files with a single payload for Text Tag Extraction

1 votes

Excellent, thank you for the super quick response and code sample. We now have working logic!


hcd-integrations | Posts: 14

Reply to: Ability to send 2 DOCX files with a single payload for Text Tag Extraction

0 votes

Would you happen to have an example of doing this using CURL in PHP? We've tried several ways of getting it to upload the files but instead it just creates empty docs with just the file path strings.


Duo_Liang | Posts: 3776

Reply to: Ability to send 2 DOCX files with a single payload for Text Tag Extraction

0 votes

Hi there,

 

Try the attached PHP code.

 

Duo


Attachments
hcd-integrations | Posts: 14

Reply to: Ability to send 2 DOCX files with a single payload for Text Tag Extraction

0 votes

Thank you Duo. We made a successful call with two different forms (.docx and .pdf) using your code example. 

 


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off