Portal API
The Portal API lets you connect your own website pages to Appfactory Studio. With a few lines of code on a page, you can take payments, show a store, list events, sign people up to a mailing list, show notifications, book appointments, record analytics and display forms you built in the dashboard.
What it is
The Portal API is a script that you add to your page. Once it loads, your page has one object called Portal. Each part of Appfactory Studio is a property of it:
| Part | What it does |
|---|---|
Portal.directPayments | One-off payments and subscriptions |
Portal.commerce | Products, cart and checkout for an online store |
Portal.events | Event listings, tickets and registration |
Portal.subscribers | Mailing-list sign-up |
Portal.notifications | A signed-in user's inbox |
Portal.appointments | Booking services and time slots |
Portal.analytics | Page views and custom events |
Portal.forms | Forms built in the dashboard |
Adding it to your page
Add this script tag to your HTML:
<script src="https://api.appfactory.studio/sdk.js"></script>Then tell it which site to talk to. Your site key is shown at the top of the dashboard's Settings page.
<script>
window.Portal.url_key = 'YOUR_SITE_KEY';
</script>TIP
Set the site key before your page makes its first call.
Where to go next
Each page below documents every method and property of one part, in alphabetical order, with its parameters, return values, related types and examples.
| Page | Access |
|---|---|
| Analytics | Portal.analytics |
| Appointments | Portal.appointments |
| Brain | Portal.brain |
| Chat | Portal.chat |
| Commerce | Portal.commerce |
| Direct Payments | Portal.directPayments |
| Documents | Portal.documents |
| Events | Portal.events |
| Feedback | Portal.feedback |
| Forms | Portal.forms |
| Listings | Portal.listings |
| Mail Handler | Portal.mailHandler |
| Notifications | Portal.notifications |
| Portal Object | window.Portal |
| Processors | Portal.processors |
| Site Users | Portal.siteUsers |
| Subscribers | Portal.subscribers |
| UI | Portal.ui |