Get documents
Once signed, a full copy of the completed document can be obtained in a zip file by calling the 'completed document' endpoint. This will include the files uploaded, a coversheet and a XML signature for a fully signed envelope.
Sandbox:
GET https://demo.api.yotisign.com/v2/envelopes/<envelopeId>/completed-documents
Production:
GET https://api.yotisign.com/v2/envelopes/<envelopeId>/completed-documents
Where envelopeID is the ID generated when creating the envelope request. this will be in the response body of the create envelope request.
Header explained
The following elements are needed:
Headers | Content |
---|---|
Content-Type | application/json |
Authorization | API Key to call the Yoti Sign API. This should be sent as a bearer token. |
Example code
x
const rp = require("request-promise");
const fs = require("fs");
const getDocuments = () => {
const documents = {
method: "GET",
uri: "<BASE_URL>/v2/envelopes/<envelopeId>/completed-documents",
headers: {
authorization: "Bearer <API_KEY>",
},
encoding: null,
};
return rp(documents)
.then((body) => fs.writeFileSync("example.zip", body))
.catch((err) => err);
};
//send request
let results = await getDocuments();
If your GET request is successful, you will receive a zip file with the documents inside.
Good to know
You will need to wait for all recipients to sign the documents before you can make this request
Error codes
Error Code | Description |
---|---|
400 | Bad Request or invalid payload |
401 | Unauthorised request, example: invalid API key |
403 | Forbidden, requesting user did not create the envelope |
404 | The envelope ID couldn’t be found |
Was this page helpful?