Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Sets auto answer text.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WebHook | 11.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
WebHook | The reference number of the web hook. | $webhook | |
Text | The text to send out. Should use CRLF as line endings and end with two CRLF. |
||
Encoding | The text encoding for result. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
"UTF8" | Optional |
Returns OK or error.
Set auto answer:
Set Variable [ $text ; Value: "HTTP/1.1 201 Created¶Server: MyServer 1.0¶Connection: close¶Content-Length: 0¶¶" ]
Set Variable [ $text ; Value: MBS( "Text.ReplaceNewline"; $Text; 3 ) ]
Set Variable [ $r ; Value: MBS("WebHook.SetAutoAnswer"; WebHook::Server Webhook; $text; "UTF-8") ]
Clear auto answer:
Set Variable [ $r ; Value: MBS("WebHook.SetAutoAnswer"; $Webhook; "") ]
Set auto answer with some text:
Set Variable [ $Answer ; Value: "Your request was received. Thank you.¶" ]
# we need to know lenght of text in UTF-8, so we convert to hex to measure.
Set Variable [ $Answer ; Value: MBS( "Text.ReplaceNewline"; $Answer; 3 ) ]
Set Variable [ $AnswerLength ; Value: Length(MBS( "Text.EncodeToHex"; $Answer; "UTF-8")) / 2 ]
# now we build the http request
Set Variable [ $Text ; Value: "HTTP/1.1 201 Created¶Server: MyServer 1.0¶Connection: close¶Content-Length: " & $AnswerLength & "¶¶" & $Answer ]
Set Variable [ $Text ; Value: MBS( "Text.ReplaceNewline"; $Text; 3 ) ]
Set Variable [ $r ; Value: MBS("WebHook.SetAutoAnswer"; WebHook::Server Webhook; $Text; "UTF-8") ]
This function checks for a license.
Created 17th October 2021, last changed 13th October 2022