To access data via the Flexi REST API, you need to know the company identifier. It is usually derived from the company name, provided the name has not been changed. The identifier is always unique for a company on a given server.
Allowed characters in the identifier are lowercase letters, digits, and underscores; all other characters in the company name are replaced with an underscore. If a company with the same name already exists, a sequential number is appended to the identifier. Therefore, if you back up and restore a company within the same data source, it will receive a different identifier. The identifier remains unchanged if you rename the company. If you delete a company and recreate it, a new company may be registered under the same identifier.
There are two ways to obtain the company identifier
1) Log in to the web interface via a web browser — the company identifier is immediately visible in the browser's address bar. In this case, the identifier is demo_neziskova:
2) Using the REST API with the HTTP GET method by sending a request to the URL server:port/c.xml, or alternatively https://demo.flexibee.eu:5434/c.xml?limit=0, for JSON.
This REST API query returns a complete list of companies in XML/JSON format. The dbNazev field contains the identifier, and the nazev field contains the human-readable company name as it appears in the application. Sample output:
<companies>
<company>
<createDt>2020-03-05T12:51:18.757+01:00</createDt>
<dbNazev>demo</dbNazev>
<id>-2</id>
<licenseGroup>39fa897328d1e6a55ab199f1410015d2</licenseGroup>
<nazev>Demo firma</nazev>
<show>true</show>
<stavEnum>ESTABLISHED</stavEnum>
<watchingChanges>true</watchingChanges>
</company>
<company>
<createDt>2012-09-10T13:24:49.765+02:00</createDt>
<dbNazev>demo_de</dbNazev>
<id>-2</id>
<licenseGroup>39fa897328d1e6a55ab199f1410015d2</licenseGroup>
<nazev>Já Živnostník</nazev>
<show>true</show>
<stavEnum>ESTABLISHED</stavEnum>
<watchingChanges>true</watchingChanges>
</company>
</companies>
Additional fields are available, such as the creation date (createDt), whether the company is accessible (show), and its current status (stavEnum): ESTABLISHING — being set up, ESTABLISHED — active, MAINTENANCE — under maintenance, as well as whether change tracking is enabled (watchingChanges).
