Module: Authentise::API::Print
- Defined in:
- lib/authentise/api/print.rb
Overview
Calls to the print streaming API
Class Method Summary collapse
Class Method Details
.create_token(receiver_email: nil, model_url: nil, print_value: nil, print_value_currency: nil, partner_job_id: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/authentise/api/print.rb', line 9 def create_token(receiver_email: nil, model_url: nil, print_value: nil, print_value_currency: nil, partner_job_id: nil) url = "https://print.authentise.com/token/" body = { api_key: Authentise.configuration.secret_partner_key, model: model_url, receiver_email: receiver_email, print_value: print_value, print_value_currency: print_value_currency, partner_job_id: partner_job_id, }.to_json RestClient.post(url, body, ) do |response, _, _| if response.code == 201 { url: response.headers[:x_token_location] } else fail UnknownResponseCodeError.new(response.code, response) end end end |