I would like to download the signed document after all the signers have completed the signatures. In trying to do so, I am trying to call download API by providing the file id:
After checking the status of sign request, which is “signed”, I am trying to download the document. However, it is still resulting in the document which is not signed/without signatures.
Can you please help me understand, how to get the signed document through API.
Thanks in advance.
Regards
Venky
Page 1 / 1
Hi @venky929 Welcome back to our community!
To retrieve a signed document using the Box Sign API, you can make a GET request to the specific endpoint that corresponds to the signed document. Make sure to include any necessary authentication credentials and parameters required by the API.
You may refer to the guide below:
When you create a signing request, you will receive a response that includes the document_id of the signed document which you need to obtain.
Please ensure that the signing process is complete. You can check the status of the signing workflow using the API endpoint: GET /sign_requests/{sign_request_id} This will return the current status of the signing request, including whether it has been completed.
Once the document is signed, you can retrieve it using the following API endpoint:
GET /documents/{document_id} Replace {document_id} with the actual ID of the signed document. This request will return the signed document.
Check the response to ensure the document is returned in the correct format.
Here’s an example of how to retrieve a signed document:
I tried that in /document/{documentid} but it errored out with 404 Not found.
However, when i tried the /files/{file_id}/content, I am able to see the document but it is not signed.
Regards
Venky
Hi @venky929,
Thanks for your question. While creating a sining request, a copy of the original file is created. It’s available in the destination folder (the field is called a “parent folder” in the request). You correctly identified the signed document with the “sign_files.files.id” from the API response. Additionally, you correctly retrieve the content with the download request. https://{{api.box.com}}/2.0/files/{file_id}/content.
Would you mind sharing how do you check if the file has been signed? Are you using a webhook?
Thank you!
Hi @ostefaniuk Box,
I was using an API itself by passing the id (from create sign response) as parameter.
Thanks for the details, I was able to reproduce this behavior. Could please you try to retrieve the data from GET /sign_requests/{sign_request_id} and pass the file ID from that response, opposed to the data from the create sign response? I noticed that the file ID of the signed document changes after singing the document. Let me know if that helps.
Best,
Olga
Hi @ostefaniuk Box,
I actually tried the same. I am not seeing the behavior that you have mentioned. I see that the file id is the same when we do a get on /sign_requests/{sign_request_id} in my scenario.
Therefore, getting the file without the signature.
Regards
Venky
Hi @venky929,
Thanks for quick response. I retested this case again, and I cannot reproduce the change if the ID. Are you not able to receive the signed document at all? Or is it appearing on the document once you eg. timeout the request?
Have you considered using Sign webhooks, to make sure the sign request is successfully processed? I’d suggest checking the SIGN_REQUEST.SIGNER_SIGNED.
This should ensure that you get the signed file. Let me know if that helps. I’ll mare sure to let you know once, this is improved on our side and no additional parameters are needed to download the signed document.
In both the cases, I am still getting the unsigned document and not the signed one.
Additionally, the name that is coming in the response of the API and the filename in the my sign request are the same. In My Sign requests, I am able to see the signed document, but through API I am not getting the signed one. Not sure if this is of any help but felt like sharing.
Were you able see the signed document from your end based on the process you have mentioned by passing the version id?
Regards
Venky
Hi @venky929,
Thanks for sharing and the context, I need some time to investigate, let me get back to you asap. Thanks again for your patience.
Best,
Olga
Hi @venky929,
I’m still investigating, so please bare with me, I reached out for support for this case.
Best, Olga
Hi @ostefaniuk Box,
Thanks for the update. Hoping for a positive response.
Regards
Venky
Hi @venky929,
Let me just ask some clarifying questions for further investigation:
I realized the responses you pasted the source files field is empty. Does this happen every time you get a response?
Could you paste the request example that you’re sending? (do not pass any sensitive data, so dummy values are great, I just want to make sure we can reproduce the case)
And lastly, just to make sure, this behavior happens for all files you tried to download or just a particular one?
Thank you!
Olga
Hi @ostefaniuk Box ,
while creating a sign request, I am not passing anything in the source files. Therefore, it is always empty.
Below is the create sign request:
{
"email_subject": "Sign Request from Box",
"email_message": "Hello! Please sign the document below",
This behavior is for all the files. I mean I used the same template all the time. But I tried with multiple sign requests and every time, its the same behavior.
Regards
Venky
Hi @venky929,
Thanks for passing all details, this will help to investigate the case closely. I’ll get back to you one I have updates.
Thanks for your patience,
Olga
@ostefaniuk Box
Is there any progress on this request?
Regards
Venky
Hi @venky929, I’m still waiting for the team’s reply. Let me ask about the status.
Best,
Olga
Thanks @ostefaniuk Box.
This has been the missing piece in our project and has been pending for a long time now.
Kindly let the team know, if they can take this on priority, it would be of great help.
Appreciate all the support from you.
Regards
Venky
Hello @venky929,
Yeah, I totally understand. As we are still waiting for the team to investigate, I can offer a debugging live session, we can go over the code together if you feel like double checking this on your side. Let me know if that’s something you’d be interested in.
Best,
Olga
Hi @ostefaniuk Box ,
Thanks for offering the debugging session. Although, I think I have given all the information which I am trying to do. However, I am just trying these API calls through Postman. If you want to review the API requests in Postman for debugging, then sure. we can connect and look into it.
Regards
Venky
Hi @venky929,
Could you please follow the next steps and check if that solves your issue:
1. Create sign request on a File (PDF).
2. Query the Sign Request and get its response.
3. Signer 1 and Signer 2 finish signing the doc.
4. Query the Sign Request and get its response.
Note the responses:
From response 2 & 4: sign_files.filess0].sha1 has a different value than sign_files.filese0].file_version.sha1.
The sign_files.filese0].file_version.id value of Number 2, is the same as Number 4.
5. Take the sign_files.filese0].id and call the endpoint to get the current file version for the signed file_id.
You should be able to see from the response in 5, that the current file_version for the signed file is actually different than the version_id provided by the Get Sign Request data, which indicated file_version.
If you’re using Postman, you cannot rely on the Preview in Postman to view the pdf that is downloaded; please save within Postman the response as a PDF file and use a PDF reader to view.
Looking forward to hearing from you.
Best,
Olga
Hi @ostefaniuk Box ,
This helped.
Thank you so much for the detailed explanation.
Just so you know, It was my bad that the postman was not displaying the response correctly. So, I was doubting the process.
Like you mentioned, I followed all these steps and could confirm that it is working as expected without providing the version also.
Appreciate all the help that you have provided. Sorry If caused any trouble.
Regards
Venky
Hi @venky929,
I’m happy that this helped with your case, great to know it’s already working for you!
Should you have any additional questions, feel free to reach me out.