2014-11-13 2 views
0

Ruby on Rails App에 Docusign을 구현했습니다. 전송 문서의 상태를 가져 오려고합니다. 이와 같은 봉투 ID를 사용하여 하나씩 쉽게 얻을 수 있습니다.Docusign Rails 상태 얻기

문제는 내가 보낸 문서 목록을 보여 주며이 목록과 함께 각 문서의 상태를 보여주고 싶습니다. 따라서 envelope_id를 사용하여 각 문서의 상태를 하나씩 가져 오는 것이 어렵고 시간이 많이 걸립니다.

같은 계정에서 보낸 봉투 목록의 상태를 확인할 수있는 방법이 있습니까? 사용자가 문서에 서명 한 후 특정 URL로 리디렉션되도록 할 수있는 작업이 있는지도 알고 싶습니다 (사용자가 문서에 서명하자마자 데이터베이스 상태를 업데이트 할 수 있음)

+0

어떤 DocuSign Ruby 클라이언트 또는 SDK를 사용하고 있습니까? 참조 용 링크를 게시 할 수 있습니까? 날짜 또는 상태를 기반으로 여러 봉투를 요청하는 API 호출이 있지만 사용중인 라이브러리가 해당 호출을 지원하는지 확실하지 않습니다. 그것을 추가해야 할 수도 있습니다. – Ergin

+0

@Ergin은 그 것을 잊어 버렸습니다 .. https://github.com/jondkinney/docusign_rest docusign_rest 사용 –

+0

방금 ​​추가 한 게시물보기 ... – Ergin

답변

1

예 DocuSign 플랫폼은 실제로 봉투 ID 당 하나씩 쓰는 대신 단일 API 호출로 봉투 세트를 쿼리 할 수있게 해줍니다. 올바른 API 호출 만하면됩니다. DocuSign REST API Documentation에서 해당 API 호출이 여기

# Public retrieves the statuses of envelopes matching the given query 
# 
# from_date  - Docusign formatted Date/DateTime. Only return items after this date. 
# 
# to_date  - Docusign formatted Date/DateTime. Only return items up to this date. 
#     Defaults to the time of the call. 
# 
# from_to_status - The status of the envelope checked for in the from_date - to_date period. 
#     Defaults to 'changed' 
# 
# status   - The current status of the envelope. Defaults to any status. 
# 
# Returns an array of hashes containing envelope statuses, ids, and similar information. 
def get_envelope_statuses(options={}) 
    content_type = { 'Content-Type' => 'application/json' } 
    content_type.merge(options[:headers]) if options[:headers] 

    query_params = options.slice(:from_date, :to_date, :from_to_status, :status) 
    uri = build_uri("/accounts/#{acct_id}/envelopes?#{query_params.to_query}") 

    http  = initialize_net_http_ssl(uri) 
    request = Net::HTTP::Get.new(uri.request_uri, headers(content_type)) 
    response = http.request(request) 

    JSON.parse(response.body) 
end 

: 그리고 그들은 이미 호출을 포함 것처럼 보이는 Ruby library you have referenced 보면, 그것은 get_envelope_statuses을라고 그것을 당신이 날짜 범위와 상태를 통해 봉투를 조회 할 수 있습니다.