Skip to main content

Company identifier (Company ID) and list of created companies using the API

How to find a company's ID and view a list of created companies

Written by Lenka Haringerová

To access data via the Flexi REST API, you need to know the company identifier. It is usually derived from the company name, but this is not a requirement. The identifier must be unique for the company on a given server.

Allowed characters in the identifier are lowercase letters, digits, and underscore — any other characters in the company name are replaced with an underscore. If a company with the same name already exists, a sequence number is appended to the identifier.


When the identifier changes

  • The identifier remains unchanged if you rename the company.

  • If you back up and restore the company within the same data source, it will receive a different identifier.

  • If you delete the company and create it again, a different company may end up with the same identifier.

⚠️ Therefore, do not use the identifier as a permanent company key in your integration. If you store it, verify it again after restoring the company from a backup.


How to find the identifier

There are two options:

1) From the web interface

Log in to the web interface via a web browser, and you can find the company identifier right away in the address bar. In this case, the identifier is demo_neziskova:

https://demo.flexibee.eu/c/demo_neziskova

2) Via the REST API

Using the GET method on the URL server:port/c.xml, or alternatively /c.json:

GET https://demo.flexibee.eu:5434/c.xml?limit=0

This query returns a complete list of companies in XML/JSON. In the field dbNazev you will find the identifier, and in the field nazev the user-friendly company name as displayed 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>


Fields in the output

dbNazev

Company identifier — the value you use in the URL after /c/

nazev

User-friendly company name as displayed in the application

createDt

Date the company was created

show

Whether the company is accessible

stavEnum

Company status: ESTABLISHING — being created, ESTABLISHED — active, MAINTENANCE — under maintenance

watchingChanges

Whether change tracking is enabled

licenseGroup

Identifier of the license group the company belongs to

ℹ️ Without the parameter limit, the output is paginated like with other records. The value ?limit=0 returns all companies at once.


Related

Did this answer your question?