# Send with Template POST https://api.hellosign.com/v3/signature_request/send_with_template Content-Type: application/json Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. Reference: https://developer.hellosign.com/api/signature-request/send-with-template ## SDK Code Examples ```php PHP setUsername("YOUR_API_KEY"); // $config->setAccessToken("YOUR_ACCESS_TOKEN"); $signing_options = (new Dropbox\Sign\Model\SubSigningOptions()) ->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW) ->setDraw(true) ->setPhone(false) ->setType(true) ->setUpload(true); $signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner()) ->setRole("Client") ->setName("George") ->setEmailAddress("george@example.com"); $signers = [ $signers_1, ]; $ccs_1 = (new Dropbox\Sign\Model\SubCC()) ->setRole("Accounting") ->setEmailAddress("accounting@example.com"); $ccs = [ $ccs_1, ]; $custom_fields_1 = (new Dropbox\Sign\Model\SubCustomField()) ->setName("Cost") ->setEditor("Client") ->setRequired(true) ->setValue("\$20,000"); $custom_fields = [ $custom_fields_1, ]; $signature_request_send_with_template_request = (new Dropbox\Sign\Model\SignatureRequestSendWithTemplateRequest()) ->setTemplateIds([ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ]) ->setMessage("Glad we could come to an agreement.") ->setSubject("Purchase Order") ->setTestMode(true) ->setSigningOptions($signing_options) ->setSigners($signers) ->setCcs($ccs) ->setCustomFields($custom_fields); try { $response = (new Dropbox\Sign\Api\SignatureRequestApi(config: $config))->signatureRequestSendWithTemplate( signature_request_send_with_template_request: $signature_request_send_with_template_request, ); print_r($response); } catch (Dropbox\Sign\ApiException $e) { echo "Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate: {$e->getMessage()}"; } ``` ```csharp C# using System; using System.Collections.Generic; using System.IO; using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; namespace Dropbox.SignSandbox; public class SignatureRequestSendWithTemplateExample { public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; // config.AccessToken = "YOUR_ACCESS_TOKEN"; var signingOptions = new SubSigningOptions( defaultType: SubSigningOptions.DefaultTypeEnum.Draw, draw: true, phone: false, type: true, upload: true ); var signers1 = new SubSignatureRequestTemplateSigner( role: "Client", name: "George", emailAddress: "george@example.com" ); var signers = new List { signers1, }; var ccs1 = new SubCC( role: "Accounting", emailAddress: "accounting@example.com" ); var ccs = new List { ccs1, }; var customFields1 = new SubCustomField( name: "Cost", editor: "Client", required: true, value: "$20,000" ); var customFields = new List { customFields1, }; var signatureRequestSendWithTemplateRequest = new SignatureRequestSendWithTemplateRequest( templateIds: [ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ], message: "Glad we could come to an agreement.", subject: "Purchase Order", testMode: true, signingOptions: signingOptions, signers: signers, ccs: ccs, customFields: customFields ); try { var response = new SignatureRequestApi(config).SignatureRequestSendWithTemplate( signatureRequestSendWithTemplateRequest: signatureRequestSendWithTemplateRequest ); Console.WriteLine(response); } catch (ApiException e) { Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSendWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } } } ``` ```typescript TypeScript import * as fs from 'fs'; import api from "@dropbox/sign" import models from "@dropbox/sign" const apiCaller = new api.SignatureRequestApi(); apiCaller.username = "YOUR_API_KEY"; // apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; const signingOptions: models.SubSigningOptions = { defaultType: models.SubSigningOptions.DefaultTypeEnum.Draw, draw: true, phone: false, type: true, upload: true, }; const signers1: models.SubSignatureRequestTemplateSigner = { role: "Client", name: "George", emailAddress: "george@example.com", }; const signers = [ signers1, ]; const ccs1: models.SubCC = { role: "Accounting", emailAddress: "accounting@example.com", }; const ccs = [ ccs1, ]; const customFields1: models.SubCustomField = { name: "Cost", editor: "Client", required: true, value: "$20,000", }; const customFields = [ customFields1, ]; const signatureRequestSendWithTemplateRequest: models.SignatureRequestSendWithTemplateRequest = { templateIds: [ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ], message: "Glad we could come to an agreement.", subject: "Purchase Order", testMode: true, signingOptions: signingOptions, signers: signers, ccs: ccs, customFields: customFields, }; apiCaller.signatureRequestSendWithTemplate( signatureRequestSendWithTemplateRequest, ).then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate:"); console.log(error.body); }); ``` ```java Java package com.dropbox.sign_sandbox; import com.dropbox.sign.ApiException; import com.dropbox.sign.Configuration; import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.JSON; import com.dropbox.sign.model.*; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; public class SignatureRequestSendWithTemplateExample { public static void main(String[] args) { var config = Configuration.getDefaultApiClient(); ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); var signingOptions = new SubSigningOptions(); signingOptions.defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); signingOptions.draw(true); signingOptions.phone(false); signingOptions.type(true); signingOptions.upload(true); var signers1 = new SubSignatureRequestTemplateSigner(); signers1.role("Client"); signers1.name("George"); signers1.emailAddress("george@example.com"); var signers = new ArrayList(List.of ( signers1 )); var ccs1 = new SubCC(); ccs1.role("Accounting"); ccs1.emailAddress("accounting@example.com"); var ccs = new ArrayList(List.of ( ccs1 )); var customFields1 = new SubCustomField(); customFields1.name("Cost"); customFields1.editor("Client"); customFields1.required(true); customFields1.value("$20,000"); var customFields = new ArrayList(List.of ( customFields1 )); var signatureRequestSendWithTemplateRequest = new SignatureRequestSendWithTemplateRequest(); signatureRequestSendWithTemplateRequest.templateIds(List.of ( "61a832ff0d8423f91d503e76bfbcc750f7417c78" )); signatureRequestSendWithTemplateRequest.message("Glad we could come to an agreement."); signatureRequestSendWithTemplateRequest.subject("Purchase Order"); signatureRequestSendWithTemplateRequest.testMode(true); signatureRequestSendWithTemplateRequest.signingOptions(signingOptions); signatureRequestSendWithTemplateRequest.signers(signers); signatureRequestSendWithTemplateRequest.ccs(ccs); signatureRequestSendWithTemplateRequest.customFields(customFields); try { var response = new SignatureRequestApi(config).signatureRequestSendWithTemplate( signatureRequestSendWithTemplateRequest ); System.out.println(response); } catch (ApiException e) { System.err.println("Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ```ruby Ruby require "json" require "dropbox-sign" Dropbox::Sign.configure do |config| config.username = "YOUR_API_KEY" # config.access_token = "YOUR_ACCESS_TOKEN" end signing_options = Dropbox::Sign::SubSigningOptions.new signing_options.default_type = "draw" signing_options.draw = true signing_options.phone = false signing_options.type = true signing_options.upload = true signers_1 = Dropbox::Sign::SubSignatureRequestTemplateSigner.new signers_1.role = "Client" signers_1.name = "George" signers_1.email_address = "george@example.com" signers = [ signers_1, ] ccs_1 = Dropbox::Sign::SubCC.new ccs_1.role = "Accounting" ccs_1.email_address = "accounting@example.com" ccs = [ ccs_1, ] custom_fields_1 = Dropbox::Sign::SubCustomField.new custom_fields_1.name = "Cost" custom_fields_1.editor = "Client" custom_fields_1.required = true custom_fields_1.value = "$20,000" custom_fields = [ custom_fields_1, ] signature_request_send_with_template_request = Dropbox::Sign::SignatureRequestSendWithTemplateRequest.new signature_request_send_with_template_request.template_ids = [ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ] signature_request_send_with_template_request.message = "Glad we could come to an agreement." signature_request_send_with_template_request.subject = "Purchase Order" signature_request_send_with_template_request.test_mode = true signature_request_send_with_template_request.signing_options = signing_options signature_request_send_with_template_request.signers = signers signature_request_send_with_template_request.ccs = ccs signature_request_send_with_template_request.custom_fields = custom_fields begin response = Dropbox::Sign::SignatureRequestApi.new.signature_request_send_with_template( signature_request_send_with_template_request, ) p response rescue Dropbox::Sign::ApiError => e puts "Exception when calling SignatureRequestApi#signature_request_send_with_template: #{e}" end ``` ```python Python import json from datetime import date, datetime from pprint import pprint from dropbox_sign import ApiClient, ApiException, Configuration, api, models configuration = Configuration( username="YOUR_API_KEY", # access_token="YOUR_ACCESS_TOKEN", ) with ApiClient(configuration) as api_client: signing_options = models.SubSigningOptions( default_type="draw", draw=True, phone=False, type=True, upload=True, ) signers_1 = models.SubSignatureRequestTemplateSigner( role="Client", name="George", email_address="george@example.com", ) signers = [ signers_1, ] ccs_1 = models.SubCC( role="Accounting", email_address="accounting@example.com", ) ccs = [ ccs_1, ] custom_fields_1 = models.SubCustomField( name="Cost", editor="Client", required=True, value="$20,000", ) custom_fields = [ custom_fields_1, ] signature_request_send_with_template_request = models.SignatureRequestSendWithTemplateRequest( template_ids=[ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ], message="Glad we could come to an agreement.", subject="Purchase Order", test_mode=True, signing_options=signing_options, signers=signers, ccs=ccs, custom_fields=custom_fields, ) try: response = api.SignatureRequestApi(api_client).signature_request_send_with_template( signature_request_send_with_template_request=signature_request_send_with_template_request, ) pprint(response) except ApiException as e: print("Exception when calling SignatureRequestApi#signature_request_send_with_template: %s\n" % e) ``` ```go Send Signature Request With Template package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.hellosign.com/v3/signature_request/send_with_template" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Basic :") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```swift Send Signature Request With Template import Foundation let headers = [ "Authorization": "Basic :", "Content-Type": "application/json" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.hellosign.com/v3/signature_request/send_with_template")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```php PHP setUsername("YOUR_API_KEY"); // $config->setAccessToken("YOUR_ACCESS_TOKEN"); $signing_options = (new Dropbox\Sign\Model\SubSigningOptions()) ->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW) ->setDraw(true) ->setPhone(false) ->setType(true) ->setUpload(true); $signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner()) ->setRole("Client") ->setName("George") ->setEmailAddress("george@example.com"); $signers = [ $signers_1, ]; $ccs_1 = (new Dropbox\Sign\Model\SubCC()) ->setRole("Accounting") ->setEmailAddress("accounting@example.com"); $ccs = [ $ccs_1, ]; $custom_fields_1 = (new Dropbox\Sign\Model\SubCustomField()) ->setName("Cost") ->setEditor("Client") ->setRequired(true) ->setValue("\$20,000"); $custom_fields = [ $custom_fields_1, ]; $signature_request_send_with_template_request = (new Dropbox\Sign\Model\SignatureRequestSendWithTemplateRequest()) ->setTemplateIds([ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ]) ->setMessage("Glad we could come to an agreement.") ->setSubject("Purchase Order") ->setTestMode(true) ->setSigningOptions($signing_options) ->setSigners($signers) ->setCcs($ccs) ->setCustomFields($custom_fields); try { $response = (new Dropbox\Sign\Api\SignatureRequestApi(config: $config))->signatureRequestSendWithTemplate( signature_request_send_with_template_request: $signature_request_send_with_template_request, ); print_r($response); } catch (Dropbox\Sign\ApiException $e) { echo "Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate: {$e->getMessage()}"; } ``` ```csharp C# using System; using System.Collections.Generic; using System.IO; using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; namespace Dropbox.SignSandbox; public class SignatureRequestSendWithTemplateExample { public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; // config.AccessToken = "YOUR_ACCESS_TOKEN"; var signingOptions = new SubSigningOptions( defaultType: SubSigningOptions.DefaultTypeEnum.Draw, draw: true, phone: false, type: true, upload: true ); var signers1 = new SubSignatureRequestTemplateSigner( role: "Client", name: "George", emailAddress: "george@example.com" ); var signers = new List { signers1, }; var ccs1 = new SubCC( role: "Accounting", emailAddress: "accounting@example.com" ); var ccs = new List { ccs1, }; var customFields1 = new SubCustomField( name: "Cost", editor: "Client", required: true, value: "$20,000" ); var customFields = new List { customFields1, }; var signatureRequestSendWithTemplateRequest = new SignatureRequestSendWithTemplateRequest( templateIds: [ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ], message: "Glad we could come to an agreement.", subject: "Purchase Order", testMode: true, signingOptions: signingOptions, signers: signers, ccs: ccs, customFields: customFields ); try { var response = new SignatureRequestApi(config).SignatureRequestSendWithTemplate( signatureRequestSendWithTemplateRequest: signatureRequestSendWithTemplateRequest ); Console.WriteLine(response); } catch (ApiException e) { Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSendWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } } } ``` ```typescript TypeScript import * as fs from 'fs'; import api from "@dropbox/sign" import models from "@dropbox/sign" const apiCaller = new api.SignatureRequestApi(); apiCaller.username = "YOUR_API_KEY"; // apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; const signingOptions: models.SubSigningOptions = { defaultType: models.SubSigningOptions.DefaultTypeEnum.Draw, draw: true, phone: false, type: true, upload: true, }; const signers1: models.SubSignatureRequestTemplateSigner = { role: "Client", name: "George", emailAddress: "george@example.com", }; const signers = [ signers1, ]; const ccs1: models.SubCC = { role: "Accounting", emailAddress: "accounting@example.com", }; const ccs = [ ccs1, ]; const customFields1: models.SubCustomField = { name: "Cost", editor: "Client", required: true, value: "$20,000", }; const customFields = [ customFields1, ]; const signatureRequestSendWithTemplateRequest: models.SignatureRequestSendWithTemplateRequest = { templateIds: [ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ], message: "Glad we could come to an agreement.", subject: "Purchase Order", testMode: true, signingOptions: signingOptions, signers: signers, ccs: ccs, customFields: customFields, }; apiCaller.signatureRequestSendWithTemplate( signatureRequestSendWithTemplateRequest, ).then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate:"); console.log(error.body); }); ``` ```java Java package com.dropbox.sign_sandbox; import com.dropbox.sign.ApiException; import com.dropbox.sign.Configuration; import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.JSON; import com.dropbox.sign.model.*; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; public class SignatureRequestSendWithTemplateExample { public static void main(String[] args) { var config = Configuration.getDefaultApiClient(); ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); var signingOptions = new SubSigningOptions(); signingOptions.defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); signingOptions.draw(true); signingOptions.phone(false); signingOptions.type(true); signingOptions.upload(true); var signers1 = new SubSignatureRequestTemplateSigner(); signers1.role("Client"); signers1.name("George"); signers1.emailAddress("george@example.com"); var signers = new ArrayList(List.of ( signers1 )); var ccs1 = new SubCC(); ccs1.role("Accounting"); ccs1.emailAddress("accounting@example.com"); var ccs = new ArrayList(List.of ( ccs1 )); var customFields1 = new SubCustomField(); customFields1.name("Cost"); customFields1.editor("Client"); customFields1.required(true); customFields1.value("$20,000"); var customFields = new ArrayList(List.of ( customFields1 )); var signatureRequestSendWithTemplateRequest = new SignatureRequestSendWithTemplateRequest(); signatureRequestSendWithTemplateRequest.templateIds(List.of ( "61a832ff0d8423f91d503e76bfbcc750f7417c78" )); signatureRequestSendWithTemplateRequest.message("Glad we could come to an agreement."); signatureRequestSendWithTemplateRequest.subject("Purchase Order"); signatureRequestSendWithTemplateRequest.testMode(true); signatureRequestSendWithTemplateRequest.signingOptions(signingOptions); signatureRequestSendWithTemplateRequest.signers(signers); signatureRequestSendWithTemplateRequest.ccs(ccs); signatureRequestSendWithTemplateRequest.customFields(customFields); try { var response = new SignatureRequestApi(config).signatureRequestSendWithTemplate( signatureRequestSendWithTemplateRequest ); System.out.println(response); } catch (ApiException e) { System.err.println("Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ```ruby Ruby require "json" require "dropbox-sign" Dropbox::Sign.configure do |config| config.username = "YOUR_API_KEY" # config.access_token = "YOUR_ACCESS_TOKEN" end signing_options = Dropbox::Sign::SubSigningOptions.new signing_options.default_type = "draw" signing_options.draw = true signing_options.phone = false signing_options.type = true signing_options.upload = true signers_1 = Dropbox::Sign::SubSignatureRequestTemplateSigner.new signers_1.role = "Client" signers_1.name = "George" signers_1.email_address = "george@example.com" signers = [ signers_1, ] ccs_1 = Dropbox::Sign::SubCC.new ccs_1.role = "Accounting" ccs_1.email_address = "accounting@example.com" ccs = [ ccs_1, ] custom_fields_1 = Dropbox::Sign::SubCustomField.new custom_fields_1.name = "Cost" custom_fields_1.editor = "Client" custom_fields_1.required = true custom_fields_1.value = "$20,000" custom_fields = [ custom_fields_1, ] signature_request_send_with_template_request = Dropbox::Sign::SignatureRequestSendWithTemplateRequest.new signature_request_send_with_template_request.template_ids = [ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ] signature_request_send_with_template_request.message = "Glad we could come to an agreement." signature_request_send_with_template_request.subject = "Purchase Order" signature_request_send_with_template_request.test_mode = true signature_request_send_with_template_request.signing_options = signing_options signature_request_send_with_template_request.signers = signers signature_request_send_with_template_request.ccs = ccs signature_request_send_with_template_request.custom_fields = custom_fields begin response = Dropbox::Sign::SignatureRequestApi.new.signature_request_send_with_template( signature_request_send_with_template_request, ) p response rescue Dropbox::Sign::ApiError => e puts "Exception when calling SignatureRequestApi#signature_request_send_with_template: #{e}" end ``` ```python Python import json from datetime import date, datetime from pprint import pprint from dropbox_sign import ApiClient, ApiException, Configuration, api, models configuration = Configuration( username="YOUR_API_KEY", # access_token="YOUR_ACCESS_TOKEN", ) with ApiClient(configuration) as api_client: signing_options = models.SubSigningOptions( default_type="draw", draw=True, phone=False, type=True, upload=True, ) signers_1 = models.SubSignatureRequestTemplateSigner( role="Client", name="George", email_address="george@example.com", ) signers = [ signers_1, ] ccs_1 = models.SubCC( role="Accounting", email_address="accounting@example.com", ) ccs = [ ccs_1, ] custom_fields_1 = models.SubCustomField( name="Cost", editor="Client", required=True, value="$20,000", ) custom_fields = [ custom_fields_1, ] signature_request_send_with_template_request = models.SignatureRequestSendWithTemplateRequest( template_ids=[ "61a832ff0d8423f91d503e76bfbcc750f7417c78", ], message="Glad we could come to an agreement.", subject="Purchase Order", test_mode=True, signing_options=signing_options, signers=signers, ccs=ccs, custom_fields=custom_fields, ) try: response = api.SignatureRequestApi(api_client).signature_request_send_with_template( signature_request_send_with_template_request=signature_request_send_with_template_request, ) pprint(response) except ApiException as e: print("Exception when calling SignatureRequestApi#signature_request_send_with_template: %s\n" % e) ``` ```go Default Example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.hellosign.com/v3/signature_request/send_with_template" payload := strings.NewReader("{\n \"template_ids\": [\n \"61a832ff0d8423f91d503e76bfbcc750f7417c78\"\n ],\n \"signers\": [\n {\n \"role\": \"Client\",\n \"name\": \"George\",\n \"email_address\": \"george@example.com\"\n }\n ],\n \"ccs\": [\n {\n \"role\": \"Accounting\",\n \"email_address\": \"accounting@example.com\"\n }\n ],\n \"custom_fields\": [\n {\n \"name\": \"Cost\",\n \"editor\": \"Client\",\n \"required\": true,\n \"value\": \"$20,000\"\n }\n ],\n \"message\": \"Glad we could come to an agreement.\",\n \"signing_options\": {\n \"default_type\": \"draw\",\n \"draw\": true,\n \"phone\": false,\n \"type\": true,\n \"upload\": true\n },\n \"subject\": \"Purchase Order\",\n \"test_mode\": true\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Basic :") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```swift Default Example import Foundation let headers = [ "Authorization": "Basic :", "Content-Type": "application/json" ] let parameters = [ "template_ids": ["61a832ff0d8423f91d503e76bfbcc750f7417c78"], "signers": [ [ "role": "Client", "name": "George", "email_address": "george@example.com" ] ], "ccs": [ [ "role": "Accounting", "email_address": "accounting@example.com" ] ], "custom_fields": [ [ "name": "Cost", "editor": "Client", "required": true, "value": "$20,000" ] ], "message": "Glad we could come to an agreement.", "signing_options": [ "default_type": "draw", "draw": true, "phone": false, "type": true, "upload": true ], "subject": "Purchase Order", "test_mode": true ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.hellosign.com/v3/signature_request/send_with_template")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```