Audience: Developers building Sapho micro apps
Many SaaS, and even some on-premises, applications typically use REST APIs with responses in JSON. You can use our JSON connector to call these APIs right from within Sapho and work with their response data.
JSON connector basics
To create a JSON connector, please follow these steps:
- Go to Micro Apps in Sapho Builder and add a new JSON micro app.
- Select Connect to JSON in the dialog window and click Next.
- Enter your Base URL settings (this is the root of the URL used for the API call).
- Here is an example:
If the URL is:
Your base URL would be:
- Here is an example:
- If your API calls are secured using authentication, please fill in the Username and Password fields.
- Using the Base URL, you can set up multiple Tables to load the JSON responses from different API calls. Click the blue + icon to start defining a table.
- In the Add Table dialog, please enter the URI. This is the rest of API calls’ URL, excluding any GET parameters. In the screenshot below, the URI’s value is
- Enter Table Name. This will be used to reference the table within Sapho Builder.
- It is also possible to add additional GET or POST request parameters in combination with date-based variables. Click SET PARAMS in Request Params to configure request parameters and request type.
You also have the option to select GET or POST under Request Type. For the example used above, we set up a GET parameter with the name
state, a value of
closed, and a Request Type of
- Click Load Columns to load all the available attributes from the JSON response. Sapho will automatically detect and set the data type of each attribute, but you can update them manually as well. You can also set which attribute is the primary key and any attributes that should be ignored during the data import.
- Click Save to close the Add Table window and then click Next.
- You can set up a Synchronization Schedule, i.e. how often the configured API call will be executed and data from its response saved to the Sapho cache for further use in micro apps and/or events. To do this, configure how often you would like your API call to execute.
- Click Done to finish your JSON connector setup.
JSON connector limitations
Although the JSON connector is a very powerful tool, it is currently limited in order to support very straightforward integrations that sync data in order to trigger events and let users perform lookups:
- Flat JSONs only - Our JSON connector currently does not t support nested attribute sets so you can only access attributes on the first level of a JSON document.
- Basic Auth only - Sapho cannot currently support anything other than basic API authentication.