WebHook.Create
--------------

Creates a new web hook object.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebHook](component_WebHook.md) | [11.5](newinversion115.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "WebHook.Create" ) ### Parameters

none

### Result

Returns reference number or error.

### Description

Creates a new web hook object.  
Please call [WebHook.Release](WebHookRelease.md) later to free it.  
  
You can decide whether you want your web hook always answer the same answer with auto answering (defaults to HTTP 200 OK as response) or whether you like to disable that, keep connection open and answer the query in a timely manner in the scripts. But if FileMaker is busy, you may be too late (2 minutes usually) and the connection is already timed out.  
### Examples

Start a normal HTTP Webhook:

 Set Variable \[ $$WebHooks ; Value: MBS ("WebHook.Create") \]   
Set Variable \[ $r ; Value: MBS ("[WebHook.Listen](WebHookListen.md)"; $$WebHooks ; 9999) \]   
Set Variable \[ $r ; Value: MBS ("[WebHook.SetScript](WebHookSetScript.md)"; $$WebHooks ; Get(FileName); "WebHookReceived") \]  
Start a SSL HTTP Webhook:

 Set Variable \[ $$WebHooks ; Value: MBS ("WebHook.Create") \]   
Set Variable \[ $r ; Value: MBS ("[WebHook.SetSSL](WebHookSetSSL.md)"; $$WebHooks ; "/Users/cs/WebHook/certificate.crt"; "/Users/cs/WebHook/private\_key.pem") \]   
Set Variable \[ $r ; Value: MBS ("[WebHook.Listen](WebHookListen.md)"; $$WebHooks ; 9999) \]   
Set Variable \[ $r ; Value: MBS ("[WebHook.SetScript](WebHookSetScript.md)"; $$WebHooks ; Get(FileName); "WebHookReceived") \]  
Start a RAW hook:

 If \[ IsEmpty ( $$WebHooks ) \]   
 Set Variable \[ $$WebHooks ; Value: MBS ("WebHook.Create") \]   
 #   
 # enable keep open and disable auto answer, so we can send custom answer  
 Set Variable \[ $r ; Value: MBS ("[WebHook.SetAutoAnswer](WebHookSetAutoAnswer.md)"; $$Webhooks ; ""; "UTF-8") \]   
 Set Variable \[ $r ; Value: MBS ("[WebHook.SetMode](WebHookSetMode.md)"; $$WebHooks ; 2+1) \]   
 #   
 Set Variable \[ $r ; Value: MBS ("[WebHook.Listen](WebHookListen.md)"; $$WebHooks ; WebHook::Server Port) \]   
 Set Variable \[ $r ; Value: MBS ("[WebHook.SetScript](WebHookSetScript.md)"; $$WebHooks ; Get(FileName); "WebHookReceived With RAW Mode") \]   
 Set Field \[ WebHook::Server Webhook ; $$WebHooks \]   
End If  
### See also

- [WebHook.List](WebHookList.md)
- [WebHook.Listen](WebHookListen.md)
- [WebHook.Release](WebHookRelease.md)
- [WebHook.SetAutoAnswer](WebHookSetAutoAnswer.md)
- [WebHook.SetMode](WebHookSetMode.md)
- [WebHook.SetScript](WebHookSetScript.md)
- [WebHook.SetSSL](WebHookSetSSL.md)
- [WebView.Create](WebViewCreate.md)

### Example Databases

- [CURL/Email/GMail oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/GMail%20oAuth%20SMTP.shtml#1ScriptAnchor_)
- [CURL/Email/Office 365 oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Office%20365%20oAuth%20SMTP.shtml#1ScriptAnchor_)
- [WebHook/Trigger script with Webhook/WebHook Listener](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/Trigger%20script%20with%20Webhook/WebHook%20Listener.shtml#1ScriptAnchor_)
- [WebHook/WebHook Chat/WebHook Chat](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/WebHook%20Chat/WebHook%20Chat.shtml#1ScriptAnchor_)
- [WebHook/WebHook to serve html](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/WebHook%20to%20serve%20html.shtml#1ScriptAnchor_)
- [WebHook/WebHook](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/WebHook.shtml#1ScriptAnchor_)

### Blog Entries

- [Using Gmail with oAuth2 for SMTP with MBS Plugin](https://www.mbsplugins.de/archive/2025-05-08/Using_Gmail_with_oAuth2_for_SM/monkeybreadsoftware_blog_filemaker)
- [Trigger Scripts via WebHook](https://www.mbsplugins.de/archive/2022-12-08/Trigger_Scripts_via_WebHook/monkeybreadsoftware_blog_filemaker)
- [SMTP with OAuth for Office 365 in FileMaker](https://www.mbsplugins.de/archive/2022-11-22/SMTP_with_OAuth_for_Office_365/monkeybreadsoftware_blog_filemaker)
- [WebHook Introduction](https://www.mbsplugins.de/archive/2021-10-28/WebHook_Introduction/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 13th October 2021 , last changed 18th October 2021

  
[WebHook.Check](WebHookCheck.md) - [WebHook.GetAutoAnswer](WebHookGetAutoAnswer.md)

[HTML Version](WebHookCreate.shtml)