{"id":15010083,"url":"https://github.com/kfmak/visma","last_synced_at":"2026-03-18T02:04:30.894Z","repository":{"id":57935745,"uuid":"529272911","full_name":"kfmak/visma","owner":"kfmak","description":"Visma API implementation in pure Elixir","archived":false,"fork":false,"pushed_at":"2022-08-26T13:55:52.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T19:45:52.627Z","etag":null,"topics":["api","documents","elixir","signature","visma"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kfmak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-26T13:40:57.000Z","updated_at":"2024-10-17T12:14:32.000Z","dependencies_parsed_at":"2022-09-06T19:21:50.383Z","dependency_job_id":null,"html_url":"https://github.com/kfmak/visma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kfmak/visma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfmak%2Fvisma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfmak%2Fvisma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfmak%2Fvisma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfmak%2Fvisma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfmak","download_url":"https://codeload.github.com/kfmak/visma/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfmak%2Fvisma/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30641822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-18T01:41:58.583Z","status":"online","status_checked_at":"2026-03-18T02:00:07.824Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","documents","elixir","signature","visma"],"created_at":"2024-09-24T19:29:56.321Z","updated_at":"2026-03-18T02:04:30.880Z","avatar_url":"https://github.com/kfmak.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visma Application\n\nElixir implementation of Visma API.\n\n## Build\n\n```elixir\nmix deps.get\nmix compile\n```\n## Test\n\n```elixir\nmix eunit\n```\n\n## Configuration\n\nIf you are using `Visma.Manager` application, you will\nneed to configure these elements in `config/config.exs`\n\n```elixir\nconfig :visma,\n  base_url: \"https://demo.vismaaddo.net/WebService/v2.0/restsigningservice.svc\",\n  email: \"fake.email.for.api.test@visma.com\",\n  password: Base.decode64!(\"c/SjPSMTRcZW1yzcvs6qdUOrnx4GyHoH0fyD0h9XnAAYP7PP/sNgTjKDMSUGlZAXB+ZFmm20JWK6hrsgJHsGYw==\")\n```\n\n## Usage\n\nWhen started, Visma application start a process called\n`Visma.Manager`. This one automatically generate a valid\ntoken and can automatically renew it when sending requests.\nThe implementation is not complete, all requests are not\nmanaged by this process at the moment.\n\n## High Level Usage (with `Visma.Manager`)\n\nHere some code example to use it with `Visma.Manager`.\n\n```elixir\n# Manually start Visma.Manager. This process\n# is registered.\n{:ok, pid} = Visma.Manager.start_link()\n\n# Get the current token assigned to the manager.\nVisma.Manager.get_token()\n\n# Get all templates availables.\nVisma.Manager.get_signing_templates()\n\n# Get all availables templates sorted by id (Id field)\nVisma.Manager.get_signing_templates_by_id()\n\n# Get all availables templates sorted by name\n# (FriendlyName field)\nVisma.Manager.get_signing_templates_by_name()\n```\n\n## Low Level Usage (with `Visma.Api`)\n\nThis application can also be used as a library. Here\nan example to initiate a new signature. At first,\na token is required.\n\n```elixir\n# A token is required when we do a request. If\n# Visma.Manager is started, we can also call\n# Visma.Manager.get_token().\n{:ok, token} = Visma.Api.new()\n|\u003e Visma.Api.login(\n    email: \"my@email.com\",\n    password: \"mypassword\"\n)\n|\u003e Visma.Api.send()\n```\n\nA signing request is required as well.\n\n```elixir\n# First, we generate a signing data-structure\nsigning_request = Visma.Signing.new()\n\n# A request has mandatory parameters, like its name\n# but also a reference numbeder and a valid signing\n# template id (you can find it using\n# Manager.Visma.get_signing_templates)\n|\u003e Visma.Signing.request(\n    name: \"my signing request name\",\n    reference_number: \"12345\",\n    signing_template_id: \"valid-signing-template-id\"\n)\n\n# Next, we can configure a new sender.\n|\u003e Visma.Signing.sender(\n    name: \"My Sender Name\",\n    company_name: \"My Company Name\",\n    email: \"my@email.com\",\n    phone: \"My Phone\"\n)\n\n# Next, we can set one or many recipients. A\n# valid name and CPR number are mandatory.\n|\u003e Visma.Signing.recipient(\n    name: \"John Doe\",\n    cpr: \"1234567890\",\n    email: \"john@doe.test\"\n)\n|\u003e Visma.Signing.recipient(\n    name: \"John Smith\",\n    cpr: \"2345678901\",\n    email: \"john@smith.com\"\n)\n\n# Finally, we can now set the attachments/documents\n# to send to Visma. Visma only support `application/pdf`\n# mime type, so, this is the default set if not\n# present.\n|\u003e Visma.Signing.document(\n    name: \"billing.pdf\",\n    data: File.read!(\"billing.pdf\"),\n    mime_type: \"application/pdf\"\n)\n```\n\nWhen the request is ready, 2 methods can be\nused to send the request. The first one is\nusing only `Visma.deliver/1` function. This\nfunction deal with required token and other\nobjects.\n\n```elixir\nVisma.deliver(signing_request)\n```\n\nOr using `Visma.Api.send/1` function. This method\nis more complex but it is a low level way.\n\n```elixir\n# Create a new Visma API request\nVisma.Api.new()\n\n# Set it with to deal with a new signing process\n# signing_request parameter must be map()\n|\u003e Visma.Api.initiate_signing(\n    token: token,\n    signing_request: Visma.Signing.to_map(signing_request)\n)\n\n# Send the request\n|\u003e Visma.Api.send()\n```\n\n# References and Resources\n\n- Visma Code Samples: https://github.com/vismaaddo/AddoSamples\n- Visma REST API Documentation: https://documentation.autoinvoice.visma.com/rest-api/\n- Visma API Documentation: https://support.vismaaddo.net/hc/en-us/articles/360017702120-API-documentation\n- Visma Account Documentation: https://support.vismaaddo.net/hc/en-us/articles/360018618439-Test-account-for-API\n- Visma Releases Notes: https://support.vismaaddo.net/hc/en-us/sections/360004890299-Release-notes\n- Visma OpenAPI Documentation: https://documenter.getpostman.com/view/4950720/RWMLJkeo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfmak%2Fvisma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfmak%2Fvisma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfmak%2Fvisma/lists"}