1. Advanced Configuration
  2. Notification Parameters

Advanced Configuration

Notification Parameters

Basic payload

  • To send a payload you need to know the webchat client sessionuuid
  • You may send any combination of message and client configuration in a single payload
        {
  "message_out_webchat": {
    "platforms": {
      "webchat": {
        "sessionuuid": "~~stub.data.heimdall.webchat.sessionuuid",
      }
    }
  }
}

      

Sending a message

To send a message add webchat_message to the webchat object

webchat_agent is optional (Default : 'Agent')

webchat_message.type ( text / markdown / html )

        {
  "webchat": {
    "sessionuuid": "~~stub.data.heimdall.webchat.sessionuuid",
    "webchat_message": {
      "type": "markdown",
      "value": "Your message was received by stubber. This is an example of a reply"
    }
  }
}

      

Sending a message with custom agent name

Add webchat_agent to the webchat object

webchat_agent is optional (Default : 'Agent')

        {
  "webchat": {
    "sessionuuid": "~~stub.data.heimdall.webchat.sessionuuid",
    "webchat_agent": {
      "name": "AI assistant"
    },
    "webchat_message": {
      "type": "markdown",
      "value": "Your message was received by stubber. This is an example of a reply"
    }
  }
}

      

Sending a form

form_name is used as a unique identifier

        {
  "webchat": {
    "sessionuuid": "~~stub.data.heimdall.webchat.sessionuuid",
    "webchat_agent": {
      "name": "AI assistant"
    },
    "webchat_message": {
      "type": "form",
      "value": {
        "form_name": "email_form",
        "spec": {
          "fields": {
            "email": {
              "fieldtype": "email"
            },
          },
        },
      }
    }
  }
}

      

Sending client settings

To update client settings add webchat_client_configuration to the webchat object

        {
  "webchat": {
    "sessionuuid": "~~stub.data.heimdall.webchat.sessionuuid",
    "webchat_client_configuration": {
      "setting_one": {
        "type": "default_country_code",
        "value": "ZA"
      }
      // you may add multiple setting objects in one payload
    }
  }
}

      

Available settings :

default country code

Sets the default country code for any fields requiring country specific entries

        {
  "setting_one": {
    "type": "default_country_code",
    "value": "ZA"
  }
}

      

switching

Enables users to switch between different communication platforms, providing the option to continue conversations on alternative channels directly from the webchat.

        
"channel_switching": {
  "type": "switching",
  "value": {
    "whatsapp": true,
    "sms": false,
    "email": true
  }
},

      

switching return

When a user selects a platform and submits their details the following payload will be sent to the stub

        "_incoming_webchat_data": {
  "sessionuuid": "136b6023-44f3-48d5-aaa5-5e8024e055fd",
  "webchat_client_configuration": {
    "platform_switch": {
      "platform_name": "whatsapp", // this can be sms or email
      "type": "mobile",
      "value": "+18005550100"
    }
  }
}

      

file upload

Allow file uploading with messages.

        {
  "setting_one": {
    "type": "files",
    "value": {
      "enable": true
    }
  }
}

      

voice notes

Allow user to send voice notes instead of messages

        {
  "setting_one": {
    "type": "voicenote",
    "value": {
      "enable": true
    },
  }
}