My Products
Help
lema
CONTRIBUTOR ***

Our account can not add the interactive api in scope when we request auth code

by lema

We try to request a auto code, then get a token with the code.

1. If we add scope with "openid+email+profile+offline_access+phone+address+tenants", the visma.net page show correct modal after we login with our account. But the token only can get userinfo, token can not get resource api, the api return 401 error, we try the "https://integration.visma.net/API/controller/api/v1/customer"

2. If we add scope "openid+vismanet_erp_interactive_api:read", the visma.net will show a error message "Access denied".

Could you please help me to check what is the issue ? we missed anything ?

 

lema_2-1686796990234.png

 

 

lema_3-1686797188734.png

 

 

lema_4-1686797243856.png

 

 

5 REPLIES 5
Accepted solution
Yıldırım
VISMA

by Yıldırım

Hi,

apparently you're missing API User Role. The user doing the authorization needs to have that role on at least one company/tenant, that should be done from Visma.net Admin. 

lema
CONTRIBUTOR ***

by lema

Thanks, we can get the code with vismanet_erp_interactive_api scope after we add the roles in admin portal.

I have another questions, if I want to query another company records, then user should login with their account at auth code page. Should I add this another company user in my admin portal first ? then we could get another company records. If we want to integrate 100 companies, then we need add 100 users first in our admin portal ? each user match to a company?

Yıldırım
VISMA

by Yıldırım (Updated ‎16-06-2023 14:14 by Yıldırım VISMA )

Consider the interactive API auth like, you're logging to the ERP Company in the UI so that, yes, the user should have access to each company you'd like to log in. 

Edit: There might be a way to collectively add this role to the user<>companies, those have been confirmed with the company owners. So that, I'd recommend contacting your Partner Service (Licensing) to clarify this option.

lema
CONTRIBUTOR ***

by lema

Thanks, If I want to query company A records, then our web direct to visma auth code, then company A should login their user account, and this user account should has access rights which setting under company A admin portal. Is it correct flow ?

Yıldırım
VISMA

by Yıldırım

Hello Lema, that's correct. Are you using the Developer Portal & App store ?