{{param.name}}
An Addon is something which extends the Zoezi product with additional functionality. It can be anything from a small widget displaying number of active members to an entire entry system integration. A supplier is the company behind an addon.
To register as a supplier, go to the Zoezi developer portal: https://developer.zoezi.se/
After successful registration a test system will be created. That test system can be used to see the addons in action during development.
A supplier can add several developers who are allowed to login and create and manage addons. Using the main supplier account, developer accounts can be added and removed. Development can also be done with the main supplier account.
In the developer portal a supplier and its developers can:
When writing a widget or a webhook, there are two ways in which Zoezi will call that widget or webhook.
There are two ways of integrating with Zoezi. The most basic approach: using the public and member-API's, or the more advanced one, allowing access to all of the Zoezi API's and possibility to write widgets, by writing an Addon.
Every integration must authenticate itself. Every integration has an API key for that purpose. Authentication is done using the HTTP Authorization header. Example:
curl -H "Authorization: Zoezi {{key ? key : 'ABCDEF123ABC'}}" https://{{getHost()}}/api/public/workout/get/all?fromDate=2019-01-01&toDate=2019-12-31
The API is versioned. The version is put in the URL path in the following way for {{version}}:
https://{{getHost()}}/api/v{{version}}/public/workout/get/all?fromDate=2019-01-01&toDate=2019-12-31
If the version part of the URL is omitted, the latest version of the API will be used. Beware that it may break, when newer versions of the API is released. To use the latest version of the API:
https://{{getHost()}}/api/public/workout/get/all?fromDate=2019-01-01&toDate=2019-12-31
Permission
. An integration with no permissions assigned cannot call any API's which require any permissions. Only public methods are available to those integrations. If an addon has the Permission Show payments
it can use the method /api/payment/get/
A widget is embedded inside the system using an Iframe. There are three types of widgets:
There are three ways to create a widget.
apikey
hostname
user_id
settings
settings.zoezi_staff_id
settings.zoezi_customer_id
zoezi_host
zoezi_user_id
zoezi_settings
zoezi_settings.zoezi_staff_id
zoezi_settings.zoezi_customer_id
Vue 3 components are very basic and basically only has one dependency which is Vue3. A minimal interface exists as this.$api or window.$zoeziapi.
zoezi_settings.zoezi_staff_id
zoezi_settings.zoezi_customer_id
Webhooks is a way to get notified of events occurring. A customer account being created, a payment being paid, an entry being made or a booking being made are some examples of events.
events
hostname
webhook_id
apikey
type
id
clubid
action
Every webhook request is sent using POST
method with body data in JSON format.
events
hostname
webhook_id
salt
type
id
clubid
action
For supplier hosted webhooks, the origin should be checked. For Zoezi hosted webhooks, that is not required. Every webhook is configued with a secret. This secret is used to create a checksum which is sent in every webhook request in a header named X-Zoezi-Checksum
. This checksum can be used to verify that the webhook originates from Zoezi.
The checksum is created in a way similar to this:
checksum = hmac(secret, request_body, SHA256)
In order to verify the checksum, here is a python example:
Our secret: hello
The body: some data
Calculated checksum: bbabdc400efff57f8a7687ff99000b567a6de4704bd3db608d1a1ca46ed94fd2
Python code:
wss://{{getHost()}}/api/async?type=staff
id
pid
type
action
data
type
: [String] ("image", "video") The type of media to show in the library.
change
: [String] The id of the selected image. This value is emitted out of the component.
columns
: [Number] How many columns the images should be shown in.
canShow
: [Boolean] If images in the grid should be viewed larger when clicked on.
{ canCancel: true, lastCancelTime: DateTime rules: [ {time: {value: 1, timeunit: 'week', relative: 'beforestart'}, cost_percent: 50, cost_fixed: 0 }, {time: {value: 2, timeunit: 'week', relative: 'beforestart'}, cost_fixed: 100 } ] }
{ count: 1 extra_person (optional) optional_resource (optional) rbservice_id service (object) reservation (id of reservation) slots: [ start end rbservice_id staff_id ], context (optional context), extended_info (answer to questions) tmp_id (in order to link additional products) }