My Products
Help
Michel V
CONTRIBUTOR ***

Questions regarding branchID and API roles

by Michel V

Hello,

I have 2 questions regarding (i think) some changes being made to the API.

- the 'branch-id' header seems to be mandatory now for some POST requests for example customerinvoices (even if the company does not have branches setup). Normally if you did not set this header the main branch would be auto selected.

- The connected account (does not matter if you have a token from the old or new auth flow) needs the role API USER in financials. If the used user does not have this role i get the following error message:
"Error creating document. Error: BranchID not found in the system. Check whether you have access rights to this object.

I would like to know if this is true or if i am missing something it looks kind a out of the blue, a lot of our connections got these errors all of a sudden.

With kind regards,

Michel

5 REPLIES 5

by Magnus Johnsen

Hi,

It's not mandatory to send the branchId in the customerInvoice, and it's not mandatory to have the API user role when using the old authentication flow:

2023-03-10 12_40_30-POST CustomerInvoice - My Workspace.png

Are you having this issue on all customers or can you see a pattern to those that are affected?

Michel V
CONTRIBUTOR ***

by Michel V

Hi Magnus,

Thanks for your answer!

I don't mean the branch in the body i mean the HTTP header 'branchid' 
I think this issue appeared like 2-3 weeks ago, and it affected all our connections where a supplier- or customerinvoice was being posted. For some it was enough to set the HTTP header to the specified main branch (for the most this was number 1). Others, applying the API user role fixed for us the issue.
Could it be an issue related to the specified user and if it has rights to the main branch and the role "API USER" just gives you overall API rights? Something that seems "new" to me is that an api user has all rights in the API but as soon as it logs into the financials UI it can't see any data. 

by Magnus Johnsen

Hi,

The API user only gives right to access information via the API in the same way the Financials User gives you access to the UI.

On top on of that you need the "Financials User" & "Financials Administrator" to have the right to all actions at the moment.

The API user role is also only needed for the connect authentication, as far as I know there has not been any changes to headers needed either, have you been informed to use the "branch" header?

Michel V
CONTRIBUTOR ***

by Michel V

Hi Magnus,

We have not been informed to use the "branch" header, but we needed a fix quick and it seemed to fix for us the issue on a lot of our applications.

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

There seems to be several cases of this happening, to consolidate all the answers, we wil be posting the answers in this thread

If you still have an issue when we have announced a fix, please do so in the thread and we'll continue from there.
Thank you!