View Source CastorEDC (ExCastorEDC v0.3.0)

Facilitates authentication against the Castor EDC API

alias CastorEDC.Client

client = Client.new(%{client_id: "<client id>", client_secret: "<client secret>"})
{:ok, client} = CastorEDC.authenticate(client)

See CastorEDC.Client.new/2 for all the options.

After authenticating against the API you can then use the other modules to perform API requests, e.g:

{200, list_of_studies, _} = CastorEDC.Common.Studies.list(client)

list_of_studies

Link to this section Summary

Functions

Exchanges a valid client id & secret combination for an access token that can be used to make further API calls.

Link to this section Functions

@spec authenticate(CastorEDC.Client.t()) ::
  {:ok, CastorEDC.Client.t()} | {:error, String.t()}

Exchanges a valid client id & secret combination for an access token that can be used to make further API calls.