2016-09-19 10 views
1

DocuSign REST APIにdocusign_rest gemを使用しています。私のDocuSign設定は以下のとおりです。Docusignレールとの統合4

# config/initializers/docusign_rest.rb 

require 'docusign_rest' 
DocusignRest.configure do |config| 
    config.username  = '[email protected]' 
    config.password  = 'MyPassword' 
    config.integrator_key = 'My-key' 
    config.account_id  = 'account_id' 
    config.endpoint  = 'https://www.docusign.net/restapi' 
    config.api_version = 'v1' 
end 

接続してaccount_idを取得しようとすると、応答としてnilが返されます。

client = DocusignRest::Client.new 
puts client.get_account_id   # Returns nil. 

私は何を逃したrails-4.1.4ruby-2.2.2

を使用していますか?提案してください。

+1

'config.api_version = 'v2''を試しましたか? – DiegoSalazar

答えて

1

これがわかっているかどうかわからない場合は、わかりません。ここには、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要求をデバッグできるようにすることです、それはで除去することができますどんなときも。

1

これはdocusign_rest 0.1.1のバグです。そのメソッドは常にnilを返しました。そのバグはfixedであり、最新のgemバージョンにはその修正が含まれています。

関連する問題