Module: Clicksign::API::Requests
- Included in:
- Batch, Document, DocumentsSigners, Notifier, Signer, WhatsappNotifier
- Defined in:
- lib/clicksign/api/requests.rb
Instance Method Summary collapse
Instance Method Details
#conn ⇒ Object
19 20 21 |
# File 'lib/clicksign/api/requests.rb', line 19 def conn @conn ||= Faraday.new(url: Clicksign::API.url) end |
#get(request_path, token) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/clicksign/api/requests.rb', line 12 def get(request_path, token) conn.get do |req| req.url request_path, { access_token: Clicksign::API.credentials[token] } req.headers['Content-Type'] = 'application/json' end end |
#post(request_path, body, token) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/clicksign/api/requests.rb', line 4 def post(request_path, body, token) conn.post do |req| req.url request_path, { access_token: Clicksign::API.credentials[token] } req.headers['Content-Type'] = 'application/json' req.body = body.to_json end end |