Class: Plaid::AuthApi

Inherits:
BaseApi show all
Defined in:
lib/plaid/apis/auth_api.rb

Overview

AuthApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from Plaid::BaseApi

Instance Method Details

#auth_get(body) ⇒ ApiResponse

The ‘/auth/get` endpoint returns the bank account and bank identification numbers (such as routing numbers, for US accounts) associated with an Item’s checking and savings accounts, along with high-level account data and balances when available. Note: This request may take some time to complete if ‘auth` was not specified as an initial product when creating the Item. This is because Plaid must communicate directly with the institution to retrieve the data. Also note that `/auth/get` will not return data for any new accounts opened after the Item was created. To obtain data for new accounts, create a new Item. here

Parameters:

  • body (AuthGetRequest)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/plaid/apis/auth_api.rb', line 22

def auth_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/auth/get',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('PLAID-CLIENT-ID', 'PLAID-SECRET', 'Plaid-Version')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AuthGetResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Default error',
                             ErrorErrorException))
    .execute
end