The App Json is where you configure most of your app: the fields users fill in, the widgets your app shows in Upsales, the features an account needs to use it, and a few app-specific options. You edit it under App Json in the app editor.
Example empty JSON config:
{ "fields": { "account": [], "user": [] }, "uiElements": {}, "requirements": [] }
All top-level properties are optional. The sections below describe each one.
Fields
The settings your app asks for. fields.account lists the fields an administrator fills in when configuring the app for the whole account. fields.user lists the fields each user fills in for themselves, when the app is user configurable. Field types and options are described in How to add fields in apps.
UI elements
Widgets your app shows inside Upsales. uiElements is an object keyed by view (for example account, contact or editOrder). Each view holds an object keyed by position (for example sidebar), and each position holds an array of widgets:
"uiElements": {
"account": {
"sidebar": [ ... ]
}
}
The available views, positions and widget types are described in UI Widgets.
Requirements
An array of the Upsales features your app needs, as feature names in plain strings:
"requirements": ["groupMail"]
If an account is missing any of them, the app's page shows Requires followed by the missing features, and the app cannot be configured there. The feature names you can use are listed in How to add requirements for apps.
Company card tab
Set iframe to true to give your app its own tab on the company card, where Upsales shows your app in an iframe. The Show app on Account Card toggle in the app editor sets this property for you.
"iframe": true
Validating settings
Set test to true to have Upsales send the values an administrator enters to your app's /testConfig endpoint when they save the app's settings. If the request fails, the settings are not saved. userTest does the same for the settings each user saves for themselves, using your app's /testuserconfig endpoint. Upsales only sends the request when the app has fields at that level.
"test": true,
"userTest": true
Phone app: Json
A phone app can set these options in a capabilities object:
- pickupHook: your app sends the pickup webhook when a call is answered. The call widget switches to the in-call view, with a call timer, when the webhook arrives. Without this option the widget switches to the in-call view 4 seconds after the call starts.
- hangupHook: your app sends the hangup webhook when a call ends. The call widget closes when the webhook arrives.
- noRecordings: set to true if your app does not provide call recordings. Upsales then shows no recording player for calls.
- useCallToLinks: a link prefix such as "tel:". When a user clicks a phone number, Upsales also opens a link made of this prefix and the number.
"capabilities": {
"pickupHook": true,
"hangupHook": true
}