Module: RightSignature::Account
- Included in:
- Connection
- Defined in:
- lib/rightsignature/account.rb
Instance Method Summary collapse
-
#add_user(name, email) ⇒ Object
Creates a user on API user’s account * name: User’s name * email: User’s email.
-
#usage_report(since = nil, signed = nil) ⇒ Object
Return account’s usage report (# of documents sent) * since: (“month”/“week”/“day”) only count documents sent within a certain time * signed: (true/false) only count signed document.
-
#user_details ⇒ Object
Return account information about API user.
Instance Method Details
#add_user(name, email) ⇒ Object
Creates a user on API user’s account
-
name: User’s name
-
email: User’s email
Ex.
@rs_connection.add_user("John Bellingham", "[email protected]")
19 20 21 |
# File 'lib/rightsignature/account.rb', line 19 def add_user(name, email) post "/api/users.xml", {:user => {:name => name, :email => email}} end |
#usage_report(since = nil, signed = nil) ⇒ Object
Return account’s usage report (# of documents sent)
-
since: (“month”/“week”/“day”) only count documents sent within a certain time
-
signed: (true/false) only count signed document
Ex. Return count of signed documents sent this month
@rs_connection.usage_report("month", true)
30 31 32 33 34 35 |
# File 'lib/rightsignature/account.rb', line 30 def usage_report(since=nil, signed=nil) = {} [:since] = since if since && ["month", "week", "day"].include?(since) [:signed] = signed.to_s unless signed.nil? get "/api/account/usage_report.xml", end |
#user_details ⇒ Object
Return account information about API user
Ex.
@rs_connection.user_details
8 9 10 |
# File 'lib/rightsignature/account.rb', line 8 def user_details get "/api/users/user_details.xml" end |