The FlexyBox APIs allow data to be read and manipulated in the FlexyBox systems.
The FlexyBox systems are built up of multiple microservices, each with its responsibilities and API.
We are currently in the process of renewing a lot of APIs and moving them into the cloud so there are some discrepancies in how the APIs are hosted and documented, we are moving as fast as possible to realign everything.
Authentication
All APIs are protected by OAuth 2.0 and OpenID Connect. Access tokens are issued by the FlexyBox Identity platform, and every other FlexyBox API accepts them as Authorization: Bearer <token>.
The Identity platform, including the OAuth flows, token validation and code examples, is documented here: https://identity-v3.flexybox.com/api/index.html
Create an application (ClientId and ClientSecret)
Before you can get a token, your integration must be registered as an application in FlexyBox Administration:
You must be signed in as an administrator of the system. If you are not an administrator, contact the administrator of your system.
When you create the application, you choose its client type. It cannot be changed afterwards:
Public for apps whose code the user can read, such as a website running in the browser (SPA), a mobile app or a desktop app. A public application gets a ClientId but no ClientSecret, and signs users in with the authorization code flow with PKCE.
Confidential for a backend service that can keep a secret on a server. A confidential application also gets a ClientSecret and can use the client credentials flow for service-to-service calls.
The ClientSecret is shown only once, when the application is created. If it is lost, generate a new one in FlexyBox Administration. This invalidates the old secret.
Never send a ClientId or ClientSecret in plain text by email, chat or in a support ticket. Share it with a one-time link from https://secret.flexybox.com instead. The link can only be opened once.
FlexyBox Support cannot create applications, ClientIds or ClientSecrets. This must be done by the administrator of the system.
Get a token
All tokens are issued by the token endpoint POST https://identity-v3.flexybox.com/api/v3/tokens/exchange. Which flow you use depends on your application:
Signing in users (customers or employees): use the authorization code flow with PKCE. The user signs in at FlexyBox, and your application never sees the password. A token for an end user only gives access to that user's own data.
Service-to-service (no user involved): use the client credentials flow with your ClientId and ClientSecret. Only use it from a server; the ClientSecret must never be placed in a browser or app.
Access tokens are valid for 4 hours. Request the offline_access scope to also get a refresh token, valid for 30 days.
Step-by-step guides and code examples for both flows are in the Identity documentation.
Structure
Cloud APIs will use CQRS, meaning most will likely have different read models than their write models.
Inserting and updating data will use REST principles wherever possible.
Public API's
CRM: https://crm.flexybox.com/api/v1/index.html
Products: https://products.flexybox.com/api/
POS: https://pos.flexybox.com/api/
Booking: (https://booking-api.flexybox.com/api/ & https://booking-api.flexybox.com/api/v1/index.html)
Orders: https://orders.flexybox.com/api/
Online payment: https://azure.flexybox.com/onlinepayment/api/
Departments: https://api.flexybox.com/api/v2/departments
Access control: https://accesscontrol.flexybox.com/api/index.html
BI: https://bi.flexybox.com/api/index.html : https://bi.flexybox.com/api/v1/index.html
Local APIs
In addition to the cloud-based APIs, there are currently also around 70 API's on the customer local client.
These are available on the customer's IP address at the following URL.
http://[SERVERIP]:1006/docs/index
For secure access to a local API, use our HTTPS proxy:
https://proxy.flexybox.com/api/Local/{departmentId}/v1/attendances
Replace {departmentId} with the department's public GUID. Replace v1/attendances with the local API path without its leading api/.
Our support department can supply the local server IP address by contacting [email protected].
Questions
If you have any questions regarding the APIs or great insight to help us improve, please don't hesitate to contact our API support @ [email protected]
If you need a live consultancy with a developer from our development department, this will be charged at a rate of 1.495 DKK/hour, billed per commenced ½ hour.
