My Products
Help
Florian Haase
PARTNER

Access API by Codeflow - Company missing

by Florian Haase (Updated ‎25-05-2022 16:21 by Florian Haase PARTNER )

Hi,

 

one thing we don't figure out: We have an integration based on the old API access with codeflow. We are able to connect the user and the user has access to the company which should be integrated in the user interface. We added all roles in admin both on customer and company-level.

 

But in the GraphQL we don't get the new company up, just one which was connected before: 

Here the GraphQL query:

query {
company {
items {
name}}}

 

and here the result:

{
"data": {
"company": {
"items": [
{
"name": "#Demo VBC Økonomibistand AS"
}
]
}
},
"extensions": {
"vbnxt-trace-id": "00000000000000005f2da53668ff1373"
}
}

 

In VBNxt I also have access to the customer Soma 1 AS which has one active company - this company I don't get in the result above.

 

How do we get access to the company by the API?

 

Florian

3 REPLIES 3
Florian Haase
PARTNER

by Florian Haase

Takk, da er det løst 🙂

Accepted solution
omelhus
PARTNER

by omelhus

The query to fetch available companies is the following:

 

query GetAvailableCompanies {
availableCompanies {
totalCount
items {
name
vismaNetCompanyId
}
}
}

 

Note that for the time being this only works in the user context (authorization code flow).

Accepted solution
Øyvind Årseth
VISMA

by Øyvind Årseth

Hi Florian,
Please check the documentation, specifically the bottom part of this section: https://docs.business.visma.net/docs/schema/queries/companies
You need to provide a customer number, the documentation should take you all the way, query examples are included.