2

When I download the list of companies using the end point Administrations either through the user front end or directly using a HTTP GET, I receive an XML with contents such as:

<?xml version="1.0" encoding="UTF-8"?>
<eExact xsi:...>
  <Administrations>
    <Administration>
    ...
    </Administration>

I can receive the list of companies also using the REST API system/divisions.

In general the number and names companies listed in both are equal, although some fields are present in XML API that are not present in the REST API and vice versa.

However, sometimes the contents are different. For instance, today I had scenario where there were only 2 companies listed in the XML topic, but over 900 in system/divisions.

This occurs both using the APIs directly as through Invantive SQL.

Why is the outcome different?

Guido Leenders
  • 4,232
  • 1
  • 23
  • 43

2 Answers2

1

All topic are read using a specific company (in the URL named division) to retrieve the data from.

System/divisions REST API returns ALL companies accessible for the current user, so the outcome does not depend on the division used in the URL request.

However, the XML topic Administrations returns ONLY companies accessible for the current user that are of the SAME customer account of the division used in the URL request.

A customer account is number of 1 or more companies which is independently billed. For entrepreneur licenses, this is generally the same list of companies.

However, for an accountant it differs what company is used, since they may have hundreds of different customers each with their own licenses plus many companies under their own customer code.

In general, it is more wise to use the system/divisions.

However, when you need additional fields or for instance the classifications of a company, you will need to use the XML API. The easiest way to determine the minimum number of companies to retrieve the XML API Administrations data for is to:

  • First retrieve all system/divisions.
  • For every different value of customercode, find one division, for instance the minimum value.
  • For each of these divisions, access the end point Administrations.
  • Combine the output of each of those.
Guido Leenders
  • 4,232
  • 1
  • 23
  • 43
1

You can also use one of the four views:

These query the administrations across all subscriptions an accountant has access too.

Guido Leenders
  • 4,232
  • 1
  • 23
  • 43
Goombah
  • 2,835
  • 2
  • 12
  • 22