### Get User Details using Python Source: https://developers.boldsign.com/users/get-user-details.md This Python example shows how to retrieve user information. It requires the boldsign library and configuration with your API key and host. ```python import boldsign configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: user_api = boldsign.UserApi(api_client) user_details = user_api.get_user(user_id="YOUR_USER_ID") ``` -------------------------------- ### Get User Details using Java Source: https://developers.boldsign.com/users/get-user-details.md This Java example shows how to get user details. Configure the API client with the base path and your API key, then instantiate the UserApi. ```java ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("https://api.boldsign.com"); client.setApiKey("YOUR_API_KEY"); UserApi userApi = new UserApi(client); UserProperties userDetails = userApi.getUser("YOUR_USER_ID"); ``` -------------------------------- ### Create Template using Python SDK Source: https://developers.boldsign.com/template/create-template?region=eu Example of creating a template using the BoldSign Python SDK. This shows the setup and usage for the template creation function. ```APIDOC ## create_template (Python SDK) ### Description Uses the BoldSign Python SDK to create a new template. ### Method `template_api.create_template(create_template_request)` ### Parameters #### `CreateTemplateRequest` Object - **title** (str) - Required - The title of the template. - **documentTitle** (str) - Optional - The title of the document within the template. - **roles** (List[TemplateRole]) - Optional - Defines the roles for signers. - **index** (int) - Required - The order of the role. - **name** (str) - Required - The name of the role. - **defaultSignerName** (str) - Optional - The default name for the signer. - **defaultSignerEmail** (str) - Optional - The default email for the signer. - **signerType** (str) - Required - The type of signer. - **formFields** (List[FormField]) - Optional - Fields to be placed on the document. - **fieldType** (str) - Required - The type of form field. - **page_number** (int) - Required - The page number where the field is located. - **bounds** (Rectangle) - Required - The position and size of the field. - **x** (int) - Required - The X-coordinate. - **y** (int) - Required - The Y-coordinate. - **width** (int) - Required - The width of the field. - **height** (int) - Required - The height of the field. - **files** (List[str]) - Required - A list of file paths for the document(s). ### Request Example ```python configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: template_api = boldsign.TemplateApi(api_client) form_field = boldsign.FormField( fieldType="Signature", page_number=1, bounds=boldsign.Rectangle(x=50, y=100, width=100, height=60)) role = boldsign.TemplateRole( index=1, name="Hr", defaultSignerName="Alex Gayle", defaultSignerEmail="alexgayle@boldsign.dev", signerType="Signer", formFields=[form_field]) create_template_request = boldsign.CreateTemplateRequest( title="title of the template", documentTitle= "title of the document", roles=[role], files=["YOUR_FILE_PATH"]) template_created = template_api.create_template(create_template_request=create_template_request) ``` ``` -------------------------------- ### Create Template using PHP SDK Source: https://developers.boldsign.com/template/create-template?region=eu Example of creating a template using the BoldSign PHP SDK. This covers the necessary setup and object instantiation for the API call. ```APIDOC ## createTemplate (PHP SDK) ### Description Uses the BoldSign PHP SDK to create a new template. ### Method `$template_api->createTemplate([$create_template])` ### Parameters #### `CreateTemplateRequest` Object - **Title** (string) - Required - The title of the template. - **DocumentTitle** (string) - Optional - The title of the document within the template. - **Roles** (array of TemplateRole objects) - Optional - Defines the roles for signers. - **Index** (int) - Required - The order of the role. - **Name** (string) - Required - The name of the role. - **DefaultSignerName** (string) - Optional - The default name for the signer. - **DefaultSignerEmail** (string) - Optional - The default email for the signer. - **SignerType** (string) - Required - The type of signer. - **FormFields** (array of FormField objects) - Optional - Fields to be placed on the document. - **FieldType** (string) - Required - The type of form field. - **PageNumber** (int) - Required - The page number where the field is located. - **Bounds** (Rectangle object) - Required - The position and size of the field. - **X** (float) - Required - The X-coordinate. - **Y** (float) - Required - The Y-coordinate. - **Width** (float) - Required - The width of the field. - **Height** (float) - Required - The height of the field. - **Files** (array of strings) - Required - A list of file paths for the document(s). ### Request Example ```php setHost('https://api-eu.boldsign.com'); $config->setApiKey('YOUR_API_KEY'); $template_api = new TemplateApi($config); $form_field = new FormField(); $form_field->setFieldType('Signature'); $form_field->setPageNumber(1); $bounds = new Rectangle([50, 100, 100, 60]); $form_field->setBounds($bounds); $role = new TemplateRole(); $role->setIndex(1); $role->setName('HR'); $role->setDefaultSignerName('Alex Gayle'); $role->setDefaultSignerEmail('alexgayle@boldsign.dev'); $role->setSignerType('Signer'); $role->setFormFields([$form_field]); $create_template = new CreateTemplateRequest(); $create_template->setTitle('Document SDK API'); $create_template->setDocumentTitle('title of the document'); $create_template->setRoles([$role]); $create_template->setFiles(['YOUR_FILE_PATH']); $template_created = $template_api->createTemplate([$create_template]); ``` ``` -------------------------------- ### Get Team Details using PHP Source: https://developers.boldsign.com/teams/get-team-details.md This PHP example shows how to get team details with the Boldsign API. Ensure you have installed the SDK via Composer and provided your API key and team ID. ```php setHost('https://api.boldsign.com'); $config->setApiKey('YOUR_API_KEY'); $teams_api = new TeamsApi($config); $team_details = $teams_api->getTeam($team_id = 'YOUR_TEAM_ID'); ``` -------------------------------- ### Initialize API Client and List Templates (Python) Source: https://developers.boldsign.com/authentication/api-key?region=eu This Python example shows how to set up the BoldSign configuration with the EU host and your API key. It then uses the ApiClient to instantiate a TemplateApi object and retrieve a list of templates. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: template_api = boldsign.TemplateApi(api_client) template_list = template_api.list_templates(page=1) ``` -------------------------------- ### Initialize API Client and Template Client Source: https://developers.boldsign.com/how-to-guides/how-to-set-additional-form-fields-to-existing-template?region=eu Set up the API client with your endpoint and API key, then initialize the template client. ```csharp var apiClient = new ApiClient("https://api-eu.boldsign.com", "{Your API key}"); var templateClient = new TemplateClient(apiClient); ``` -------------------------------- ### Example API Response for Get API Credits Count Source: https://developers.boldsign.com/plan/planapicredits?region=eu This is an example of a successful response when retrieving API credit balance, indicating the number of credits available. ```json { "BalanceCredits": 100 } ``` -------------------------------- ### Get Identity Verification Report (JavaScript) Source: https://developers.boldsign.com/identity-verification/verification-report?region=eu This JavaScript example shows how to get an identity verification report. Initialize the IdentityVerificationApi with your base URL and set your API key. ```javascript import { IdentityVerificationApi, VerificationDataRequest} from "boldsign"; const identityVerificationApi = new IdentityVerificationApi("https://api-eu.boldsign.com") identityVerificationApi.setApiKey("YOUR_API_KEY"); var data_request = new VerificationDataRequest(); data_request.emailId = "luthercooper@cubeflakes.com"; data_request.countryCode = "+91"; data_request.phoneNumber = "8973782972"; var verification_report = identityVerificationApi.report("YOUR_DOCUMENT_ID",data_request); ``` -------------------------------- ### Initialize API Client and List Templates (Java) Source: https://developers.boldsign.com/authentication/api-key?region=eu This Java example shows how to configure the default API client with the EU base path and your API key. It then uses the TemplateApi to retrieve a list of templates, specifying the page number. ```java ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("https://api-eu.boldsign.com"); client.setApiKey("YOUR_API_KEY"); TemplateApi templateApi = new TemplateApi(client); int page = 1; TemplateRecords templateList = templateApi.listTemplates(page, null, null, null, null, null, null, null, null, null); ``` -------------------------------- ### Get Document Properties (JavaScript/Node.js) Source: https://developers.boldsign.com/how-to-guides/extend-the-expiry-date-of-the-document?region=eu This JavaScript example uses Axios to make a GET request to retrieve document properties. Configure the `documentId` and `X-API-KEY` headers appropriately. ```javascript const axios = require('axios'); const response = axios.get('https://api-eu.boldsign.com/v1/document/properties', { params: { 'documentId': '{documentId}' }, headers: { 'accept': 'application/json', 'X-API-KEY': '{your API key}' } }); ``` -------------------------------- ### Create Team using Java Source: https://developers.boldsign.com/teams/create-team?region=us This Java example demonstrates creating a team using the BoldSign API client. Ensure the ApiClient is configured with your base path and API key. ```java ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("https://api.boldsign.com"); client.setApiKey("YOUR_API_KEY"); TeamsApi teamsApi = new TeamsApi(client); CreateTeamRequest createTeamRequest = new CreateTeamRequest(); createTeamRequest.setTeamName("HR"); TeamCreated teamCreated = teamsApi.createTeam(createTeamRequest); ``` -------------------------------- ### Create User with PHP SDK Source: https://developers.boldsign.com/users/create-user?region=eu This PHP example shows how to create a user with the BoldSign SDK. Set up the configuration with the EU API endpoint and your key, then use the UserApi to send the creation request. ```php setHost('https://api-eu.boldsign.com'); $config->setApiKey('YOUR_API_KEY'); $user_api = new UserApi($config); $create_user_request = new CreateUser(); $create_user_request->setEmailId('luthercooper@cubeflakes.com'); $create_user_request->setTeamId('YOUR_TEAM_ID'); $create_user_request->setUserRole('Member'); $user_created = $user_api->createUser([$create_user_request]); ``` -------------------------------- ### Create Brand using .NET SDK Source: https://developers.boldsign.com/branding/create-brand?region=eu This C# example demonstrates how to create a brand using the BoldSign .NET SDK. It requires initializing the ApiClient and BrandingClient with your API key and endpoint. ```csharp var apiClient = new ApiClient("https://api-eu.boldsign.com", "Your_API_Key"); var brandingClient = new BrandingClient(apiClient); var brandSettings = new BrandSettings() { BrandName = "Syncfusion", BrandLogo = new ImageFileBytes() { ContentType = "image/png", FileBytes = File.ReadAllBytes("YOUR_FILE_PATH"), }, ShowBuiltInFormFields = true }; BrandingData brandCreated = brandingClient.CreateBrand(brandSettings); string brandId = brandCreated.BrandId; ``` -------------------------------- ### Example JSON Response for Get Team Details Source: https://developers.boldsign.com/teams/get-team-details?region=us This is an example of a successful JSON response when retrieving team details. It includes the team ID, name, user list, and creation/modification dates. ```json { "teamId": "a5016cef-xxxx-xxxx-xxxx-98fed2183b5c", "teamName": "HR", "users": [ __{ "userId": "04029917-xxxx-xxxx-xxxx-33835939d021", "email": "alexgayle@cubeflakes.com", "firstName": "Alex Gayle", "lastName": "k", "userRole": "TeamAdmin", "userStatus": "Active" } ], "createdDate": 1635942532, "modifiedDate": 1635942532 } ``` -------------------------------- ### Install Java SDK Locally with Maven Source: https://developers.boldsign.com/sdks/java-sdk.md Execute this command to install the API client library to your local Maven repository. ```shell mvn clean install ``` -------------------------------- ### Get User Details using cURL Source: https://developers.boldsign.com/users/get-user-details.md Use this cURL command to make a GET request to retrieve user details. Ensure you replace '{your API key}' and the example userId with your actual credentials. ```shell curl -X 'GET' \ 'https://api.boldsign.com/v1/users/get?userId=e892ea92-xxxx-xxxx-xxxx-bbdbcaa5xxxx' \ -H 'accept: application/json' \ -H 'X-API-KEY: {your API key}' \ ``` -------------------------------- ### List Teams using Java SDK Source: https://developers.boldsign.com/teams/list-teams?region=eu This Java example shows how to configure the API client and list teams. Set the base path to the EU endpoint and provide your API key. ```java ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("https://api-eu.boldsign.com"); client.setApiKey("YOUR_API_KEY"); TeamsApi teamsApi = new TeamsApi(client); int page = 1; TeamListResponse teamList = teamsApi.listTeams(page, null, null); ``` -------------------------------- ### Send Document with Checkbox Field (Node.js) Source: https://developers.boldsign.com/how-to-guides/set-checkbox-field-checked-and-read-only-by-default?region=eu This Node.js example uses axios and form-data to send a document with a checkbox field set to checked and read-only. Ensure you have these packages installed (`npm install axios form-data`). ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Signers', '{\r\n "name": "hanky",\r\n "emailAddress": "hankyWhites@gmail.com",\r\n "signerType": "Signer",\r\n "signerRole": "Signer",\r\n "formFields": [\r\n {\r\n "id": "CheckBox",\r\n "name": "CheckBox",\r\n "fieldType": "CheckBox",\r\n "value": "on",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 200,\r\n "y": 200,\r\n "width": 25,\r\n "height": 25\r\n },\r\n "isReadOnly": true\r\n}\r\n ],\r\n "locale": "EN"\r\n}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', "Sample Document"); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api-eu.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Send Document from Template with Prefilled Fields (Node.js) Source: https://developers.boldsign.com/how-to-guides/how-to-prefill-label-field-when-sending-document-from-template.md This Node.js example uses the axios library to send a document from a template and prefill form fields. Make sure to install axios using 'npm install axios'. ```javascript const axios = require('axios'); async function GetData(){ try{ const response = await axios.post( 'https://api.boldsign.com/v1/template/send', { 'roles': [ { 'roleIndex': 1, 'signerName': 'Richard', 'signerEmail': 'richards@cuberflakes.com', 'existingFormFields': [ { 'id': 'State', 'value': 'North Carolina' } ] }, ], title: "Simple document", message: "Kindly review and sign this.", }, { params: { 'templateId': '6357f511-xxxx-xxxx-8235-7a43be83cffc', }, headers: { 'accept': 'application/json', 'X-API-KEY': '{your API Key}', 'Content-Type': 'application/json;odata.metadata=minimal;odata.streaming=true' } } ); console.log(JSON.stringify(response.data)); return response; } catch (error) { console.error('Error:', error.message); throw error; } } GetData(); ``` -------------------------------- ### Get Brand API Response Example Source: https://developers.boldsign.com/branding/get-brand?region=eu This is a sample JSON response for a successful (200 OK) request to the Get Brand API. It includes details like brand ID, logo, name, colors, and various settings. ```json { "brandId": "41b7483d-95de-4bd2-8c29-d56ba84c8e69", "brandLogo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABKYAAAfQCAIAAAB378DwAAAMNmlDQ1BEaXNwbGF5AABIiaVXd1hT2RI/ ...... ...... +CYpgliBiX0ifrh7dbvEGCfbIXacAAAAASUVORK5CYII=", "brandName": "Syncfusion", "backgroundColor": "Red", "buttonColor": "Green", "buttonTextColor": "White", "emailDisplayName": "{SenderName} from Syncfusion", "disclaimerTitle": "", "disclaimerDescription": "", "redirectUrl": "http://syncfusion.com/", "isDefault": true, "canHideTagLine": false, "combineAuditTrail": true, "combineAttachments": true, "emailSignedDocument": "Attachment", "documentTimeZone": "+05:30", "showBuiltInFormFields": true, "allowCustomFieldCreation": false, "showSharedCustomFields": false, "hideDecline": false, "hideSave": false, "excludeAuditTrailFromEmail": false, __"DocumentExpirySettings": { "expiryDateType": "Days", "expiryValue": 60, "enableDefaultExpiryAlert": false, "enableAutoReminder": false, "reminderDays": 3, "reminderCount": 5 }, __"customDomainSettings": { "domainName": "mail.cubeflakes.com", "fromName": "notification" }, "isDomainVerified": false } ``` -------------------------------- ### List Teams using Python SDK Source: https://developers.boldsign.com/teams/list-teams?region=eu This Python example shows how to configure the BoldSign client and fetch a list of teams. Replace 'YOUR_API_KEY' with your actual key. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: teams_api = boldsign.TeamsApi(api_client) team_list = teams_api.list_teams(page=1) ``` -------------------------------- ### Initialize Document API Client (Python) Source: https://developers.boldsign.com/documents/edit-document?region=eu This Python snippet shows how to set up the BoldSign API client and initialize the Document API for interacting with document-related operations. Replace 'YOUR_API_KEY' with your actual API key. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: document_api = boldsign.DocumentApi(api_client) document_file = EditDocumentFile( edit_action="Add", file='tests/documents/agreement.pdf ) ``` -------------------------------- ### ApplicationId Property Source: https://developers.boldsign.com/sdk/dotnet/class-reference/BoldSign.Model.DocumentProperties.html Gets or sets the application's client ID, used to identify the application making the request. This is a GUID. ```csharp [DataMember(Name = "applicationId", EmitDefaultValue = false)] public string ApplicationId { get; set; }__ ``` -------------------------------- ### Get Embedded Signing Link using JavaScript (axios) Source: https://developers.boldsign.com/how-to-guides/How-to-request-the-signatures-without-email-notifications?region=eu This JavaScript example uses axios to make a GET request to retrieve the embedded signing link. It includes the API key in the headers and the document ID and signer email as parameters. ```javascript const response1 = await axios.get("https://api-eu.boldsign.com/v1/document/getEmbeddedSignLink", { headers: { 'X-API-KEY': '{Your API key}' }, params: { documentId: response.data.documentId, signerEmail: "david@cubeflakes.com" }, }); console.log(response1.data.signLink); ``` -------------------------------- ### Create Contact using Python Source: https://developers.boldsign.com/contacts/create-contact?region=eu This Python example shows how to create contacts with the BoldSign SDK. Configure the API client with your host and API key, then instantiate the ContactsApi to make the call. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: contacts_api = boldsign.ContactsApi(api_client) contact_details = boldsign.ContactDetails( email="luthercooper@cubeflakes.com", name="LutherCooper") contact_created = contacts_api.create_contact([contact_details]) ``` -------------------------------- ### Install Node.js SDK Source: https://developers.boldsign.com/sdks/node-sdk.md Install the BoldSign Node SDK package in your project using npm. ```shell npm install boldsign ``` -------------------------------- ### ImageInfo AllowedFileExtensions Property Source: https://developers.boldsign.com/sdk/dotnet/class-reference/BoldSign.Model.ImageInfo.html Gets or sets the allowed file extensions for images. Example: ".jpg,.jpeg,.png". ```csharp [DataMember(Name = "allowedFileExtensions", EmitDefaultValue = false)] public string AllowedFileExtensions { get; set; }__ ``` -------------------------------- ### Initialize BoldSign Client (Python) Source: https://developers.boldsign.com/identity-verification/sandbox-mode.md This Python snippet shows the basic initialization of the BoldSign client. Further code would be needed to send documents with identity verification. ```python import boldsign ``` -------------------------------- ### Get Document Properties using PHP Source: https://developers.boldsign.com/documents/document-details-and-status.md This PHP snippet shows how to get document properties via the BoldSign API. Ensure you have the SDK installed via Composer. Set your API key and host, then retrieve the properties using the document ID. ```php setHost('https://api.boldsign.com'); $config->setApiKey('YOUR_API_KEY'); $document_api = new DocumentApi($config); $document_properties = $document_api->getProperties($document_id = 'YOUR_DOCUMENT_ID'); ``` -------------------------------- ### RoleRemovalIndices Property Source: https://developers.boldsign.com/sdk/dotnet/class-reference/BoldSign.Api.Model.MergeAndSendForSign.html Sets the indices of roles to be removed, starting from 1. For example, to remove roles 2 and 3, use new []{2,3}. ```csharp [DataMember(Name = "roleRemovalIndices", EmitDefaultValue = false)] public int[] RoleRemovalIndices { get; set; }__ ``` -------------------------------- ### Initialize API Client and List Templates (C#) Source: https://developers.boldsign.com/authentication/api-key?region=eu This C# snippet demonstrates how to initialize the API client with the EU endpoint and an API key, then use the TemplateClient to list templates. Ensure the ApiClient is configured with the correct host and API key. ```csharp var apiClient = new ApiClient("https://api-eu.boldsign.com", "Your_API_Key"); var templateClient = new TemplateClient(apiClient); var templateList = templateClient.ListTemplates(1); ``` -------------------------------- ### List Documents using Python SDK Source: https://developers.boldsign.com/documents/list-documents?region=eu This Python example shows how to configure the BoldSign SDK and retrieve a list of documents. Remember to set your API key and the correct host URL. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: document_api = boldsign.DocumentApi(api_client) document_list = document_api.list_documents(page=1) ``` -------------------------------- ### Send Document with Auto-Reminders (Node.js) Source: https://developers.boldsign.com/how-to-guides/how-to-remind-the-signers-to-sign-the-document-automatically?region=us This Node.js example uses Axios and FormData to send a document with automatic reminders. Ensure you have the necessary libraries installed. ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Signers', '{\r\n "name": "Hanky",\r\n "emailAddress": "hankyWhites@cubeflakes.com",\r\n "signerType": "Signer", \r\n "signerRole": "Signer",\r\n "formFields": [\r\n {\r\n "id": "signature",\r\n "name": "signature",\r\n "fieldType": "Signature",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 100,\r\n "y": 100,\r\n "width": 125,\r\n "height": 25\r\n },\r\n "isRequired": true\r\n }\r\n ],\r\n "locale": "EN"}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', 'Agreement'); data.append('ReminderSettings.EnableAutoReminder', 'true'); data.append('ReminderSettings.ReminderDays', '4'); data.append('ReminderSettings.ReminderCount', '3'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Download Audit Trail using Python Source: https://developers.boldsign.com/documents/download-audit-trail.md This Python example demonstrates downloading an audit log. It requires the boldsign library and your API key. ```python import boldsign configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: document_api = boldsign.DocumentApi(api_client) document_stream = document_api.download_audit_log(document_id="YOUR_DOCUMENT_ID") ``` -------------------------------- ### Send Document with Brand using NodeJS Source: https://developers.boldsign.com/how-to-guides/apply-brand-to-the-documents-using-API.md This NodeJS example uses `axios` and `form-data` to send a document for signature with branding. Ensure you have these packages installed. ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('BrandId', '{Your Brand Id}'); data.append('Message', ''); data.append('Signers', '{\r\n "name": "Hanky",\r\n "emailAddress": "hankyWhites@cubeflakes.com",\r\n "signerType": "Signer",\r\n "formFields": [\r\n {\r\n "id": "string",\r\n "name": "string",\r\n "fieldType": "Signature",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 50,\r\n "y": 50,\r\n "width": 1,\r\n "height": 1\r\n },\r\n "isRequired": true\r\n }\r\n ],\r\n "locale": "EN"}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', '{title}'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Get API Credits Count using C# Source: https://developers.boldsign.com/plan/planapicredits.md Instantiate the ApiClient and PlanClient to retrieve the API credits count. Ensure you have the BoldSign SDK installed. ```csharp ApiClient apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key"); PlanClient planCredit = new PlanClient(apiClient); var billingViewModel = planCredit.GetApiCreditsCount(); ``` -------------------------------- ### Create Template using C# SDK Source: https://developers.boldsign.com/template/create-template?region=eu Example of creating a template using the BoldSign C# SDK. This demonstrates how to instantiate the SDK client and make the create template request. ```APIDOC ## CreateTemplate (C# SDK) ### Description Uses the BoldSign C# SDK to create a new template. ### Method `templateClient.CreateTemplate(templateRequest)` ### Parameters #### `CreateTemplateRequest` Object - **Title** (string) - Required - The title of the template. - **DocumentTitle** (string) - Optional - The title of the document within the template. - **Roles** (List) - Optional - Defines the roles for signers. - **Index** (int) - Required - The order of the role. - **Name** (string) - Required - The name of the role. - **DefaultSignerName** (string) - Optional - The default name for the signer. - **DefaultSignerEmail** (string) - Optional - The default email for the signer. - **SignerType** (SignerType) - Required - The type of signer. - **FormFields** (List) - Optional - Fields to be placed on the document. - **Id** (string) - Required - The unique identifier for the form field. - **Type** (FieldType) - Required - The type of form field. - **PageNumber** (int) - Required - The page number where the field is located. - **Bounds** (Rectangle) - Required - The position and size of the field. - **x** (float) - Required - The X-coordinate. - **y** (float) - Required - The Y-coordinate. - **width** (float) - Required - The width of the field. - **height** (float) - Required - The height of the field. - **Files** (List) - Required - The document file(s) to be used for the template. - **FilePath** (string) - Required - The path to the document file. - **ContentType** (string) - Required - The content type of the file (e.g., 'application/pdf'). ### Request Example ```csharp var apiClient = new ApiClient("https://api-eu.boldsign.com", "Your_API_Key"); var templateClient = new TemplateClient(apiClient); List formField = new List { new FormField( id: "Signature", type: FieldType.Signature, pageNumber: 1, bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30)) }; var templateRequest = new CreateTemplateRequest { Title = "Agreement", DocumentTitle = "title of the document", Roles = [ new TemplateRole() { Index = 1, Name = "HR", DefaultSignerName = "David", DefaultSignerEmail = "david@cubeflakes.com", SignerType = SignerType.Signer, FormFields = formField } ], Files = new List { new DocumentFilePath { ContentType = "application/pdf", FilePath = "YOUR_FILE_PATH", } }, }; var templateCreated = templateClient.CreateTemplate(templateRequest); ``` ``` -------------------------------- ### List Brands using Python Source: https://developers.boldsign.com/branding/list-brands.md This Python example shows how to retrieve brand information using the BoldSign library. It involves setting up the API configuration and client. ```python import boldsign configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: branding_api = boldsign.BrandingApi(api_client) branding_records = branding_api.brand_list() ``` -------------------------------- ### Making an HTTP Request with OAuth2 Access Token (Python) Source: https://developers.boldsign.com/authentication/oauth-2-0?region=us Example of using the requests library in Python to make an authenticated GET request with an Authorization header. ```python import requests url = "https://api.boldsign.com/v1/document/list" payload={} headers = { 'Authorization': 'Bearer eyJhbGciOiJSUz...' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` -------------------------------- ### Install Latest Python SDK Source: https://developers.boldsign.com/sdks/python-sdk?region=us Install the latest stable version of the BoldSign Python SDK using pip. ```bash pip install boldsign ``` -------------------------------- ### Install Composer Dependencies Source: https://developers.boldsign.com/sdks/php-sdk?region=us After adding the SDK to your composer.json file, run this command in your terminal to download and install all project dependencies, including the BoldSign SDK. ```bash composer install ``` -------------------------------- ### Create User with JavaScript SDK Source: https://developers.boldsign.com/users/create-user?region=eu This JavaScript example shows how to create a user using the BoldSign SDK. Instantiate the UserApi with the EU endpoint and set your API key, then call the createUser method. ```javascript import { UserApi, CreateUser } from "boldsign"; const userApi = new UserApi("https://api-eu.boldsign.com") userApi.setApiKey("YOUR_API_KEY"); var createUserRequest = new CreateUser(); createUserRequest.emailId = "luthercooper@cubeflakes.com"; createUserRequest.teamId = "YOUR_TEAM_ID"; createUserRequest.userRole = CreateUser.UserRoleEnum.Member; const userCreated = userApi.createUser([createUserRequest]); ``` -------------------------------- ### Send Document via Email using Node.js Axios Source: https://developers.boldsign.com/how-to-guides/request-signature-by-email?region=us This Node.js example uses `axios` and `form-data` to send a document for signature via email. It constructs a FormData object to include the message, signers, file, and title. Ensure you have `axios` and `form-data` installed (`npm install axios form-data`). ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Message', ''); data.append('Signers', '{\r\n "name": "Hanky",\r\n "emailAddress": "hankyWhites@cubeflakes.com",\r\n "signerType": "Signer", \r\n "deliveryMode": "Email",\r\n "formFields": [\r\n {\r\n "id": "string",\r\n "name": "string",\r\n "fieldType": "Signature",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 50,\r\n "y": 50,\r\n "width": 1,\r\n "height": 1\r\n },\r\n "isRequired": true\r\n }\r\n ],\r\n "locale": "EN"\r\n}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', '{title}'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Create Template using Python SDK Source: https://developers.boldsign.com/template/create-template?region=eu Example of creating a template with the BoldSign Python SDK. Ensure your API key and host are correctly configured. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: template_api = boldsign.TemplateApi(api_client) form_field = boldsign.FormField( fieldType="Signature", page_number=1, bounds=boldsign.Rectangle(x=50, y=100, width=100, height=60)) role = boldsign.TemplateRole( index=1, name="Hr", defaultSignerName="Alex Gayle", defaultSignerEmail="alexgayle@boldsign.dev", signerType="Signer", formFields=[form_field]) create_template_request = boldsign.CreateTemplateRequest( title="title of the template", documentTitle= "title of the document", roles=[role], files=["YOUR_FILE_PATH"]) template_created = template_api.create_template(create_template_request=create_template_request) ``` -------------------------------- ### Send Document with Default Checkbox (Node.js) Source: https://developers.boldsign.com/how-to-guides/set-checkbox-field-checked-and-read-only-by-default.md This Node.js example uses Axios and form-data to send a document with a pre-checked, read-only checkbox. Install 'axios' and 'form-data' packages. ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Signers', '{\r\n "name": "hanky",\r\n "emailAddress": "hankyWhites@gmail.com",\r\n "signerType": "Signer",\r\n "signerRole": "Signer",\r\n "formFields": [\r\n {\r\n "id": "CheckBox",\r\n "name": "CheckBox",\r\n "fieldType": "CheckBox",\r\n "value": "on",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 200,\r\n "y": 200,\r\n "width": 25,\r\n "height": 25\r\n },\r\n "isReadOnly": true\r\n}\r\n ],\r\n "locale": "EN"\r\n}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', "Sample Document"); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Create User with Python SDK Source: https://developers.boldsign.com/users/create-user?region=eu Use the BoldSign Python SDK to create users. Configure the API client with the EU host and your API key, then instantiate the UserApi to make the creation request. ```python import boldsign configuration = boldsign.Configuration(host = "https://api-eu.boldsign.com", api_key="YOUR_API_KEY") with boldsign.ApiClient(configuration) as api_client: user_api = boldsign.UserApi(api_client) create_user_request = boldsign.CreateUser( emailId= "luthercooper@cubeflakes.com", teamId="YOUR_TEAM_ID", userRole="Admin") user_created = user_api.create_user([create_user_request]) ``` -------------------------------- ### Send Document via Email using Node.js Axios Source: https://developers.boldsign.com/how-to-guides/request-signature-by-email?region=eu This Node.js example uses Axios and form-data to send a document for signature. Ensure you have the necessary libraries installed. ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Message', ''); data.append('Signers', '{\r\n "name": "Hanky",\r\n "emailAddress": "hankyWhites@cubeflakes.com",\r\n "signerType": "Signer", \r\n "deliveryMode": "Email",\r\n "formFields": [\r\n {\r\n "id": "string",\r\n "name": "string",\r\n "fieldType": "Signature",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 50,\r\n "y": 50,\r\n "width": 1,\r\n "height": 1\r\n },\r\n "isRequired": true\r\n }\r\n ],\r\n "locale": "EN"}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', '{title}'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api-eu.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Initialize API Client for Java Source: https://developers.boldsign.com/embedded-request/create-embedded-request-link-using-multiple-templates.md This Java code snippet shows how to initialize the API client with the base path and API key for BoldSign services. ```java ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("https://api.boldsign.com"); client.setApiKey("YOUR_API_KEY"); ``` -------------------------------- ### Get Embedded Template Edit Link (Node.js) Source: https://developers.boldsign.com/embedded-template/edit-embedded-template.md This Node.js snippet shows how to obtain an embedded template edit URL. Ensure you have the boldsign package installed and configured. ```javascript import { TemplateApi, EmbeddedTemplateEditRequest } from "boldsign"; const templateApi = new TemplateApi("https://api.boldsign.com"); templateApi.setApiKey("YOUR_API_KEY"); const embeddedTemplateEditRequest = new EmbeddedTemplateEditRequest(); embeddedTemplateEditRequest.showToolbar = true; embeddedTemplateEditRequest.showPreviewButton = false; embeddedTemplateEditRequest.viewOption = EmbeddedTemplateEditRequest.ViewOptionEnum.PreparePage; const embeddedTemplateEdited = templateApi.getEmbeddedTemplateEditUrl("YOUR_TEMPLATE_ID", embeddedTemplateEditRequest); ``` -------------------------------- ### Get Brand Details using NodeJS Source: https://developers.boldsign.com/branding/get-brand.md This NodeJS example shows how to fetch brand details using the BrandingApi. Initialize the API with the host and set your API key. ```javascript import { BrandingApi } from "boldsign"; const brandingApi = new BrandingApi("https://api.boldsign.com");randingApi.setApiKey("YOUR_API_KEY"); const brandDetails = brandingApi.getBrand("YOUR_BRAND_ID"); ``` -------------------------------- ### PlanClient Constructor with Configuration Source: https://developers.boldsign.com/sdk/dotnet/class-reference/BoldSign.Api.PlanClient.html Initializes a new instance of the PlanClient class using a Configuration object. The configuration object is optional. ```csharp public PlanClient(Configuration configuration = null)__ ``` -------------------------------- ### Download Document using Java Source: https://developers.boldsign.com/documents/download-document?region=eu This Java example shows how to download a document using the BoldSign API client. Configure the default API client with the base path and API key, then use the DocumentApi to download the document. ```java ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("https://api-eu.boldsign.com"); client.setApiKey("YOUR_API_KEY"); DocumentApi documentApi = new DocumentApi(client); File documentStream = documentApi.downloadDocument("YOUR_DOCUMENT_ID", null); ``` -------------------------------- ### Send Document with Dropdown Field (Node.js) Source: https://developers.boldsign.com/how-to-guides/how-to-set-drop-down-form-fields?region=us This Node.js example uses axios and form-data to send a document with a dropdown form field. Ensure you have these packages installed and replace placeholders. ```javascript const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Signers', '{\r\n "name": "hanky",\r\n "emailAddress": "hankyWhites@gmail.com",\r\n "signerType": "Signer",\r\n "signerRole": "Signer",\r\n "formFields": [\r\n {\r\n "id": "DropDown",\r\n "name": "DropDown",\r\n "fieldType": "DropDown",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 100,\r\n "y": 100,\r\n "width": 125,\r\n "height": 25\r\n },\r\n "dropdownOptions": ["Male", "Female"],\r\n "value": "Male",\r\n "isRequired": true\r\n}\r\n ],\r\n "locale": "EN"\r\n}'); data.append('Files', fs.createReadStream('{Your file path}')); data.append('Title', "Sample Document"); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://api.boldsign.com/v1/document/send', headers: { 'accept': 'application/json', 'X-API-KEY': '{Your API key}', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` -------------------------------- ### Install Composer Dependencies Source: https://developers.boldsign.com/sdks/php-sdk?region=eu After adding the SDK to your composer.json, run this command in your terminal to download and install all project dependencies, including the BoldSign SDK. ```bash composer install ```