View Source Ibanity.PontoConnect.Integration (ibanity v1.1.0)

Integration API wrapper

NOTE: This resource needs a client token!

See Ibanity.PontoConnect.Token.create/1 to find out how to request a client token.

Summary

Functions

Link to this function

delete(request_or_token, organization_id)

View Source

Revoke Integration by id

Takes a Ibanity.PontoConnect.Token, or a Ibanity.Request with set :token as first argument.

Takes a valid organization ID as string as second argument.

Examples

With token

iex> Ibanity.PontoConnect.Integration.delete(client_token, "16e79b57-6113-4292-9bfe-87580ff2b317")
{:ok, %Ibanity.PontoConnect.Integration{id: "501d0365-ce90-4c10-8c5f-0fe259908101"}}

With request

iex> client_token
...> |> Ibanity.Request.token()
...> |> Ibanity.Request.application(:my_application)
...> |> Ibanity.PontoConnect.Integration.delete("16e79b57-6113-4292-9bfe-87580ff2b317")
{:ok, %Ibanity.PontoConnect.Integration{id: "501d0365-ce90-4c10-8c5f-0fe259908101"}}

iex> client_token
...> |> Ibanity.PontoConnect.Integration.delete("does-not-exist")
{:error,
  [
    %{
      "code" => "resourceNotFound",
      "detail" => "The requested resource was not found.",
      "meta" => %{
        "requestId" => "00077F00000184847F0000011F4066E44223327005A",
        "resource" => "integration"
      }
    }
  ]}