Author Archives: Keith Whitby

App Settings File

Your app can use multiple canvases or register multiple webhooks. Each resource can have different properties, and they must be described using the settings file. The settings file is similar to a manifest file used in other languages/frameworks and follows a JSON format.

App settings file found on the admin dashboard under ‘Apps –> Develop –> Your app’

On this page

File format

In the example below, we have specified that we’d like the app to add a canvas on the admin dashboard’s main menu, and listen to a webhook that is fired every time a user cancels a booking:

{
  "canvases": [
      {
        "type":"ADMIN_MAIN_MENU",
        "url": "https://api.optixapp.com/canvas-placeholder",
        "title":"My app interface",
        "icon":"exporter"
      }
    ],
"webhooks": [
      {
        "event": "member_booking_cancelled", 
        "url": "https://example.com/webhook/listener"
     }
   ]
}

The file itself is an object with two top-level keys (“canvases” and “webhooks”), both of which are optional, and their values are arrays of corresponding objects.

Canvases

The canvas object has three primary keys, plus specific options (like title, icon, height):

  1. “type”: The type of canvas. Required.
  2. “url”: The target URL for the canvas. Required.
  3. “identification”: Field that identifies the canvas between other canvases. Optional if you don’t have two or more canvases using the same type.

To view the available canvas types and options, visit the Canvas lists for the mobile app and admin dashboard.

The canvas URL is manipulated before being introduced into the interface. To enable contextual experiences, Optix adds an authentication token that can be used by the canvas to retrieve user/organization-wide data.

If you don’t provide a “macro” to be replaced, the canvas system appends the variable “token” to the query parameter list of the URL.

Using macro replacements

Macros can be defined to customize the URL generation. With macros, you can change the request variables, repeat information, and also use fragment variables.

Example 1:
If you provide “https://example.com/mypage”, the Optix system opens the link “https://example.com/mypage?token=thepersonaltokengenerated”

If you want to change the URL to use a specific format, you can use macroses, like “{token}.”

Example 2:
If you provide “https://example.com/mypage?mytoken={token}” the Optix system opens the link “https://example.com/mypage?mytoken=thepersonaltokengenerated”

You can also use the macro as part of the URL path or a fragment.

Example 3:
If you provide “https://example.com/mypage/{token}/show” the Optix system opens the link “https://example.com/mypage/thepersonaltokengenerated/show”

Example 4:
If you provide “https://example.com/mypage?anyother=var#mytoken={token}” the Optix system opens the link “https://example.com/mypage?anyother=var#mytoken=thepersonaltokengenerated”

If your canvas application backend does not require the token, we support the use of tokens in the URL fragment (example 4) for security purposes. In this case, the token is never sent to the backend.

Macros list

Variable name/Canvastokenlocation_id(other fields)
MOBILE_HOME_SECTION
MOBILE_HOME_PRIMARY
MOBILE_TAB_BAR_ITEM
MOBILE_MORE_SCREEN
ADMIN_APP_SETTINGS
ADMIN_MAIN_MENU
Variable name/Canvastokenlocation_id(other fields)
MOBILE_HOME_SECTION
MOBILE_HOME_PRIMARY
MOBILE_TAB_BAR_ITEM
MOBILE_BOOKING_ACTIVE_TRAY*booking_id
MOBILE_BOOKING_CONFIRMATION*booking_id
MOBILE_BOOKING_DETAILS*booking_id
MOBILE_MORE_SCREEN
MOBILE_MODAL*
ADMIN_APP_SETTINGS
ADMIN_MAIN_MENU
ADMIN_MODAL*
ADMIN_USERS_TAB*
ADMIN_BOOKINGS_TAB*
ADMIN_COMMUNITY_TAB*
ADMIN_PLAN*plan_id
ADMIN_RESOURCE*resource_id
ADMIN_USER_SIDEPANEL*user_id
ADMIN_TEAM_SIDEPANEL*team_id
ADMIN_BOOKING_CONFIRMATION*booking_id

* Not currently available

Webhooks

The webhook object has 2 required keys:

  • “event”: The event name.
  • “URL”: The target URL for the webhook. Your URL can contain GET parameters.

Check the webhook list to see all available events and data.

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Icons for Canvases

Canvases that support icons require you to specify which icon you want to use. The table on this page shows the icon and the name you need to specify.

On this page

Available icons

Copy the name of the icon and use it when specifying your canvas settings in the app settings file.

activity
airplay
alert-circle
alert-octagon
alert-triangle
align-center
align-justify
align-left
align-right
anchor
aperture
archive
arrow-down-circle
arrow-down-left
arrow-down
arrow-down-right
arrow-left-circle
arrow-left
arrow-right-circle
arrow-right
arrow-up-circle
arrow-up-left
arrow-up
arrow-up-right
at-sign
award
bar-chart-2
bar-chart
battery-charging
battery
bell-off
bell
bluetooth
bold
bookmark
book-open
book
box
briefcase
calendar
calendar-star
camera-off
camera
cast
check-circle
check
check-square
chevron-down
chevron-left
chevron-right
chevrons-down
chevrons-left
chevrons-right
chevrons-up
chevron-up
chrome
circle
clipboard
clock
cloud-drizzle
cloud-lightning
cloud-off
cloud
cloud-rain
cloud-snow
codepen
code
coffee
command
compass
copy
corner-down-left
corner-down-right
corner-left-down
corner-left-up
corner-right-down
corner-right-up
corner-up-left
corner-up-right
cpu
credit-card
crop
crosshair
database
delete
disc
desk
dollar-sign
download-cloud
download
droplet
edit-2
edit-3
edit
external-link
eye-off
eye
facebook
fast-forward
feather
file-minus
file-plus
file
file-text
film
filter
figma
flag
folder-minus
folder-plus
folder
frown
gift
git-branch
git-commit
github
gitlab
git-merge
git-pull-request
globe
grid
hard-drive
hash
headphones
heart
help-circle
home
home-unlock
image
inbox
info
instagram
italic
key
layers
layout
life-buoy
link-2
linkedin
link
list
loader
lock
log-in
log-out
mail
map-pin
map
maximize-2
maximize
megaphone
meh
menu
message-circle
message-square
mic-off
mic
minimize-2
minimize
minus-circle
minus
minus-square
monitor
moon
more-horizontal
more-vertical
mouse-pointer
move
music
navigation-2
navigation
octagon
package
paperclip
pause-circle
pause
pen-tool
percent
phone-call
phone-forwarded
phone-incoming
phone-missed
phone-off
phone-outgoing
phone
pie-chart
play-circle
play
plus-circle
plus
plus-square
pocket
power
printer
radio
refresh-ccw
refresh-cw
repeat
rewind
rotate-ccw
rotate-cw
rss
save
scissors
search
send
server
settings
share-2
share
shield-off
shield
shopping-bag
shopping-cart
shuffle
sidebar
skip-back
skip-forward
slack
slash
sliders
smartphone
smile
speaker
square
star
stop-circle
sun
sunrise
sunset
tablet
tag
target
terminal
thermometer
thumbs-down
thumbs-up
toggle-left
toggle-right
trash-2
trash
trello
trending-down
trending-up
triangle
truck
tv
twitter
type
umbrella
underline
unlock
upload-cloud
upload
user-check
user-minus
user-plus
user
users
user-x
video-off
video
video-conference
voicemail
volume-1
volume-2
volume
volume-x
watch
wifi-off
wifi
whiteboard
wind
x-circle
x
x-square
youtube
zap-off
zap
zoom-in
zoom-out

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Admin Dashboard Canvases

These canvases display in the web-based Optix admin dashboard and are used to create experiences for admins. To use the canvases in your app, you need to specify them in your app settings file.

On this page

1. App settings

This canvas could be used to display all of the global configuration UI that your app needs (e.g., dropdown select boxes with settings or an OAuth flow to get integrations connected). It opens when a user clicks the Configure button on the Apps → Manage apps menu item.

JSON type

ADMIN_APP_SETTINGS

Settings file example

Learn more about using this in the app settings file section.

{  
   "canvases": [  
      {  
         "type": "ADMIN_APP_SETTINGS",
         "url": "https://api.optixapp.com/canvas-placeholder",
         "title": "My app interface"
      }
   ]
}

 

Placement in admin dashboard

The admin dashboard displaying a full-screen canvas for an app’s settings.

  1. title
  2. url (loaded in an iframe)

 

Example app

2. Main menu item

This canvas is displayed in a section much like the other core features. It is accessed from the main left menu.

JSON type

ADMIN_MAIN_MENU

Settings file example

Learn more about using this in the app settings file section.

{  
   "canvases": [  
      {  
         "type": "ADMIN_MAIN_MENU",
         "url": "https://api.optixapp.com/canvas-placeholder",
         "title": "My app interface",
         "icon": "unlock"
      }
   ]
}

 

Placement in admin dashboard

The app home screen with a custom ‘section’ (on the left), and a full-screen canvas opening when the ‘secondary title’ is tapped (on the right).

  1. icon (you can find the available icons here)
  2. title
  3. url (loaded in an iframe)
  4. admin_role (“OWNER”, “MANAGER”, “CLIENT_SERVICE”, or “RECEPTION”)

3. Invoice options menu

This can be used to present a pop-up modal when an admin selects one or more invoices in the invoice list, then clicks on ‘options.’ Setting up this canvas will add your item to the menu that opens, and will display a canvas in a modal when that option is clicked.

JSON type

ADMIN_MODAL_INVOICES_MENU

Settings file example

Learn more about using this in the app settings file section.

{  
   "canvases": [  
      {  
         "type": "ADMIN_MODAL_INVOICES_MENU",
         "url": "https://api.optixapp.com/canvas-placeholder",
         "title": "My app interface"
      }
   ]
}

 

Placement in the admin dashboard

The admin dashboard showing the options menu for a selected invoice (above) and the modal open after the custom menu option is clicked.

  1. title
  2. title (inherited from #1)
  3. url (loaded in an iframe)

 

Example app

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Mobile App Canvases

These canvases display in the iOS and Android Optix mobile apps. To use the canvases in your app, you need to specify them in your app settings file.

On this page

1. Home screen primary action

This canvas can be used to add a primary action to the top group found on the home screen. The supporting content is used to construct the primary action card, which opens a full-screen canvas when tapped.

JSON type

MOBILE_HOME_PRIMARY

Settings file example

Learn more about using this in the app settings file section.

{  
   "canvases": [  
      {  
         "type": "MOBILE_HOME_PRIMARY",
         "url": "https://api.optixapp.com/canvas-placeholder",
         "title": "My app interface",
         "icon": "exporter"
      }
   ]
}

 

Placement in app

The app home screen with a custom ‘primary action’ (on the left), and a full-screen canvas opening when that primary action is tapped (on the right).

  1. icon (you can find the available icons here)
  2. title
  3. title (inherited from #2)
  4. url (loaded in a webview)

 

Example app

2. Home screen section

This canvas appears in the main content of the mobile app home screen. It gets a title and one or more web views in the home screen. It is used to add content or actions to the home screen (e.g., blogs, essential information, access control, or surveys). Additionally and optionally, a secondary action that loads a full-screen canvas when tapped can be specified. The secondary action would be useful when the primary canvas is showing a subset of the UI, and a ‘See all’ reveals the full version.

Important

This canvas is different from other canvases. It requires a JSON object to be specified for each ‘item’, and another to group them together. This example will show how three items are grouped.

JSON types

MOBILE_HOME_SECTION (to group the items)

MOBILE_HOME_SECTION_ITEM (for each item to be displayed in a web view)

Settings file example

Learn more about using this in the app settings file section.

{

"canvases": [

		{
			"type":"MOBILE_HOME_SECTION",
			"title":"Section title",
			"subtitle":"My subtitle",
			"secondary_title":"See all",
			"secondary_url":"https://api.optixapp.com/canvas-placeholder",
			"height":"300",
			"items": [
				"article-happy-springs1",
				"article-happy-springs2",
				"article-happy-springs3"
			],
			"show_at_top": true
		},
		{
			"type":"MOBILE_HOME_SECTION_ITEM",
			"url": "https://api.optixapp.com/canvas-placeholder",
			"title":"Title 1",
			"identification": "article-happy-springs1"
		},

		{
			"type":"MOBILE_HOME_SECTION_ITEM",
			"url": "https://api.optixapp.com/canvas-placeholder",
			"title":"Title 2",
			"identification": "article-happy-springs2"
		},

		{
			"type":"MOBILE_HOME_SECTION_ITEM",
			"url": "https://api.optixapp.com/canvas-placeholder",
			"title":"Title 3",
			"identification": "article-happy-springs3"
		}
	]
}

Notes

  • The maximum height is 400 (the unit is ‘dp,’ you can consider them to be pixels relative to a 1x resolution screen).
  • You must specify at least one (and a maximum of six) MOBILE_HOME_SECTION_ITEM for a MOBILE_HOME_SECTION.

Placement in app

The app home screen with a custom ‘section’ (on the left), and a full-screen canvas opening when the ‘secondary title’ is tapped (on the right).

  1. title
  2. first item’s url (loaded in a webview)
  3. secondary title
  4. second item’s url (loaded in a webview)
  5. title (inherited from #1 above)
  6. secondary url (loaded in a webview)
  7. show at top

 

Example app

3. Tab bar item

This can be used to add a whole new tab to the mobile apps. The tab title is shown at the top along with the venue picker and messaging icon (to maintain consistency). This could be used to add a primary section considered very important by the admin (e.g., door locks, events or food ordering).

JSON type

MOBILE_TAB_BAR_ITEM

Settings file example

Learn more about using this in the app settings file section.

{  
   "canvases": [  
      {  
         "type": "MOBILE_TAB_BAR_ITEM",
         "url": "https://api.optixapp.com/canvas-placeholder",
         "title": "My app interface",
         "icon": "unlock",
         "lock_header": false
      }
   ]
}

Notes

  • lock_header is a true/false flag that instructs the mobile app to fix the header section in place or not. When it is not fixed, certain web content that relies on browser height may not function as desired. In this case, you can enable lock_header.

Placement in app

The app displaying a custom tab.

  1. title
  2. url (loaded in a webview)
  3. icon (you can find the available icons here)

 

Example app

4. More screen item

This can be used to create additional items in the more screen. This item opens a full-screen canvas when tapped.

JSON type

MOBILE_MORE_SCREEN

Settings file example

Learn more about using this in the app settings file section.

{  
   "canvases": [  
      {  
         "type": "MOBILE_MORE_SCREEN",
         "url": "https://api.optixapp.com/canvas-placeholder",
         "title": "My app interface"
      }
   ]
}

 

Placement in app

The app more screen with a custom ‘more screen item’ (on the left), and a full-screen canvas opening when it is tapped (on the right).

  1. title
  2. title (inherited from #1 above)
  3. url (loaded in a webview)

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Using Canvases

Canvases are iframes or web views shown inside the Optix core products. A more general explanation can be found in the Canvas overview. To specify canvases for your app, you need to add them in the app settings file.

We do not restrict the creation of the HTML which is displayed in a canvas, but we strongly suggest the use of our UI Kit. Doing so enables faster development and follows the Optix design guidelines, adapting the view to the proper platform (view or mobile). Using our UI kit will enable you to take advantage of our Content Delivery Network (CDN) to deploy most of the resources used in the app.

On this page

Canvas URL contextual parameters

When an admin clicks to open or view a canvas in the Optix admin dashboard, the Optix platform manipulates the URL specified in the app settings file and creates a custom URL, containing the context variables, e.g., the booking_id and the token (full details on context parameters are found in this table). The token can be used by the canvas target page to call the public API and retrieve the information related to the booking.

Example

A URL you might specify for a canvas:

https://www.mydomain.com/app/bookingtray.php

Is converted to:

https://www.mydomain.com/app/bookingtray.php?token=abcdef123p&booking_id=1000

You could choose to customize the token parameter using macro replacements.

Security tip

Always use HTTPS in your services. The usage of HTTP is insecure and can lead to identity spoofing.

Choosing the best canvas for your use case

There are several canvases available for the mobile app and admin dashboard. They display in different places and offer slightly different opportunities/restrictions. Use the lists found in the following pages to learn more about the available canvases and choose the best place to host your UI.

Each canvas in the list contains information regarding the sizing, scrolling behavior, and configurations available. The list is broken into two sections:

  1. Optix mobile app canvases
  2. Optix admin dashboard canvases

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Webhooks Debugger Tool

The Webhook debugger tool provides an interface for you to see the webhooks triggered from the Optix platform. It displays the payload and delivery status for each webhook.

On this page

Using the tool

This tool only shows webhooks triggered at the Optix Organization where the app was created (in Apps → Develop). Webhooks triggered at other organizations are not visible for you. This tool is available on the ‘Develop’ page, under the personal token ⋮ menu.

Webhook debugger demo

This live demo shows what you can expect from the Webhook debugger:

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Webhooks List

This page includes a complete list of webhooks. Learn more about subscribing to webhooks here.

On this page

Available webhooks

This table shows the name of the webhook, as well as the fields you can expect:

Webhook ↓Example response

app_install

Triggers when a user installs/creates a new app or the organization token is updated.

{
  "organization_token": "5c26d23356…3960870bfo",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "app_install",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

app_uninstall

Triggers when a user uninstalls or deletes an app.

{
  "client_id": "ce81e1fbf3d73…0ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "app_uninstall",
  "request_signature": "1207e01d133aa…a4329c48ff0f"
}

assignment_ended

Triggers when an assignment status transitions from ’active’ to ’ended’ or an assignment is created with an end date in the past.

{
  "assignment_id": 102,
  "resource_id": 8850,
  "resource_name": "Bike room",
  "resource_type": "Meeting Room",
  "owner_account_id": 1700,
  "owner_type": "User",
  "owner_name": "Richard Johnson",
  "owner_email": "example@example.com",
  "payer_account_id": 1701,
  "payer_type": "Team",
  "payer_name": "The Cube Team",
  "payer_email": "example@example.com",
  "start_timestamp": 1620057600,
  "start_datetime": "2021-05-03 09:00",
  "end_timestamp": 1621036800,
  "end_datetime": "2021-05-14 17:00",
  "days_of_week": "Mon-Wed, Fri",
  "time_of_day": "9am - 5pm",
  "status": "Ended",
  "notes": "Admin notes",
  "created_unix_timestamp": 1618448141,
  "created_datetime": "2021-04-14 17:55",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "assignment_ended",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

assignment_started

Triggers when an assignment status transitions from ’upcoming’ to ’active’ or an active assignment is created.

{
  "assignment_id": 102,
  "resource_id": 8850,
  "resource_name": "Bike room",
  "resource_type": "Meeting Room",
  "owner_account_id": 1700,
  "owner_type": "User",
  "owner_name": "Richard Johnson",
  "owner_email": "example@example.com",
  "payer_account_id": 1701,
  "payer_type": "Team",
  "payer_name": "The Cube Team",
  "payer_email": "example@example.com",
  "start_timestamp": 1620057600,
  "start_datetime": "2021-05-03 09:00",
  "end_timestamp": 1621036800,
  "end_datetime": "2021-05-14 17:00",
  "days_of_week": "Mon-Wed, Fri",
  "time_of_day": "9am - 5pm",
  "status": "Active",
  "notes": "Admin notes",
  "created_unix_timestamp": 1618448141,
  "created_datetime": "2021-04-14 17:55",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "assignment_started",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

cancel_checkin

Triggers when a checkin is canceled.

{
  "checkin_id": "5074",
  "location_name": "Vancouver Location",
  "location_timezone": "America/Vancouver",
  "check_in_timestamp": "1558987200",
  "check_in_datetime": "2019-05-27 20:00",
  "member_name": "Jean",
  "member_last_name": "Example",
  "member_full_name": "Jean Example",
  "member_email": "example@example.com",
  "created_datetime": "2019-05-27 17:20",
  "client_id": "7d5ee091717b8eb6461…a1ab1a508",
  "created_timestamp": 1558977616,
  "organization_id": "6267",
  "event": "cancel_checkin",
  "request_signature": "89e2f8ccca2d5…478888e7c5c2"
}

cancel_plan_subscription

Triggers when a user or team plan subscription is canceled or ended.

{
  "plan_template_id": "916",
  "plan_template_name": "Plan A",
  "account_plan_id": "29191",
  "name": "Plan A for Jean",
  "status": "ACTIVE",
  "subscription_type": "member",
  "created_datetime": "2019-05-27 17:25",
  "start_datetime": "2019-05-27 00:00",
  "created_unix_timestamp": 1558977946,
  "start_unix_timestamp": 1558915200,
  "price": "300.00",
  "deposit": "50.00",
  "set_up_fee": "10.00",
  "free_trial_days": "7",
  "subscribers": [
    {
      "user_name": "Jean",
      "user_last_name": "Example",
      "user_fullname": "Jean Example",
      "email": "example@example.com"
    }
  ],
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "cancel_plan_subscription",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

invoice_paid

Triggers when a member pays an invoice.

{
  "invoice_id": "18230",
  "client_id": "7d5ee091717b8eb646…b8a1ab1a508",
  "created_timestamp": 1558977798,
  "organization_id": "6267",
  "event": "invoice_paid",
  "request_signature": "cccf5280523634…e3513c931d93"
}

invoice_updated

Triggers when a modification is made to an invoice (e.g., adding, updating, or deleting line items).

{
  "invoice_id": "18230",
  "client_id": "7d5ee091717b8eb646…b8a1ab1a508",
  "created_timestamp": 1558977798,
  "organization_id": "6267",
  "event": "invoice_updated",
  "request_signature": "cccf5280523634…e3513c931d93"
}

member_booking_cancelled

Triggers when a booking is canceled.

{
  "booking_id": "51216",
  "title": "Hot Desk",
  "workspace_id": "8850",
  "workspace_name": "Bike Room",
  "workspace_type": "Hot Desk",
  "check_in_timestamp": "1558990800",
  "check_out_timestamp": "1558996200",
  "check_in_datetime": "2019-05-27 21:00",
  "check_out_datetime": "2019-05-27 22:30",
  "member_name": "Jean",
  "member_last_name": "Example",
  "member_email": "example@example.com",
  "venue_name": "Vancouver Location",
  "venue_address": "123 High Street",
  "created_datetime": "2019-05-24 23:48",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "member_booking_cancelled",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

member_booking_updated

Triggers when a booking is updated.

{
  "booking_id": "51225",
  "title": "Meeting Room",
  "workspace_id": "8744",
  "workspace_name": "Bike Room",
  "workspace_type": "Meeting Room",
  "check_in_timestamp": "1559084400",
  "check_out_timestamp": "1559088000",
  "check_in_datetime": "2019-05-28 23:00",
  "check_out_datetime": "2019-05-29 00:00",
  "member_name": "Jean",
  "member_last_name": "Example",
  "member_email": "example@example.com",
  "venue_name": "Vancouver Location",
  "venue_address": "1234 High Street, Vancouver",
  "created_datetime": "2019-05-27 16:56",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "member_booking_updated",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

member_updated

Triggers when a user profile is updated.

{
  "member_id": "994",
  "account_id": 1700,
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 6267,
  "event": "member_updated",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

new_checkin

Triggers when a user checks in to a location.

{
  "checkin_id": "5074",
  "location_name": "Vancouver Location",
  "location_timezone": "America/Vancouver",
  "check_in_timestamp": "1558987200",
  "check_in_datetime": "2019-05-27 20:00",
  "member_name": "Jean",
  "member_last_name": "Example",
  "member_full_name": "Jean Example",
  "member_email": "example@example.com",
  "created_datetime": "2019-05-27 17:20",
  "client_id": "7d5ee091717b8eb6461…a1ab1a508",
  "created_timestamp": 1558977616,
  "organization_id": "6267",
  "event": "new_checkin",
  "request_signature": "89e2f8ccca2d5…478888e7c5c2"
}

new_issue

Triggers when a user reports a new issue.

{
  "issue_id": "1091",
  "location_id": "3390",
  "category1": "wifi",
  "category2": "not working",
  "notes": "Wifi in the corner is spotty",
  "feeling": "na",
  "image": "https://s3.amazonaws.com/s3-large.jpg",
  "member_name": "Jean",
  "member_last_name": "Example",
  "member_email": "example@example.com",
  "created_datetime": "2019-05-27T17:29:12+0000",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "new_issue",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

new_lead

Triggers when a new lead is added to an organization. It has 1 hour delay, and it won’t be triggered if a lead becomes an active member within that period.

{
  "venue_name": "Location 5",
  "member_id": "994",
  "first_name": "Jean",
  "last_name": "Example",
  "full_name": "Jean Example",
  "email": "example@example.com",
  "client_id": "7d5ee091717…b8a1ab1a508",
  "created_timestamp": 1558743024,
  "organization_id": "6267",
  "event": "new_lead",
  "request_signature": "2351968925…49200d7e2846"
}

new_member

Triggers when a new member is added to an organization.

{
  "venue_name": "Location 5",
  "member_id": "994",
  "user_id": "12346",
  "first_name": "Jean",
  "last_name": "Example",
  "full_name": "Jean Example",
  "email": "example@example.com",
  "client_id": "7d5ee091717…b8a1ab1a508",
  "created_timestamp": 1558743024,
  "organization_id": "6267",
  "event": "new_member",
  "request_signature": "2351968925…49200d7e2846"
}

member_deleted

Triggers when a member is deleted.

{
  "venue_name": "Location 5",
  "member_id": "994",
  "user_id": "12346",
  "first_name": "Jean",
  "last_name": "Example",
  "full_name": "Jean Example",
  "email": "example@example.com",
  "client_id": "7d5ee091717…b8a1ab1a508",
  "created_timestamp": 1558743024,
  "organization_id": "6267",
  "event": "new_member",
  "request_signature": "2351968925…49200d7e2846"
}

new_member_booking

Triggers when there is a new booking.

{
  "booking_id": "39553",
  "title": "Meeting Room",
  "workspace_id": "8733",
  "workspace_name": "Meeting Room C",
  "workspace_type": "Meeting Room",
  "check_in_timestamp": "1557464400",
  "check_out_timestamp": "1557468000",
  "check_in_datetime": "2019-05-10 05:00",
  "check_out_datetime": "2019-05-10 06:00",
  "member_name": "Jean",
  "member_last_name": "Example",
  "member_email": "example@example.com",
  "venue_name": "Vancouver Location",
  "venue_address": "1234 High Street Vancouver",
  "created_datetime": "2019-05-09 23:54",
  "client_id": "7d5ee091717b8eb…e8b8a1ab1a508",
  "created_timestamp": 1557446099,
  "organization_id": "6267",
  "event": "new_member_booking",
  "request_signature": "8ac4dc4765f1c07..728708e503bbd3"
}

new_plan_subscription

Triggers when a user or team’s subscription starts. E.g. if a user signs up to a new plan with the start date set 3 days from now, the webhook will trigger in 3 days time on that start date.

{
  "plan_template_id": "916",
  "plan_template_name": "Plan A",
  "account_plan_id": "29191",
  "name": "Plan A for Jean",
  "status": "ACTIVE",
  "subscription_type": "member",
  "created_datetime": "2019-05-27 17:25",
  "start_datetime": "2019-05-27 00:00",
  "created_unix_timestamp": 1558977946,
  "start_unix_timestamp": 1558915200,
  "price": "300.00",
  "deposit": "50.00",
  "set_up_fee": "10.00",
  "free_trial_days": "7",
  "subscribers": [
    {
      "user_name": "Jean",
      "user_last_name": "Example",
      "user_fullname": "Jean Example",
      "email": "example@example.com"
    }
  ],
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "new_plan_subscription",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

new_sale

Triggers when a product sale is made.

{
  "product_sale_id": "102024",
  "product": "Small Coffee",
  "account": "1701",
  "account_name": "The Cube Team",
  "number": "100778",
  "user_name": "Richard Johnson",
  "invoice_item_name": "Sale of Small Coffee (#102024)",
  "description": "Product sale",
  "quantity": "1.0000",
  "unit_amount": "5.0000",
  "tax_rate": "0.08",
  "tax": "0.4",
  "total": "5.40",
  "notes": null,
  "created_datetime": "2019-02-01T03:45:27+00:00",
  "invoice_id": "298448",
  "invoice_number": "71312",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "new_sale",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

new_team_member

Triggers when a user is added to a team.

{
  "team_id": 123123,
  "team": "The Cube Team",
  "user_id": 456456,
  "user_name": "Richard",
  "user_last_name": "Johnson",
  "user_fullname": "Richard Johnson",
  "user_email": "example@example.com",
  "is_admin": false,
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "new_team_member",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

organization_token_updated

Triggers when the organization token is updated.

{
  "organization_token": "5c26d23356…3960870bfo",
  "client_id": "ce81e1fbf3d7…ba561d5d",
  "created_timestamp": 1545092451,
  "organization_id": 3568,
  "event": "organization_token_updated",
  "request_signature": "1207e01d133aa…4329c48ff0f"
}

plan_ending_soon

Triggers when a user or team plan subscription is about to end.

{
  "plan_template_id": "916",
  "plan_template_name": "Plan A",
  "account_plan_id": "29191",
  "name": "Plan A for Jean",
  "status": "ACTIVE",
  "subscription_type": "member",
  "created_datetime": "2019-05-27 17:25",
  "start_datetime": "2019-05-27 00:00",
  "created_unix_timestamp": 1558977946,
  "start_unix_timestamp": 1558915200,
  "price": "300.00",
  "deposit": "50.00",
  "set_up_fee": "10.00",
  "free_trial_days": "7",
  "subscribers": [
    {
      "user_name": "Jean",
      "user_last_name": "Example",
      "user_fullname": "Jean Example",
      "email": "example@example.com"
    }
  ],
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "plan_ending_soon",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

plan_subscription_changed

Triggers when a user or team’s subscription is updated.

{
  "plan_template_id": "916",
  "plan_template_name": "Plan A",
  "account_plan_id": "29191",
  "name": "Plan A for Jean",
  "status": "ACTIVE",
  "subscription_type": "member",
  "created_datetime": "2019-05-27 17:25",
  "start_datetime": "2019-05-27 00:00",
  "created_unix_timestamp": 1558977946,
  "start_unix_timestamp": 1558915200,
  "price": "300.00",
  "deposit": "50.00",
  "set_up_fee": "10.00",
  "free_trial_days": "7",
  "subscribers": [
    {
      "user_name": "Jean",
      "user_last_name": "Example",
      "user_fullname": "Jean Example",
      "email": "example@example.com"
    }
  ],
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "plan_subscription_changed",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

team_member_deleted

Triggers when a user is removed from a team.

{
  "team_id": 123123,
  "team": "The Cube Team",
  "user_id": 456456,
  "user_name": "Richard",
  "user_last_name": "Johnson",
  "user_fullname": "Richard Johnson",
  "user_email": "example@example.com",
  "is_admin": false,
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "team_member_deleted",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

team_updated

Triggers when a team profile is updated.

{
  "team_id": "123123",
  "account_id": 1700,
  "client_id": "7d5ee091717…ab1a508",
  "created_timestamp": 1558977946,
  "organization_id": "6267",
  "event": "team_updated",
  "request_signature": "db2fdf29744b…d5d61dfed00"
}

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

Using Webhooks

Webhooks are created based on events on the Optix platform. You can use webhooks to subscribe to specific events on the platform and inform URLs to be called when events occur.

To subscribe to webhooks, you need to add them in the settings file for your app. Learn how to do this in the App settings file section.

All webhooks are POSTED (POST HTTP method), using an HTTP form method, containing:

  • client_id: The app client_id. Available on the App’s details page on the admin dashboard
  • created_timestamp: Unix timestamp of the moment where the webhook was created
  • organization_id: ID of the organization where the app is available
  • event: The webhook name (check out the available webhooks)
  • request_signature: A SHA1 Hash of the current client_id + secret + created_timestamp (You can find the secret in the app details screen in ‘Apps → Develop → Your app’ in the Optix admin dashboard). E.g., client_id=123, secret=”secret”, and created_timestamp=123456 would be presented as sha1("123secret123456")

A complete list of available webhooks:

Webhooks list

A tool to help you debug webhooks:

Debugger tool

On this page

Webhook context

The primary purpose of a webhook is to notify the app about a change/event taking place on the Optix platform. The information received by the target of the webhook is a subset of the full data. We strongly recommend supplementing the use of webhooks with a query to the public API to retrieve the complete and most up-to-date dataset. This is particularly important if the target receives the webhooks out of order or after a long delay, where the data received may no longer be correct.

We do not guarantee the sequencing or delay time of webhook delivery. Typically the webhook is dispatched within 1 and 15 seconds after the event.

Retry policy

Each webhook request will be repeated until a 2xx (successful) HTTP response is received. 301 redirects will not be followed. A 410 response will force the webhook subscription to be removed, no other request will be sent to the endpoint regarding the same event (unless a new app is installed). Any other code will be logged as a failure, and the system will retry the request up to 10 times (with a delay of 10 minutes between each attempt).

The webhook system has a timeout of 5 seconds for connection and 2 seconds to receive the response. Any request that takes more time will be considered failed and will retry in the manner described above. You can use the Webhook debugger to identify problems during the development of your app.

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

API Example – Bookings

The Optix API provides an intuitive and flexible way of working with bookings.

Generally, making a new booking or modifying the existing one is a two-step process:

  1. Use the bookingsDraft query to validate the booking, preview its cost, or adjust any input parameters
  2. Send the bookingsCommit mutation with the same arguments to save the changes.

On this page

Booking session ID

The Server-generated booking_session_id identifies the sequence of your interactions with the API. You can grab it from BookingSet of the first response and then pass it in all subsequent requests related to that booking set.

Making new bookings

The input for new bookings must include the following:

  • The account
    • Defines the available allowances through the active personal/team plan subscriptions.
    • Used to invoice the overage charges, if any.
  • The owner of the booking
    • For member accounts, it must be that same user.
    • For team accounts, it can be any team member.
  • A single resource to be booked

When updating the bookings, booking_session_id, account, and owner_user_id may be omitted.

Draft a booking

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      # account: { team_id: TEAM_ID, organization_id: ORGANIZATION_ID }
      owner_user_id: USER_ID
      bookings: [{ resource_id: RESOURCE_ID }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      start_timestamp
      end_timestamp
    }
  }
}

 

Commit a booking

Committing a booking will draft and save that booking. Pass booking_id to update the existing booking. Note that it is possible to call bookingsCommit without calling bookingsDraft first.

mutation {
  bookingsCommit(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{ resource_id: RESOURCE_ID }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      start_timestamp
      end_timestamp
    }
  }
}

Payment preferences

By default, if the booking requires a payment, the system will choose the optimal available allowance for the given account and use as much of it as possible. You can also manually specify the allowance and the exact amount to be used.

Get the available allowances

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{ resource_id: RESOURCE_ID }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      start_timestamp
      end_timestamp

      # the optimal allowance and the resulting booking cost
      payment {
        allowance_usage {
          allowance {
            allowance_id
            unit
            total
            available
          }
          amount
        }
        total
      }

      # all other allowances and the full payment option (no allowance usage)
      available_payments {
        account {
          account_id
        }
        allowance_usage {
          allowance {
            allowance_id
            unit
            total
            available
          }
          amount
        }
        total
      }
    }
  }
}

 

Use a specific allowance

Set amount: 0 if you want to only apply the discount to overage charges, without consuming the allowance.

Use calculate: NO_ALLOWANCE to disable the selection of the optimal allowance and generate a full charge instead.

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{
        resource_id: RESOURCE_ID
        payment: {
          calculate: FIXED_ALLOWANCE
          allowance_usage: [{
              allowance_id: "ALLOWANCE_ID"
              amount: 2.5
          }]
        }
        # payment: { calculate: NO_ALLOWANCE }
      }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      start_timestamp
      end_timestamp
      payment {
        allowance_usage {
          allowance {
            allowance_id
            unit
            total
            available
          }
          amount
        }
        total
      }
    }
  }
}

Updating a booking

Change the booking times

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{
        booking_id: BOOKING_ID
        start_timestamp: 1577869200
        end_timestamp: 1577874600
      }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      start_timestamp
      end_timestamp
    }
  }
}

 

Cancel the booking

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{
        booking_id: BOOKING_ID
        is_cancelled: true
      }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      is_confirmed
      is_cancelled
    }
  }
}

Other features

Invoice the booking

Use payment: {charge: TODAY} to invoice the booking with a positive payment.total. This will create a new invoice with a single line item due today.

Alternatively, set payment: {charge: NOW} to charge this invoice immediately using the default payment method associated with the given account.

Add invitees to the booking

For existing users, please provide either user_id, or email. If you enter an email address for which an existing user is not found, one will be created using the given email.

When you edit a booking, existing invitees will be preserved, along with their invitation status. Set invitees: [] to remove them from a booking.

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{
        resource_id: RESOURCE_ID
        invitees: [
          { user_id: USER_ID }
          { email: "EMAIL" }
          { email: "EMAIL", name: "NAME SURNAME" }
        ]
      }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      invitees {
        user {
          user_id
          fullname
        }
        status
      }
    }
  }
}

 

Get the alternative bookings

The system suggests multiple alternatives for each booking based on the given preferences; e.g. resource type, hourly price, duration, etc.

query {
  bookingsDraft(
    input: {
      account: { member_id: MEMBER_ID }
      owner_user_id: USER_ID
      bookings: [{
        resource_id: RESOURCE_ID
      }]
    }
  ) {
    booking_session_id
    bookings {
      booking_id
      alternative_bookings {
        booking_id
        start_timestamp
        end_timestamp
        resources {
          resource_id
        }
        payment {
          total
        }
      }
    }
  }
}

 

Check the resource availability

query {
  resourceAvailability(
    input: {
      resource: { price_hour_to: 20 }
      start_timestamp: 1577869200
      end_timestamp: 1577874600
      duration_sec: 3600
    }
  ) {
    resource {
      resource_id
      title
    }
    available {
      start_timestamp
      end_timestamp
    }
  }
}

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us

API Capabilities

It’s useful for apps to understand the permissions or objects available for each token. During the development of a canvas you can provide different features depending on the user level (e.g., is the user an admin or a mobile app user?).

On this page

Example

The below example shows how you can use the field `capabilities` available at `me` object. Click the play button to run the query in this live demo. The table below explains the response further.

Hidden on mobile

This tool doesn’t fit on screens this small. Please use a browser which is a bit bigger (you could try rotating your phone).

Available capabilities

CapabilityDescription
authenticatedWill be returned only if the token is valid and not expired
manageWill be returned only if the user is an admin or if its an organization token
bookingsWill be returned only if the token has permissions to handle bookings
checkinsWill be returned only if the token has permissions to handle check-ins
invoicesWill be returned only if the token has permissions to handle invoices

Got questions?

We are here to help. Ask us a question and we’ll do our best to answer as soon as possible.

Contact Us