My Products
Help
RonnyV
CONTRIBUTOR ***

Visma.connect invalid scope vismanet_erp_service_api:create

by RonnyV

Hi,

 

In our app we have requested the scope vismanet_erp_service_api:create:

RonnyV_0-1697726961258.png

 

For most of our clients this works as expected. However for one client we are unable to

POST https://connect.visma.com/connect/token

 

For the failing client the response we get says: { "error": "invalid_scope" }

 

I have narrowed it done to be caused by the scope vismanet_erp_service_api:create.

 

The following body works

grant_type=client_credentials&scope=visma.net.erp.salesorder:read visma.net.erp.salesorder:write vismanet_erp_service_api:delete vismanet_erp_service_api:read vismanet_erp_service_api:update&client_id=<client id>&client_secret=<client secret>&tenant_id=<tenant id>

 

But when I add the scope for vismanet_erp_service_api:create the request fails with

{ "error": "invalid_scope" }

 

The client says that they have activated all the requested permissions by the integration.

 

What can I do to find out why the create scope fails?

 

/Ronny

6 REPLIES 6
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

You can check what permissions you have in the developer portal under "My applications" -> "Integrations" -> "Customers".

Is there a reason you are sending the scopes for both the salesOrder and the service api?

RonnyV
CONTRIBUTOR ***

by RonnyV

Yes, we need to fetch information about both shipments and sales orders. For example we fetch currency information from the sales orders connected to a shipment.

 

We use the sales order API since we added that to our integration when you said that the sales order endpoints would be removed from the ERP API, but since then you have updated the removal until Q4 2024 unless I am mistaken. We did not see any issues with still using the new API though, so I kept the integration logic as the updated one.

 

I see now that the customer has not approved the delete scope for the ERP API. And the request to connect works as expected when not applying for that scope, and fails as expected when the scope is included.

 

I will contact the client again and see if they have changed anything since yesterday.

by Magnus Johnsen

Alright! Let us know if you still have any issues when that has been sorted.

Thank you. 

RonnyV
CONTRIBUTOR ***

by RonnyV

The problem was of course that they had not accepted all the permissions, but still said that they had.

 

Regarding multiple APIs, would you recommend us to still use the ERP API for sales order stuff?

by Magnus Johnsen

Hi Ronny,

Has this been resolved?

Regarding multiple API's, we would still recommend to use the new service where you can as it has way better performance. 

RonnyV
CONTRIBUTOR ***

by RonnyV

Hi Magnus,

 

Yes this has been resolved. Forgot to mark the solution, will do that right now.

 

Thanks!