당신이 이것을 알아 냈는지 확실치 않은지 확실하지 않습니다. 여기에 httparty를 사용하는 것이 그리 어렵지 않은 또 다른 해결책이 있습니다. 당신은 예를 들어 템플릿에 대한 문서를 작성하려는 경우, 귀하의 요청과 같이 보일 수 있습니다 : 마지막 줄에
baseUrl = "https://demo.docusign.net/restapi/v2/accounts/acct_number/envelopes"
@lease = Lease.find(lease.id)
@unit = @lease.unit
@application = @lease.application
@manager = @lease.property_manager
@application.applicants.each do |renter|
req = HTTParty.post(baseUrl,
body: {
"emailSubject": "DocuSign API call - Request Signature - Boom",
"templateId": "id of your template",
"templateRoles": [{
"name": "#{renter.background.legal_name}",
"email": "#{renter.email}",
"recipientId": "1",
"roleName": "Lessee",
"tabs": {
"texttabs": [{
"tablabel": "Rent",
"value": "#{@lease.rent}"
},{
"tablabel": "Address",
"value": "987 apple lane"
}]
}
},{
"email": "#{@manager.email}",
"name": "#{@manager.name}",
"roleName": "Lessor",
"tabs": {
"texttabs": [{
"tablabel": "Any",
"value": "#{@lease.labels}"
},{
"tablabel": "Address",
"value": "987 hoser lane"
}]
}
}],
"status": "sent"
}.to_json,
headers: {
"Content-Type" => "application/json",
'Accept' => 'application/json',
'X-DocuSign-Authentication' => '{
"Username" : "place your",
"Password" : "credentials",
"IntegratorKey" : "here"
}'
}, :debug_output => $stdout)
디버그 출력은 API 요청을 디버깅 할 수 있도록하는 것입니다, 그것은에서 제거 할 수 있습니다 언제든지.
'config.api_version = 'v2''을 사용해 보셨습니까? – DiegoSalazar