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,
lib/qbo_api/connection/oauth1.rb,
lib/qbo_api/connection/oauth2.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. 503 Service Unavailable The service is temporarily unavailable. Custom error class for rescuing from all QuickBooks Online errors
Defined Under Namespace
Modules: ApiMethods, Attachment, Configuration, Connection, Entity, Supporting, Util Classes: BadRequest, Error, Forbidden, 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 =
"1.8.4"
- APP_CENTER_BASE =
'https://appcenter.intuit.com'
- APP_CENTER_URL =
APP_CENTER_BASE + '/Connect/Begin?oauth_token='
- APP_CONNECTION_URL =
APP_CENTER_BASE + '/api/v1/connection'
Constants included from Connection
Connection::AUTHORIZATION_MIDDLEWARES
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
-
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#realm_id ⇒ Object
Returns the value of attribute realm_id.
-
#token ⇒ Object
Returns the value of attribute token.
-
#token_secret ⇒ Object
Returns the value of attribute token_secret.
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, #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
add_authorization_middleware, #authorized_json_connection, #authorized_multipart_connection, #build_connection, #parse_response_body, #raw_request, #request, #response
Methods included from Connection::OAuth2
#add_oauth2_authorization_middleware, included, #use_oauth2_middleware?
Methods included from Connection::OAuth1
#add_oauth1_authorization_middleware, #disconnect, included, #reconnect, #use_oauth1_middleware?
Constructor Details
#initialize(attributes = {}) ⇒ QboApi
Returns a new instance of QboApi.
33 34 35 36 37 38 39 40 |
# File 'lib/qbo_api.rb', line 33 def initialize(attributes = {}) 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.
2 3 4 |
# File 'lib/qbo_api/connection/oauth2.rb', line 2 def access_token @access_token end |
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
7 8 9 |
# File 'lib/qbo_api/connection/oauth1.rb', line 7 def consumer_key @consumer_key end |
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
7 8 9 |
# File 'lib/qbo_api/connection/oauth1.rb', line 7 def consumer_secret @consumer_secret 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 |
#token ⇒ Object
Returns the value of attribute token.
6 7 8 |
# File 'lib/qbo_api/connection/oauth1.rb', line 6 def token @token end |
#token_secret ⇒ Object
Returns the value of attribute token_secret.
6 7 8 |
# File 'lib/qbo_api/connection/oauth1.rb', line 6 def token_secret @token_secret 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 |