TinkoffInvest.Api (tinkoff_invest v0.1.1) View Source
This module provides two simple requests: GET and POST
payload
map converted to query string on request
You will need to define your custom TinkoffInvest.Model
to make this work or use existing one.
Examples:
TinkoffInvest.Api.request("/orders", :get, YourCustomModel)
TinkoffInvest.Api.request("/orders", :get, YourCustomModel, %{someParam: true}) # /orders?someParam=true
TinkoffInvest.Api.request("/orders", :post, YourCustomModel, %{})
Link to this section Summary
Functions
Builds payload from map. Account id provided by default in config though can be overridden
Allows you to send request to api if you need custom method that is not currently implemented
Link to this section Types
Specs
method() :: :get | :post
Link to this section Functions
Specs
Builds payload from map. Account id provided by default in config though can be overridden
Examples
# Overwrites default value in config
TinkoffInvest.Api.build_payload("/orders", %{brokerAccountId: "MyCustomId"})
# Adds brokerAccountId field with broker_account_id from config to payload
TinkoffInvest.Api.build_payload("/orders", %{figi: "AAPL"})
Specs
request(String.t(), method(), module(), map() | nil) :: TinkoffInvest.Model.Api.Response.t()
Allows you to send request to api if you need custom method that is not currently implemented