Skip to main content

Test Mode Configuration

The Test Mode feature in OsmoX enables administrators to toggle a testing environment for an application, allowing functional testing without sending notifications to real recipients.

Overview

Blocked Notifications

Providers associated with test mode enabled applications DO NOT send notifications to end recipients

Whitelist Support

Every application can maintain a whitelist of recipients for which notifications will be processed normally

Configuration Fields

testModeEnabled

A binary flag to enable or disable test mode for an application.
ValueStateDescription
1ONTest mode is enabled
0OFFTest mode is disabled (default)
When test mode is enabled, notifications are automatically marked as SUCCESS with a dummy response, without actually being delivered.

whitelistRecipients

A JSON object specifying providers and related recipients that will process notifications normally even in test mode. Format:
  • Keys: Provider ID (string)
  • Values: Arrays of recipient strings (email addresses, phone numbers)
{
  "6": ["abcrecipient@gmail.com"],
  "18": ["+18900100002", "+18900100003", "+18900100004"],
  "21": ["*"]
}
Provider IDs used should belong to the application.
Special escape character: Use ["*"] to whitelist ALL recipients for a provider, allowing it to work normally even in test mode.

Enabling Test Mode

For Existing Applications

mutation UpdateApplication($applicationId: Float!) {
  updateApplication(updateApplicationInput: {
    applicationId: $applicationId,
    testModeEnabled: 1
  }) {
    applicationId
    name
    testModeEnabled
    whitelistRecipients
  }
}

For New Applications

mutation CreateApplication {
  application(createApplicationInput: {
    name: "<newApplicationName>",
    testModeEnabled: 1
  }) {
    applicationId
    name
    testModeEnabled
    whitelistRecipients
  }
}

Configuring Whitelist

Add Whitelisted Recipients

mutation UpdateApplication($applicationId: Float!, $whitelistRecipients: JSONObject!) {
  updateApplication(updateApplicationInput: {
    applicationId: $applicationId,
    testModeEnabled: 1,
    whitelistRecipients: $whitelistRecipients
  }) {
    applicationId
    name
    testModeEnabled
    whitelistRecipients
  }
}
Variables:
{
  "applicationId": 2,
  "whitelistRecipients": {
    "16": ["abce@gmail.com", "test@email.co"],
    "18": ["+918900100002", "+918900100003"]
  }
}
Whitelist can be added or updated even if the application is not in test mode.

Identifying Test Mode Notifications

Notifications processed in test mode have the following characteristics:
FieldValue
delivery_statusSUCCESS (5)
result{"result": "This is a test mode notification. Notification was not delivered to recipient."}
retry_count0

Best Practices

1

Validate Whitelist JSON

Always validate your whitelist JSON before submission using a JSON validator tool
2

Use Provider-Specific Whitelists

Configure whitelists per provider to control which channels can send real notifications
3

Wildcard Carefully

Use the ["*"] wildcard only when you want a specific provider to bypass test mode completely