FortnoxEx.Utils (FortnoxEx v0.1.0) View Source

Link to this section Summary

Functions

Builds an authenticated client. Requires that you already have an access token for the client secret.

Gets an access token given a client secret and an authorization code

Extracts the response body with or without MetaInformation.

Link to this section Functions

Link to this function

client(client_secret, access_token)

View Source

Builds an authenticated client. Requires that you already have an access token for the client secret.

The client uses fuse for rate limiting. Rate limiting is bound to the access token of the client. Read more about Fortnox rate limiting here. https://developer.fortnox.se/general/regarding-fortnox-api-rate-limits/

Link to this function

get_access_token(client_secret, authorization_code)

View Source

Gets an access token given a client secret and an authorization code

Examples

iex> get_access_token(client_secret, authorization_code)

iex> get_access_token(client_secret, authorization_code) {:error, %{"Code" => 2000721, "Error" => 1, "Message" => "Auktoriseringskoden är redan förbrukad."}}

Link to this function

process_response(error, key)

View Source

Extracts the response body with or without MetaInformation.

Link to this function

stream_resource(client, list_fn, query)

View Source