Docusign | Can we add custom field in to the document at specific position through API? - docusignapi

I am trying to add a custom field when I create an envelope and pass the one custom field. Is there any way to add a custom field in the document?
Is there any API Endpoint which we need to use?

Here's some helpful documentation for adding Custom fields to an envelope via the DocuSign API:
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopecustomfields/
For example you can POST to this URL:
/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/custom_fields
And here's an example Body depending on if you want to use a text custom field or a list:
{
"textCustomFields": [
{
"fieldId": "sample string 1",
"name": "sample string 2",
"show": "sample string 3",
"required": "sample string 4",
"value": "sample string 5",
"configurationType": "sample string 6"
}
],
"listCustomFields": [
{
"listItems": [
"sample string 1"
],
"fieldId": "sample string 1",
"name": "sample string 2",
"show": "sample string 3",
"required": "sample string 4",
"value": "sample string 5",
"configurationType": "sample string 6"
}
]
}

Related

How to add image in a documents in DocuSign

Am trying to add image in my docusign documents via Curl.
I think i have to use signerAttachment parameter.
Assuming my image is http://sample.com/myphoto.png. Where do I add it as per code below. Or what is the best solution to achieve that
"signerAttachmentTabs": [
{
"name": "sample string 1",
"tabLabel": "sample string 2",
"scaleValue": 1.1,
"optional": "sample string 3",
"documentId": "sample string 4",
"recipientId": "sample string 5",
"pageNumber": "sample string 6",
"xPosition": "sample string 7",
"yPosition": "sample string 8",
"anchorString": "sample string 9",
"anchorXOffset": "sample string 10",
"anchorYOffset": "sample string 11",
"anchorUnits": "sample string 12",
"anchorIgnoreIfNotPresent": "sample string 13",
"anchorCaseSensitive": "sample string 14",
"anchorMatchWholeWord": "sample string 15",
"anchorHorizontalAlignment": "sample string 16",
"tabId": "sample string 17",
"templateLocked": "sample string 18",
"templateRequired": "sample string 19",
"conditionalParentLabel": "sample string 20",
"conditionalParentValue": "sample string 21",
"customTabId": "sample string 22",
"mergeField": {},
"tooltip": "sample string 23",
"tabOrder": "sample string 24",
"tabGroupLabels": [
"sample string 1"
]
}
],
So, you can add an image just like you add any other document, be it a PDF or HTML or anything. The image will be in its own page, not embedded in some other doc.
Looking at the image you posted, you may be trying to embed this inside an existing document, and that cannot be done using attachments.
You could use a special type of tab called drawing tab, which allows for embedding drawings, graphics, images etc. inside a document.
Right now the content of the drawing tab cannot be set via the API

How to update the user's street address using the DocuSign Admin API

How do I update a user's street address using the DocuSign Admin API? I have searched the documentation and can't seem to find this anywhere:
Admin API Reference
I have traced the HTTP calls that the Admin API UI uses, but unfortunately DocuSign uses v1 of the API for their UI, and only reference v2 in their documentation.
In the v1 API, if you update a user's street address you would get a POST like the following:
POST https://admindemo.docusign.com/organizationapi/management/v1/organizations/{organizationId}/accounts/{accountId}/users/{userId}/address
What is the equivalent in the v2 Admin API?
Based on the information that you and I both have right now, you cannot do that using the DocuSign Admin API.
You can, however, do this using the eSignature API.
This endpoint :
PUT /restapi/v2.1/accounts/{accountId}/users/{userId}
Take both home and work addresses (though not sure where you can see them in the UI differently). Here is a JSON snippet that is part of the body for updating a user:
"workAddress": {
"address1": "sample string 1",
"address2": "sample string 2",
"city": "sample string 3",
"stateOrProvince": "sample string 4",
"postalCode": "sample string 5",
"phone": "sample string 6",
"fax": "sample string 7",
"country": "sample string 8"
},
"homeAddress": {},
"loginStatus": "sample string 22",
"passwordExpiration": "sample string 23",
"lastLogin": "sample string 24",
"sendActivationEmail": "sample string 25",
"customSettings": [
{}
],

How to return results from Azure Search order by values of a given field

below is a example of the search results returned from Azure Search after searching for everything in the gift department (default)
{
"id": "1",
"type": "trousers",
"department": "gift",
"description": "This is the description of the item"
}
{
"id": "2",
"type": "toy",
"department": "gift",
"description": "This is the description of the item"
}
{
"id": "3",
"type": "shirt",
"department": "gift",
"description": "This is the description of the item"
}
The result set required should be ordered by type in this order- toy,shirt,trousers. As you can see the result is not a simple orderby "type" field asc/desc. the expected result should be
{
"id": "2",
"type": "toy",
"department": "gift",
"description": "This is the description of the item"
}
{
"id": "3",
"type": "shirt",
"department": "gift",
"description": "This is the description of the item"
}
{
"id": "1",
"type": "trousers",
"department": "gift",
"description": "This is the description of the item"
}
How do i go about doing this - written descriptions and/or code snippets would be fine?
Assuming you're using .Net SDK for performing the search, you can use OrderBy property of SearchParameters to define the ordering criteria.
Assuming your type field is sortable, you can try something like:
var searchParameters = new SearchParameters();
searchParameters.OrderBy = new List<string>()
{
"type desc"
};

How can I format a JSON with MongoDB to be use with Highcharts?

This is my end-point:
I have a JSON that look like this:
{
"_id": "5d30c48e5fb507250bb5",
"user": "5d2f594180064d82c47c",
"department_director": "Director 1",
"account_manager": "Account Manager 1",
"fronter": "Fronter 2",
"closer": "Closer 1",
"order_number": "EDVRV20202020202",
"business_name": "Business Name 3",
"business_website": "www.businessname3.com",
"client_name": "Client 3",
"client_phone": 9090909090,
"client_email": "email1#company.com",
"type_of_service": "Other",
"management_fee": 599, //I will use this objects
"sales_date": "2017-04-23T00:00:00.000Z",
"cancellation_date": "2018-04-23T00:00:00.000Z", // I will use this object,
"country": "USA",
"state": "Florida",
"cancellation_reason": "Business Closed",
},
And, I want to plot the following graph using type_of_service as a legend, cancellation_date as a x-axis and management_fee and a y_axi.

There is any way to add custom fields (checkbox) to a PDF contract dynamically using the Docusign REST API?

We are generating a PDF contract in out custom code, and then we are sending this PDF file to be signed by the end customer through Docusign REST API.
Thanks works fine. Now we need the customer to fill (or not) some checkboxes inside the PDF file at the same time they are signin the document.
We need to add this checkboxes dynamically from our code, because they are not always the same ones.
I attach an image with an example, we want to do the same we do when we create mannualy a template, but in this case is not inside the template, is inside the document already created outside Docusign.enter image description here
You could look into the auto-place feature.
If you set a specific string of text in your pdf document it will place a tab every time that it finds that text in the document. If you want that text to be hidden from the end user you could use white text on white background.
Here is some info in how this works in the DocuSign UI.
https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience
On the API side they refer to this feature as anchor tabs.
If you want to specify this via the API whenever you create a tab just specify that anchorString value and DocuSign will create a tab for you at each location that it finds the string.
There are a few more properties that allow you to move the anchor tab based on the anchor string so you can define the offsets if you want the tab to be move a specific amount of pixels in the x or y direction.
I hope this helps!
"checkboxTabs": [
{
"name": "sample string 1",
"tabLabel": "sample string 2",
"selected": "sample string 3",
"shared": "sample string 4",
"requireInitialOnSharedChange": "sample string 5",
"required": "sample string 6",
"locked": "sample string 7",
"documentId": "sample string 8",
"recipientId": "sample string 9",
"pageNumber": "sample string 10",
"xPosition": "sample string 11",
"yPosition": "sample string 12",
"anchorString": "sample string 13",
"anchorXOffset": "sample string 14",
"anchorYOffset": "sample string 15",
"anchorUnits": "sample string 16",
"anchorIgnoreIfNotPresent": "sample string 17",
"anchorCaseSensitive": "sample string 18",
"anchorMatchWholeWord": "sample string 19",
"anchorHorizontalAlignment": "sample string 20",
"tabId": "sample string 21",
"templateLocked": "sample string 22",
"templateRequired": "sample string 23",
"conditionalParentLabel": "sample string 24",
"conditionalParentValue": "sample string 25",
"customTabId": "sample string 26",
"mergeField": {},
"status": "sample string 27",
"tooltip": "sample string 28",
"errorDetails": {
"errorCode": "SUCCESS",
"message": ""
},
"tabOrder": "sample string 29",
"tabGroupLabels": [
"sample string 1"
]
}
],

Resources