class Paperform::Submission

Constants

BASE_URL

Attributes

token[R]

Public Class Methods

new(token) click to toggle source
# File lib/paperform/submission.rb, line 7
def initialize(token)
  @token = token
end

Public Instance Methods

find(id) click to toggle source
# File lib/paperform/submission.rb, line 11
def find(id)
  params = { id: id }

  response = Curl.get(BASE_URL, params) do |http|
    http.headers['Authorization'] = "Bearer #{token}"
  end

  response.body
end
list(form_id, options = nil) click to toggle source
# File lib/paperform/submission.rb, line 21
def list(form_id, options = nil)
  params = { form: form_id }
  params.merge!(options) if options

  response = Curl.get(BASE_URL, params) do |http|
    http.headers['Authorization'] = "Bearer #{token}"
  end

  response.body
end