View Source CastorEDC.Client (ExCastorEDC v0.4.1)
Container for API client configuration values.
Link to this section Summary
Functions
By default the client will use https://data.castoredc.com/ as the endpoint
Link to this section Types
Link to this section Functions
@spec new( credentials(), keyword() ) :: t()
By default the client will use https://data.castoredc.com/ as the endpoint
client = Client.new(%{client_id: "<client id>", client_secret: "<client secret>"})You can pass a different endpoint as an option when your studies are located elsewhere e.g.
client = Client.new(
%{client_id: "<client id>", client_secret: "<client secret>"},
endpoint: "https://us.castoredc.com/"
)Alternatively, when you have a long-lived access token you can pass it in directly
client = Client.new(%{access_token: "<access token>"})Additionally it's possible to pass options e.g increasing the global_timeout.
client = Client.new(
%{client_id: "<client id>", client_secret: "<client secret>"},
global_timeout: 30_000
)
options
Options
:endpoint- An alternative endpoint e.g. https://us.castoredc.com/:global_timeout- The global_timeout in milliseconds, by default it is 5000:adapter- Any module that implements theTesla.Adapterbehavior:adapter_options- The supported options for the given adapter