Class: QboApi
- Inherits:
-
Object
- Object
- QboApi
- Extended by:
- Configuration
- Includes:
- ApiMethods, Attachment, Connection, Entity, Supporting, Util
- Defined in:
- lib/qbo_api/error.rb,
lib/qbo_api.rb,
lib/qbo_api/util.rb,
lib/qbo_api/entity.rb,
lib/qbo_api/version.rb,
lib/qbo_api/attachment.rb,
lib/qbo_api/connection.rb,
lib/qbo_api/supporting.rb,
lib/qbo_api/api_methods.rb,
lib/qbo_api/configuration.rb
Overview
200 OK The request succeeded. However, the response body may contain a <Fault> element, indicating an error. 400 Bad request Generally, the request cannot be fulfilled due to bad syntax. In some cases, this response code is returned for a request with bad authorization data. 401 Unauthorized Authentication or authorization has failed. 403 Forbidden The resource is forbidden. 404 Not Found The resource is not found. 429 Too Many Requests API Throttling/ Rate limiting 500 Internal Server Error An error occurred on the server while processing the request. Resubmit request once; if it persists, contact developer support. 502 Bad Gateway The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request. 503 Service Unavailable The service is temporarily unavailable. 504 Gateway Timeout Custom error class for rescuing from all QuickBooks Online errors
Defined Under Namespace
Modules: ApiMethods, Attachment, Configuration, Connection, Entity, Supporting, Util Classes: BadGateway, BadRequest, Error, Forbidden, GatewayTimeout, InternalServerError, NotFound, NotImplementedError, ServiceUnavailable, TooManyRequests, Unauthorized
Constant Summary collapse
- V3_ENDPOINT_BASE_URL =
'https://sandbox-quickbooks.api.intuit.com/v3/company/'
- PAYMENTS_API_BASE_URL =
'https://sandbox.api.intuit.com/quickbooks/v4/payments'
- LOG_TAG =
"[QuickBooks]"
- VERSION =
"2.0.1"
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#realm_id ⇒ Object
Returns the value of attribute realm_id.
Attributes included from Util
Instance Method Summary collapse
- #connection(url: endpoint_url) ⇒ Object
- #default_attributes ⇒ Object
- #endpoint_url ⇒ Object
-
#initialize(attributes = {}) ⇒ QboApi
constructor
A new instance of QboApi.
Methods included from Configuration
log, log=, logger, logger=, minor_version, minor_version=, production, production=, request_id, request_id=
Methods included from ApiMethods
#all, #create, #deactivate, #delete, #get, #get_by_query_filter, #query, #update
Methods included from Attachment
#attachment_connection, #delete_attachment, #read_attachment, #upload_attachment
Methods included from Util
#add_minor_version_to, #add_params_to_path, #add_request_id_to, #cdc_time, #esc, #finalize_path, #uuid
Methods included from Entity
#entity_path, #extract_entity_from_query, #is_name_list_entity?, #is_transaction_entity?, #name_list_entities, #singular, #snake_to_camel, #supporting_entities, #transaction_entities
Methods included from Supporting
Methods included from Connection
#authorized_json_connection, #authorized_multipart_connection, #build_connection, #parse_response_body, #raw_request, #request, #response
Constructor Details
#initialize(attributes = {}) ⇒ QboApi
Returns a new instance of QboApi.
32 33 34 35 36 37 38 39 40 |
# File 'lib/qbo_api.rb', line 32 def initialize(attributes = {}) raise ArgumentError, "missing keyword: access_token" unless attributes.key?(:access_token) raise ArgumentError, "missing keyword: realm_id" unless attributes.key?(:realm_id) attributes = default_attributes.merge!(attributes) attributes.each do |attribute, value| public_send("#{attribute}=", value) end @endpoint_url = get_endpoint end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
25 26 27 |
# File 'lib/qbo_api.rb', line 25 def access_token @access_token end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
26 27 28 |
# File 'lib/qbo_api.rb', line 26 def endpoint @endpoint end |
#realm_id ⇒ Object
Returns the value of attribute realm_id.
25 26 27 |
# File 'lib/qbo_api.rb', line 25 def realm_id @realm_id end |
Instance Method Details
#connection(url: endpoint_url) ⇒ Object
48 49 50 |
# File 'lib/qbo_api.rb', line 48 def connection(url: endpoint_url) @connection ||= (url) end |
#default_attributes ⇒ Object
42 43 44 45 46 |
# File 'lib/qbo_api.rb', line 42 def default_attributes { endpoint: :accounting } end |
#endpoint_url ⇒ Object
52 53 54 |
# File 'lib/qbo_api.rb', line 52 def endpoint_url @endpoint_url.dup end |