Class: Plaid::LinkApi
Overview
LinkApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#link_token_create(body) ⇒ ApiResponse
The ‘/link/token/create` endpoint creates a `link_token`, which is required as a parameter when initializing Link.
-
#link_token_get(body) ⇒ ApiResponse
The ‘/link/token/get` endpoint gets information about a previously-created `link_token` using the `/link/token/create` endpoint.
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
#link_token_create(body) ⇒ ApiResponse
The ‘/link/token/create` endpoint creates a `link_token`, which is required as a parameter when initializing Link. Once Link has been initialized, it returns a `public_token`, which can then be exchanged for an `access_token` via `/item/public_token/exchange` as part of the main Link flow. A `link_token` generated by `/link/token/create` is also used to initialize other Link flows, such as the update mode flow for tokens with expired credentials, or the Payment Initiation (Europe) flow. description here
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/plaid/apis/link_api.rb', line 44 def link_token_create(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/link/token/create', 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(LinkTokenCreateResponse.method(:from_hash)) .is_api_response(true)) .execute end |
#link_token_get(body) ⇒ ApiResponse
The ‘/link/token/get` endpoint gets information about a previously-created `link_token` using the `/link/token/create` endpoint. It can be useful for debugging purposes. description here
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/plaid/apis/link_api.rb', line 15 def link_token_get(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/link/token/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(LinkTokenGetResponse.method(:from_hash)) .is_api_response(true)) .execute end |