Reputation: 525
The getClickwrapAgreements call is not returning a list of documents associated with that agreement. According to the API documentation, this call should return a documents
array of objects containing e.g. documentBase64
, documentName
, fileExtension
, but that array is always empty.
Example request:
https://demo.docusign.net/clickapi/v1/accounts/<accountid>/clickwraps/<clickwrapId>/users?client_user_id=<userId>
Example response:
{
"userAgreements": [
{
"accountId": "<accountId>",
"clickwrapId": "<clickwrapId>",
"clientUserId": "<userId>",
"agreementId": "<agreementId>",
"documents": [],
"createdOn": "2020-09-25T11:30:26.8230097Z",
"agreedOn": "2020-09-25T11:30:34.5580771Z",
"status": "agreed",
"versionId": "e90d4cb6-868b-48a3-9b1c-5a7f2083102d",
"versionNumber": 8,
"settings": {
"hasDeclineButton": false,
"actionButtonAlignment": "left",
"mustRead": false,
"mustView": false,
"requireAccept": false,
"downloadable": true,
"sendToEmail": false,
"brandId": "68cbc4b1-a78f-4e72-889e-0554141da176",
"format": "inline",
"documentDisplay": "document"
}
}
],
"beginCreatedOn": "2019-01-01T00:00:00Z",
"page": 0,
"pageSize": 40,
"minimumPagesRemaining": 0
}
When I navigate to the Manage Clickwraps page in the Docusign website, I'm able to download the certificate associated with the agreement. If I enabled the recipient to download the agreement, they are also able to download it after agreeing.
For context, I need to store a copy of every user's agreement certificate in the back end.
Upvotes: 0
Views: 74
Reputation: 1380
Thank you for reporting this. This appears to be a bug with Clickwraps -- which I will report internally to have addressed. In the meantime, I was able to reproduce this issue, and can confirm that the document nodes are indeed coming back blank if hitting the user agreement in any form.
However, I was able to find this: In the call you're already making, you can see in the response there's parameter for agreementId. I did some tinkering and found that if I hit this URI: "https://demo.docusign.net/clickapi/v1/accounts/{ACCOUNTID}/clickwraps/{clickwrapID}/agreements/{agreementId}/download?include_coc=true", I was able to download the PDF associated with that agreement. The url parameter for include coc determines if the additional certificate of completion is added onto the PDF.
Upvotes: 2