LogoLogo
6.0
  • Docs
  • Connector Configuration
  • Knowledge Base
  • Changelog
6.0
  • Introduction
  • Getting Started
    • Build and Publish an Integration
    • Build and Run an Automation
    • Build a Custom Connector
    • Embed into Your Application
    • Monitor & Troubleshoot
    • Access Appmixer REST API
    • Install and Update Connectors
    • Connector Configuration
    • Handle Flow Errors
    • Use App Events
    • End User Guide
  • API
    • Authentication
    • Flows
    • Apps
    • Accounts
    • User
    • Insights
    • Files
    • Data Stores
    • Connector Configuration
    • People Task
    • ACL
    • Charts
    • Config
    • Modifiers
    • Public Files
    • Unprocessed Messages
    • Variables
  • Building Connectors
    • Flow
    • Component
    • Basic Structure
    • Manifest
      • name
      • label
      • icon
      • description
      • auth
      • inPorts
      • outPorts
      • properties
      • quota
      • tick
      • private
      • webhook
      • state
      • author
      • marker
      • localization
      • firePatterns
    • Behaviour
    • Dependencies
    • Authentication
    • Quotas & Limits
    • Example: twilio.SendSMS
    • Example: Webhook Trigger
  • Appmixer UI SDK
    • Introduction
    • Installation
    • Quick Start
    • Constructor
    • API Module
    • UI & Widgets
      • Flow Manager
      • Designer
      • Insights Logs
      • Insights Chart Editor
      • Insights Dashboard
      • Accounts
      • Storage
      • People Tasks
      • Connectors
      • Integrations
      • Wizard
    • Custom API
  • Customizing Embedded UI
    • Custom Theme
    • Custom Strings
    • Custom Component Strings
  • Appmixer Backoffice
    • Getting Started
    • System Configuration
  • Appmixer CLI
    • Getting Started
    • OpenAPI Connector Generator
      • Getting started
      • Open API Extensions
      • Examples
  • Appmixer Self-Managed
    • Installation Docker Compose
    • Installation AWS ECS
    • Getting Started
    • Authentication Hub
    • Additional Configuration
    • Appmixer Architecture
    • Appmixer Deployment Models
  • Tutorials
    • Appmixer Virtual Users
    • Flows Metadata & Filtering
    • Access Control
    • Sharing Flows
    • People Tasks
    • Customizing modifiers
  • Connectors
    • Connector Configuration
    • Connector Request
Powered by GitBook
On this page
  • Triggering OnAppEvent using Appmixer JavaScript UI SDK
  • Triggering OnAppEvent using HTTP requests

Was this helpful?

Export as PDF
  1. Getting Started

Use App Events

PreviousHandle Flow ErrorsNextEnd User Guide

Last updated 9 months ago

Was this helpful?

App Events provide the simplest method for sending data to Appmixer. To utilize App Events, select the OnAppEvent trigger from the Utilities category of connectors:

Note that another convenient way to trigger your automations is by using the Webhook component from the HTTP module. However, the Webhook component may not be as effective for building integration templates. This is because when integrations are activated by end-users, the Webhook component generates a new URL each time since each activated integration is a new instance derived from the template. Consequently, the Webhook URL displayed in the inspector panel (configuration panel) during template creation will not match the URLs in the actual integration instances.

In contrast, the OnAppEvent trigger creates a named webhook, allowing you to target a specific user with specific events and data by calling it with the actual end-user access token.

In summary, if you only care about automations where the webhook URL is known, you can use Webhook. If you build integration templates, use OnAppEvent instead.

Assign a meaningful name to your app event and consider providing sample data. Although including sample data is optional, it facilitates referencing the data from the app event in subsequent components.

Providing an Event Data Example populates all detected JSON fields as variables in subsequent connected components. This allows you to easily use and reference these data placeholders throughout your integration, ensuring that the necessary information is accessible and can be dynamically incorporated into various parts of your workflow. This practice enhances the configurability and functionality of your automations by clearly mapping out how data flows between components.

Triggering OnAppEvent using Appmixer JavaScript UI SDK

Once your automation or integration templates are built, published, and users begin activating your integrations, you can trigger app events by using the appmixer.api.sendAppEvent(EVENT, DATA) function provided by the client-side Appmixer SDK. This function enables you to programmatically send events and associated data through your application, facilitating real-time interaction and response within your integrations.

appmixer.api.sendAppEvent('contact-created', {
    email: 'david@example.com',
    fname: 'David',
    lname: 'Doe'
});

This triggers all the integrations or automations associated with the user who is authenticated with the access token used in the SDK, specifically targeting those that begin with the OnAppEvent configured with the Event Name set to contact-created.

Triggering OnAppEvent using HTTP requests

Alternatively, you can trigger the OnAppEvent from either client-side or backend-side code by sending an HTTP POST request to the endpoint https://YOUR_APPMIXER_TENANT_API_URL/plugins/appmixer/utils/appevents/events/EVENT. When making this request, include the event data in the payload. This method allows you to directly interact with the Appmixer system via HTTP, providing flexibility to trigger events from various parts of your application infrastructure.

curl -XPOST \
           -H 'Content-Type: application/json' \
           -H "Authorization: Bearer VIRTUAL_USER_ACCESS_TOKEN" \
           -d '{ "email": "david@example.com", "fname": "David", "lname": "Doe" }' \
           "https://APPMIXER_TENANT_API_URL/plugins/appmixer/utils/appevents/events/contact-created"

If you don't have the access token for a virtual user, you can obtain it by using their username and password to call the . This process involves submitting the necessary credentials to authenticate the user, after which the endpoint will provide an access token. This token can then be used to authorize subsequent actions or API calls under that user's identity.

Sign-in endpoint