Skip to main content
This guide covers ticket creation and dynamic contact form integration for mobile applications.

Prerequisites

Before using these APIs, configure authentication as described in Mobile Authentication.

Create Support Ticket

Creates a support ticket for issues requiring human assistance. Endpoint: POST /api/sdk/v1/tickets Content-Type: multipart/form-data

Request Fields

Response

Custom Fields Format

File Upload Constraints:

Contact Form Integration

The contact form system provides dynamic, configurable forms for ticket creation with custom fields, conditional logic, and progressive display.

Overview

The contact form allows you to:
  • Fetch dynamically configured form structures from the server
  • Display custom fields based on your ticketing system configuration
  • Handle conditional field visibility (fields that appear based on other field values)
  • Manage hidden fields that should be submitted but not displayed
  • Implement progressive disclosure (fields appear as previous fields are completed)
  • Collect email addresses from anonymous widget users

Get Form Configuration

Fetch the form configuration before displaying the contact form. Endpoint: GET /api/sdk/v1/config

Response Structure


Field Types


Field Display Logic

Hidden Fields (isHidden: true)

Hidden fields should be rendered as hidden inputs. Their values must be submitted with the form, but they should not be visible to the user.

Conditional Fields

Fields can be conditionally displayed based on the value of another field using conditionalFieldId and conditionalFieldValue.
Example Scenario:
  • Field A: “Issue Type” (dropdown: Bug, Feature Request, Question)
  • Field B: “Bug Severity” (dropdown: Low, Medium, High)
    • conditionalFieldId: ID of Field A
    • conditionalFieldValue: “Bug”
    • This field only appears when “Bug” is selected in Field A

Progressive Field Display

Fields appear progressively based on form completion:
  1. Subject field (if showSubject is true)
  2. Typology field appears after subject is filled (if showTypology is true)
  3. Priority field appears after typology is filled (if showPriority is true)
  4. Custom fields appear sequentially after priority is filled
  5. Each subsequent custom field appears after the previous field is completed

Field Options

Options in select fields can have special properties:

Email Collection for Widget Users

When using widget authentication, the system creates anonymous users with email format unknown_ago@{widget-id}.com. To collect the user’s real email:
  1. Check if the user is anonymous (email starts with unknown_ago@)
  2. Show an email input field in your form
  3. Validate the email format
  4. Pass the email in the user_email field when submitting the ticket
The real email will be stored separately and used for ticket notifications.

Swift (iOS) Implementation


Kotlin (Android) Implementation


Best Practices

Form Validation

  • Validate required fields before submission
  • Show error messages clearly for each field
  • Validate email format for widget users
  • Check custom field requirements from the form configuration

Progressive Disclosure

  • Implement the progressive display logic to avoid overwhelming users
  • Show fields only when previous fields are completed
  • Use conditional logic to show/hide fields based on other selections

Hidden Fields

  • Always render hidden fields as hidden inputs
  • Include hidden field values in form submission
  • Don’t show hidden fields in the UI but ensure their values are submitted

Field Identifiers

  • Always prefer externalId over id for custom field identification
  • This ensures compatibility with external ticketing systems (Zendesk, HelpScout)

Widget Users

  • Detect anonymous users (email starts with unknown_ago@)
  • Collect real email addresses for proper ticket notifications
  • Validate email format before submission

Error Handling

  • Handle network failures gracefully
  • Show user-friendly error messages
  • Retry failed submissions
  • Validate data before submission to minimize errors

User Experience

  • Pre-select default option values where specified
  • Show loading indicators during form submission
  • Provide clear success/failure feedback
  • Auto-save form data to prevent data loss