I am working with DocuSign custom fields. I want to get all my custom fields that were created in the admin console by using a REST API call.
Is there any REST call to get all the custom fields?
I believe you're wanting the information that you've set up displayed in JSON via REST.
endpoint: GET https://{server}/restapi/v2/accounts/{accountId}/custom_fields
This will return your textCustomFields and listCustomFields
Related
Trying to send from a DS template that has a required envelope custom field. From documentation I'd expect a Custom Field selection under envelopeId but not finding it.
Is this supported in the DS API explorer? Thanks!
Error code: ENVELOPE_CUSTOM_FIELD_MISSING.
Message: A required envelope custom field is missing. The custom field 'Cost Center' requires a value.
You can use this API call - https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopecustomfields/create/
So, you may need 3 API calls:
Create envelope in "draft" status.
Add custom fields.
Send it.
There may be a way to do this with fewer API calls, but I don't know how.
I want to assign a text field(read only) dynamically from code, separate for each recipient in a multi recipient embedded DocuSign using rest api (PHP SDK). How to do that using template role and tabs in php? or
How can I restrict certain fields from being viewed by specific recipients?
So your last question and the "single document" means you cannot use the DocuSign Visibility feature of DocuSign, I assume you know about that.
So, you can have readonly fields and you can have them assign to specific recipients, but other recipients will see them too.
You can also use pre-filled fields that enables to have a field that is not for any recipient and your code can fill it in.
What I recommend is this, since you need a template anyway. Create your template using the web app, make sure it works as you expect by trying it and sending documents to yourself using it.
Once you got it all working as expected in the web app, using the API is not that hard, all you have to do is get API logs of what the web app did using the API and you can do the same.
I am trying to access the custom field values for documents that I download. I am able to list the completed envelopes and download the documents, but the custom fields are showing up as empty?
var docFields = envelopeApi.ListDocumentFields(AccountID, envelopeId, docId);
Console.WriteLine(docFields.DocumentFields.Count);
Count is always zero even though the custom fields have been filled in by the user?
The endpoint which you calling is to download the document custom fields which is added by the sender as the metadata of the document. It will not help you in downloading the form data entered by the signer on the document. To download form data via API, you can use GET /v2/accounts/{accountId}/envelopes/{envelopeId}/form_data, more details available at getFormData DS Docs. You can also use to download tab details for the recipients using GET /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs, more details available at Download Recipient tab data
Most recommended way is to setup DS Connect so that you do not have to poll DS API to get envelope status or form data etc, instead host a webservice on your side and configure the same in DocuSign so that DocuSign can push the required data to your webservice in an XML format.
The docusign website allows for me to save a document as a template, but I have not been able to find a way to do this programmatically through the API. Is there a simple way to save a document as a template?
Yes, you can create a Template via the API by issuing this request:
POST /v2/accounts/{accountId}/templates
The API documentation contains details about this operation.
UPDATE
Do I understand correctly that your goal is to create a Template that's based upon an existing DocuSign Document, i.e., to mimic the following functionality in the DocuSign web UI?
If that's the case, then I'm not aware of any single API call that can do this. Instead, I believe you'll need to issue a series of API calls, to retrieve info about the existing Document(s) and then create the new Template using that info:
1) Get information about the existing DocuSign Document (envelope): GET /v2/accounts/{accountId}/envelopes/{envelopeId} (docs)
This operation returns recipient info (including tabs for each recipient) as well as envelope data like email subject, email body, reminders, etc. It also returns a documentsUri property that you can use to get the document(s) that belong to the envelope.
2) Get the list of document(s) that the envelope contains by issuing a GET request to the URI specified by the documentsUri from the prior response. (docs)
This operation returns information about each document in the specified envelope, but does not return document contents.
3) For each document listed in the prior API response, issue a GET request to the URI specified by the uri property for the document. (docs)
4) Finally, create a new Template using the data that you received in response to the previous API requests: POST /v2/accounts/{accountId}/templates (docs)
Note: As a final note -- if you're using one of the DocuSign SDKs, it's possible that there might be a function that you can call to implement this scenario, without having to piece together all of these API calls yourself. I'm not familiar enough with the SDKs to say whether or not they provide this type of functionality, but it'd be worth checking for, if you're using an SDK.
I am using Docusign package in my org. By using a custom buttom I am able to send a record for docusign approval. In this i set Source Id as record Id and track the status in a custom field on that record. But now I m using Docusign SOAP API and sending a record for docusign via Apex. But now I am unable to set envelope external source id in code and therefore status is not getting updated in that record.
Please reply if anyone has any idea how to set source id via apex and track status?
The best way to do this is to create an envelope custom field in your API call for the recordID and pass that through in your APEX code. The DocuSign for Salesforce manage package does this automatically and that's how the data gets written back to the correct records using Connect.
Create the envelope custom field in DocuSign and then add the CustomField Schema Type to your API call and populate it with the source ID. Then in Connect under the DocuSign Status Object map that Custom Field back to either the five out of the box objects or your custom object.