lib/signaturit_client.rb in signaturit-sdk-0.0.1 vs lib/signaturit_client.rb in signaturit-sdk-0.0.2

- old
+ new

@@ -40,13 +40,18 @@ # - key: S3 key # - secret: S3 secret def set_document_storage(type, params) params[:type] = type - request :patch, '/v2/account.json', params + request :post, '/v2/account/storage.json', params end + # Revert the document storage to the signaturit's default + def revert_to_default_document_storage + request :delete, '/v2/account/storage.json' + end + # Get a concrete signature object # # Params: # +signature_id+:: The id of the signature object def get_signature(signature_id) @@ -265,14 +270,14 @@ # Common request method def request(method, path, params = {}, to_json = true) base = @production ? 'https://api.signaturit.com' : 'http://api.sandbox.signaturit.com' case method - when :get + when :get, :delete encoded = URI.encode_www_form(params) path = "#{path}?#{encoded}" if encoded.length > 0 - body = RestClient.get("#{base}#{path}", :Authorization => "Bearer #{@token}") + body = RestClient.send(method, "#{base}#{path}", :Authorization => "Bearer #{@token}") else body = RestClient.send(method, "#{base}#{path}", params, :Authorization => "Bearer #{@token}") end