My Products
Help

Testing the Visma.net ERP API from Swagger

17-02-2023 13:00 (Updated 17-02-2023)
  • 12 Replies
  • 1 kudos
  • 8186 Views

The Visma.net ERP API documentation is created using Swagger, which presents a graphical user interface for documenting the endpoints. 

The documentation can be found here: https://integration.visma.net/API-index/.

 

An added benefit of using Swagger to present the documentation is that you can test the API by making API-calls directly from the documentation. This guide describes how to do that.

Authentication-methods

Visma.net ERP API supports two different authentication-flows targeted against different types of applications. The functionality of the API is identical for the two flows.

Visma net ERP Interactive API

This flows is designed for applications/integrations that should run in the context of a specific user and requires the users to sign in using their Visma.net ERP credentials. All API calls will impersonate this user. 

Visma net ERP Service API 

This flow is designed for applications that should not run in the context of a user, but in the context of the application/integration itself. The authentication does not require a user to sign in. The flow is especially targeted against service-applications running in the background without user interaction.

 

You can switch between the to flow in the Select an API: - drop-down on top of the documentation page. 

 

ThomasSkjrten_0-1676630612281.png

 

Once you have selected the desired flow, you can authenticate to the API by pressing the Authorize button. The flow will be different for the two methods so the rest of this article will be divided into to parts.

Visma net ERP Interactive API

When pressing the Authorize-button you will be presented with a Visma.net sign-in screen i a new window or tab. Any Visma.net user can be used to sign in here, but the user must have the role API User on one or more Visma.net Financials companies. 
This role can be set from Visma.net Admin:

 

ThomasSkjrten_0-1676634051956.png

 

After you have logged in with you username and password you will be presented with the context-selector screen if you have the API User role on more than one Visma.net Financials company. Select the company you want to work with.
If you only have access to one company the screen will be omitted and the company will be automatically selected.

ThomasSkjrten_1-1676634187759.png

When the company is selected you will be brought back to the Swagger UI and presented with a confirmation screen.
You can now close this screen and start making your API-requests.

ThomasSkjrten_2-1676634255105.png

Visma net ERP Service API

As mentioned the service flow does not require a user to log in, but it needs to identify the application that are making the API requests. These types of applications needs to be created before the can be used in the Visma Developer Portal

A guide to how you can register this application can be found here.


Once you application has been registered and you have received your Client ID and Client Secret, a representative for the company you want to access needs to approve your applications access from Visma App Store.

You also need a Tenant ID, which is the unique identifier for a Visma.net Financials company. This Tenant ID can be found in Developer Portal for all the companies that has approved your applications access.


When you press the Authorize-button you will be presented with a popup where you can
supply your Tenant ID, Client ID and Client Secret and select the required scopes (access permissions).

ThomasSkjrten_0-1676635127922.png

 

Press the Authorize-button to get your access token.

 
Making API requests

To make an API-request choose the endpoint you want to use and press the Try it out button.

ThomasSkjrten_3-1676634392633.png

 

You now have the list of available parameters visible and you can type in a value to any of the parameters you need.
After you have filled in your parameters press Execute to execute the request.

ThomasSkjrten_4-1676634489400.png

 

The API request will be executed and the result will be visible in the UI:

ThomasSkjrten_5-1676634542808.png

 

 

 

Comments
by Gert-Jan van der Kamp (Updated ‎21-02-2023 20:23 by Gert-Jan van der Kamp )

I don't see the Api User role in Admin, what are the steps to enable that? 

by Thomas Skjørten

The API User role is dependent on a license called "Visma.net Financials API access", so this has be in place before the API User role is visible in Admin.
 
It might be a bit different how each country is handling this license, but for Norway it should be added to all existing and new Visma.net ERP customers.

I suggest contacting your local Visma.net ERP consultant to check/add the license.

by Anders_Traventus

In Sweden we have to order an license called "API användare (Devportal)" translated to English "API user (Devportal)" to be able to add API User in Admin.

by Gert-Jan van der Kamp

Thanks, Partners NL got it working after adding the "Visma.net Financials API access" indeed. Just pulled some data though it. 

nmfoss
CONTRIBUTOR *
by nmfoss

Where is the Swagger documentation ?

 

nmfoss_0-1693467422470.png

 

by Gert-Jan van der Kamp

Sorry just read this, can't seem to figure out how to only get emails for my own questions. 

 

https://integration.visma.net/API-index/

 

 

nmfoss
CONTRIBUTOR *
by nmfoss

I am sorry, but in the comment above I posted an image of what it looks like when I goto that URL, as it is broken. In the developer tools console it says 404 source not found for the main.js file.

by Gert-Jan van der Kamp

Works for me, probably something on your end. 

 

Are you using a mainstream browser like chrome/ edge? 

Try CTRL-F5 to drop the cache. Else I wouldn't be able to help you.. 

 

nmfoss
CONTRIBUTOR *
by nmfoss

CTRL+F5 fixed it! Ashamed to say I did not try that! Thank you!

mattias_playgroundmusic
CONTRIBUTOR *
by mattias_playgroundmusic

Trying to make API requests using the Service API, I get the IPPException "No license for this company."... ExceptionFaultCode 12027.

 

I have registered my test app, had it approved by our user in the App Store. Creating an access token works just fine and I have the tenant ID. What's missing?

by Gert-Jan van der Kamp

Contact your hosting partner, they need to add the "Visma.net Financials API access"  license to your Visma environment, then you can assign the "API User" role to the user you want to give access to. 

mattias_playgroundmusic
CONTRIBUTOR *
by mattias_playgroundmusic

Thank you Gert-Jan. It seems like we do need a new license. Strange how none of the docs seem to mention it.

 

For a Service call, the docs say I don't need a user or a role, but the license seems likely. Thanks again.

Contributors